diff --git a/SGGL/FineUIPro.Web/TestRun/ProduceTestRun/RunningLogManagementEdit.aspx b/SGGL/FineUIPro.Web/TestRun/ProduceTestRun/RunningLogManagementEdit.aspx index facbc433..119f1ecf 100644 --- a/SGGL/FineUIPro.Web/TestRun/ProduceTestRun/RunningLogManagementEdit.aspx +++ b/SGGL/FineUIPro.Web/TestRun/ProduceTestRun/RunningLogManagementEdit.aspx @@ -17,7 +17,7 @@ - + @@ -62,72 +62,71 @@ - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -161,14 +182,36 @@ - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -184,5 +227,115 @@ + + + + diff --git a/SGGL/FineUIPro.Web/TestRun/ProduceTestRun/RunningLogManagementEdit.aspx.cs b/SGGL/FineUIPro.Web/TestRun/ProduceTestRun/RunningLogManagementEdit.aspx.cs index 5f124b52..f25e6cc1 100644 --- a/SGGL/FineUIPro.Web/TestRun/ProduceTestRun/RunningLogManagementEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/TestRun/ProduceTestRun/RunningLogManagementEdit.aspx.cs @@ -1,9 +1,15 @@ using BLL; +using FineUIPro.Web.DataShow; +using FineUIPro.Web.ProjectData; +using Model; +using Newtonsoft.Json.Linq; +using NPOI.SS.Formula.Functions; using System; using System.Collections.Generic; using System.Linq; using System.Runtime.InteropServices.ComTypes; using System.Web; +using System.Web.Services.Description; using System.Web.UI; using System.Web.UI.WebControls; @@ -15,17 +21,12 @@ namespace FineUIPro.Web.TestRun.ProduceTestRun /// 日志 /// public string RunningId { get { return (string)ViewState["RunningId"]; } set { ViewState["RunningId"] = value; } } - /// - /// 系统主键 - /// - public string SystemId { get { return (string)ViewState["SystemId"]; } set { ViewState["SystemId"] = value; } } protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { this.RunningId = Request["RunningId"]; - this.SystemId = Request["SystemId"]; PageBase(); } } @@ -35,6 +36,21 @@ namespace FineUIPro.Web.TestRun.ProduceTestRun /// public void PageBase() { + //获取系统 + var syslist = Funs.DB.PreRun_SysDevice.Where(x => x.ProjectId == this.CurrUser.LoginProjectId && x.PreRunLevel == 3).ToList(); + if (syslist.Count > 0) + { + int i = 0; + ListItem[] list = new ListItem[syslist.Count]; + foreach (var item in syslist) + { + list[i] = new ListItem(item.PreRunName, item.PreRunId); + i++; + } + this.rdbOperation.DataSource = list; + this.rdbOperation.DataBind(); + } + //获取人员 var userList = from user in Funs.DB.Sys_User join projectrole in Funs.DB.Project_ProjectUser on user.UserId equals projectrole.UserId @@ -63,93 +79,21 @@ namespace FineUIPro.Web.TestRun.ProduceTestRun var model = Funs.DB.Running_LogManagement.FirstOrDefault(x => x.RunningId == this.RunningId); if (model != null) { + options.Add(model.SystemId); txtJobNo.Text = model.JobNo; ddlShiftUser.SelectedValue = model.ShiftUser; ddlSuccessionUser.SelectedValue = model.SuccessionUser; txtStartData.Text = model.StartData.Value.ToString("yyyy-MM-dd HH:mm:ss"); txtEndData.Text = model.EndData.Value.ToString("yyyy-MM-dd HH:mm:ss"); - if (model.IsDesalinated == 1) - { - options.Add("1"); - tys.Hidden = false; - txtDesalinatedSituation.Text = model.DesalinatedSituation; - txtDesalinatedRemarks.Text = model.DesalinatedRemarks; - } - else - { - tys.Hidden = true; - } - if (model.IsLoop == 1) - { - options.Add("2"); - xhs.Hidden = false; - txtLoopSituation.Text = model.LoopSituation; - txtLoopRemarks.Text = model.LoopRemarks; - } - else - { - xhs.Hidden = true; - } - if (model.IsSteam == 1) - { - options.Add("3"); - zq.Hidden = false; - txtSteamSituation.Text = model.SteamSituation; - txtSteamRemarks.Text = model.SteamRemarks; - } - else - { - zq.Hidden = true; - } - if (model.IsAirCompression == 1) - { - options.Add("4"); - kyz.Hidden = false; - txtAirCompressionSituation.Text = model.AirCompressionSituation; - txtAirCompressionRemarks.Text = model.AirCompressionRemarks; - } - else - { - kyz.Hidden = true; - } - if (model.IsCompoundAmmonia == 1) - { - options.Add("5"); - hca.Hidden = false; - txtCompoundAmmoniaSituation.Text = model.CompoundAmmoniaSituation; - txtCompoundAmmoniaRemarks.Text = model.CompoundAmmoniaRemarks; - } - else - { - hca.Hidden = true; - } - if (model.IsUrea == 1) - { - options.Add("6"); - ns.Hidden = false; - txtUreaSituation.Text = model.UreaSituation; - txtUreaRemarks.Text = model.UreaRemarks; - } - else - { - ns.Hidden = true; - } rdbOperation.SelectedValueArray = options.ToArray(); txtHandoverCare.Text = model.HandoverCare; - txtOperationReason.Text = model.OperationReason; - txtOperationHandle.Text = model.OperationHandle; - txtMaintenanceReason.Text = model.MaintenanceReason; - txtMaintenanceHandle.Text = model.MaintenanceHandle; + DataBrid(); + gvOperationBrid(); + gvMaintenanceBrid(); } else { txtJobNo.Text = SQLHelper.RunProcNewId("SpGetNewCode5", "dbo.Running_LogManagement", "JobNo", "13022-PS81-"); - tys.Hidden = true; - xhs.Hidden = true; - zq.Hidden = true; - kyz.Hidden = true; - hca.Hidden = true; - ns.Hidden = true; } } @@ -158,13 +102,29 @@ namespace FineUIPro.Web.TestRun.ProduceTestRun /// protected void rdbOperation_SelectedIndexChanged(object sender, EventArgs e) { - var rdbArr = rdbOperation.SelectedValueArray; - tys.Hidden = rdbArr.Contains("1") ? false : true; - xhs.Hidden = rdbArr.Contains("2") ? false : true; - zq.Hidden = rdbArr.Contains("3") ? false : true; - kyz.Hidden = rdbArr.Contains("4") ? false : true; - hca.Hidden = rdbArr.Contains("5") ? false : true; - ns.Hidden = rdbArr.Contains("6") ? false : true; + var syslist = Funs.DB.PreRun_SysDevice.Where(x => x.ProjectId == this.CurrUser.LoginProjectId && x.PreRunLevel == 3).ToList(); + var rdbIdArr = rdbOperation.SelectedItemArray; + var list = gvSystemOptionLs(); + foreach (var item in rdbIdArr) + { + if (list.Count(x => x.SystemId == item.Value) > 0) continue; + var itemsys = syslist.FirstOrDefault(x => x.PreRunId == item.Value); + list.Add(new Running_LogManagementDto + { + RunningId = Guid.NewGuid().ToString(), + ProjectId = this.CurrUser.LoginProjectId, + InstallationId = itemsys.InstallationId, + ProcessesId = itemsys.ProcessesId, + SystemId = itemsys.SystemId, + SystemName = itemsys.PreRunName, + Situation = "", + Remarks = "", + AddUser = CurrUser.UserId, + AddTime = DateTime.Now, + }); + } + list.RemoveAll(r => !rdbOperation.SelectedValueArray.Contains(r.SystemId)); + DataBrid(list); } /// @@ -182,77 +142,370 @@ namespace FineUIPro.Web.TestRun.ProduceTestRun ShowNotify("请选择继任职工!", MessageBoxIcon.Warning); return; } - var sysmodel = Funs.DB.PreRun_SysDevice.FirstOrDefault(x => x.PreRunId == this.SystemId); - if (sysmodel == null) + var list = gvSystemOptionLs(); + if (list.Count == 0) { - Alert.ShowInTop("系统参数错误!", MessageBoxIcon.Warning); + ShowNotify("请选择系统!", MessageBoxIcon.Warning); + return; + } + var optionlist = gvOperationLs(); + if (optionlist.Count == 0) + { + ShowNotify("请添加操作问题!", MessageBoxIcon.Warning); + return; + } + var maintenancelist = gvMaintenanceLs(); + if (maintenancelist.Count == 0) + { + ShowNotify("请添加维护问题!", MessageBoxIcon.Warning); return; } - var edata = DateTime.Parse(txtEndData.Text); - if (!string.IsNullOrWhiteSpace(this.RunningId)) + var addlist = new List(); + var addoptionlist = new List(); + var addmaintenancelist = new List(); + var ids = list.ConvertAll(x => x.RunningId); + var existlist = Funs.DB.Running_LogManagement.Where(x => ids.Contains(x.RunningId)).ToList(); + foreach (var item in list) { - if (Funs.DB.Running_LogManagement.Count(x => x.ShiftType == ddlShiftType.SelectedValue && x.SystemId == this.SystemId && x.EndData.Value.Year == edata.Year && x.EndData.Value.Month == edata.Month && x.EndData.Value.Day == edata.Day && x.RunningId != this.RunningId) > 0) + bool add = false; + var model = existlist.FirstOrDefault(x => x.RunningId == this.RunningId); + if (model == null) { - Alert.ShowInTop($"{DateTime.Now.ToString("yyyy-MM-dd")}已添加{ddlShiftType.SelectedText}日志,无法继续添加!", MessageBoxIcon.Warning); - return; + add = true; + model = new Running_LogManagement(); + model.RunningId = Guid.NewGuid().ToString(); + model.ProjectId = this.CurrUser.LoginProjectId; + model.AddUser = this.CurrUser.UserId; + model.AddTime = DateTime.Now; + } + model.InstallationId = item.InstallationId; + model.ProcessesId = item.ProcessesId; + model.SystemId = item.SystemId; + model.JobNo = txtJobNo.Text; + model.HandoverCare = txtHandoverCare.Text; + model.ShiftType = ddlShiftType.SelectedValue; + model.ShiftUser = ddlShiftUser.SelectedValue; + model.SuccessionUser = ddlSuccessionUser.SelectedValue; + model.StartData = DateTime.Parse(txtStartData.Text); + model.EndData = DateTime.Parse(txtEndData.Text); + model.Situation = item.Situation; + model.Remarks = item.Remarks; + + foreach (var itemoption in optionlist) + { + addoptionlist.Add(new Running_Operation() + { + OperationId = Guid.NewGuid().ToString(), + RunningId = model.RunningId, + InstallationId = item.InstallationId, + ProcessesId = item.ProcessesId, + SystemId = item.SystemId, + OperationReason = itemoption.OperationReason, + OperationHandle = itemoption.OperationHandle, + ProjectId = this.CurrUser.LoginProjectId, + AddUser = this.CurrUser.UserId, + AddTime = DateTime.Now, + }); + } + foreach (var itemmain in maintenancelist) + { + addmaintenancelist.Add(new Running_Maintenance() + { + MaintenanceId = Guid.NewGuid().ToString(), + RunningId = model.RunningId, + InstallationId = item.InstallationId, + ProcessesId = item.ProcessesId, + SystemId = item.SystemId, + MaintenanceReason = itemmain.MaintenanceReason, + MaintenanceHandle = itemmain.MaintenanceHandle, + ProjectId = this.CurrUser.LoginProjectId, + AddUser = this.CurrUser.UserId, + AddTime = DateTime.Now, + }); + } + if (add) + { + Funs.DB.SubmitChanges(); + addlist.Add(model); + } + else + { + Funs.DB.SubmitChanges(); } } - else + if (addlist.Count > 0) Funs.DB.Running_LogManagement.InsertAllOnSubmit(addlist); + var runIds = list.ConvertAll(x => x.RunningId); + var deleteOperas = Funs.DB.Running_Operation.Where(x => runIds.Contains(x.RunningId)).ToList(); + if (deleteOperas.Count > 0) { - if (Funs.DB.Running_LogManagement.Count(x => x.ShiftType == ddlShiftType.SelectedValue && x.SystemId == this.SystemId && x.EndData.Value.Year == edata.Year && x.EndData.Value.Month == edata.Month && x.EndData.Value.Day == edata.Day) > 0) - { - Alert.ShowInTop($"{DateTime.Now.ToString("yyyy-MM-dd")}已添加{ddlShiftType.SelectedText}日志,无法继续添加!", MessageBoxIcon.Warning); - return; - } + Funs.DB.Running_Operation.DeleteAllOnSubmit(deleteOperas); + Funs.DB.SubmitChanges(); } - bool add = false; - var model = Funs.DB.Running_LogManagement.FirstOrDefault(x => x.RunningId == this.RunningId); - if (model == null) + var deleteMaints = Funs.DB.Running_Maintenance.Where(x => runIds.Contains(x.RunningId)).ToList(); + if (deleteMaints.Count > 0) { - add = true; - model = new Model.Running_LogManagement(); - model.RunningId = Guid.NewGuid().ToString(); - model.ProjectId = this.CurrUser.LoginProjectId; - model.InstallationId = sysmodel.InstallationId; - model.ProcessesId = sysmodel.ProcessesId; - model.SystemId = this.SystemId; - model.AddUser = this.CurrUser.UserId; - model.AddTime = DateTime.Now; + Funs.DB.Running_Maintenance.DeleteAllOnSubmit(deleteMaints); + Funs.DB.SubmitChanges(); } - model.JobNo = txtJobNo.Text; - model.ShiftType = ddlShiftType.SelectedValue; - model.ShiftUser = ddlShiftUser.SelectedValue; - model.SuccessionUser = ddlSuccessionUser.SelectedValue; - model.StartData = DateTime.Parse(txtStartData.Text); - model.EndData = DateTime.Parse(txtEndData.Text); - model.IsDesalinated = rdbOperation.SelectedValueArray.Contains("1") ? 1 : 0; - model.DesalinatedSituation = txtDesalinatedSituation.Text; - model.DesalinatedRemarks = txtDesalinatedRemarks.Text; - model.IsLoop = rdbOperation.SelectedValueArray.Contains("2") ? 1 : 0; - model.LoopSituation = txtLoopSituation.Text; - model.LoopRemarks = txtLoopRemarks.Text; - model.IsSteam = rdbOperation.SelectedValueArray.Contains("3") ? 1 : 0; - model.SteamSituation = txtSteamSituation.Text; - model.SteamRemarks = txtSteamRemarks.Text; - model.IsAirCompression = rdbOperation.SelectedValueArray.Contains("4") ? 1 : 0; - model.AirCompressionSituation = txtAirCompressionSituation.Text; - model.AirCompressionRemarks = txtAirCompressionRemarks.Text; - model.IsCompoundAmmonia = rdbOperation.SelectedValueArray.Contains("5") ? 1 : 0; - model.CompoundAmmoniaSituation = txtCompoundAmmoniaSituation.Text; - model.CompoundAmmoniaRemarks = txtCompoundAmmoniaRemarks.Text; - model.IsUrea = rdbOperation.SelectedValueArray.Contains("6") ? 1 : 0; - model.UreaSituation = txtUreaSituation.Text; - model.UreaRemarks = txtUreaRemarks.Text; - model.HandoverCare = txtHandoverCare.Text; - model.OperationReason = txtOperationReason.Text; - model.OperationHandle = txtOperationHandle.Text; - model.MaintenanceReason = txtMaintenanceReason.Text; - model.MaintenanceHandle = txtMaintenanceHandle.Text; - if (add) Funs.DB.Running_LogManagement.InsertOnSubmit(model); + Funs.DB.Running_Operation.InsertAllOnSubmit(addoptionlist); + Funs.DB.Running_Maintenance.InsertAllOnSubmit(addmaintenancelist); Funs.DB.SubmitChanges(); + ShowNotify("操作成功!", MessageBoxIcon.Success); PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); } + + /// + /// 日志管理绑定 + /// + public void DataBrid(List list = null) + { + if (list == null) list = new List(); + var query = from a in Funs.DB.Running_LogManagement + join b in Funs.DB.PreRun_SysDevice on a.SystemId equals b.PreRunId + where a.RunningId == this.RunningId + select new Running_LogManagementDto + { + RunningId = a.RunningId, + ProjectId = a.ProjectId, + InstallationId = a.InstallationId, + ProcessesId = a.ProcessesId, + SystemId = a.SystemId, + SystemName = b.PreRunName, + JobNo = a.JobNo, + ShiftType = a.ShiftType, + ShiftUser = a.ShiftUser, + SuccessionUser = a.SuccessionUser, + StartData = a.StartData, + EndData = a.EndData, + Situation = a.Situation, + Remarks = a.Remarks, + HandoverCare = a.HandoverCare, + AddUser = a.AddUser, + AddTime = a.AddTime + }; + + var data = query.ToList(); + if (data.Count > 0) list.AddRange(data); + gvSystemOption.DataSource = list; + gvSystemOption.DataBind(); + } + + /// + /// 获取绑定集合 + /// + private List gvSystemOptionLs() + { + List massQuestionLs = new List(); + JArray mergedData = gvSystemOption.GetMergedData(); + foreach (JObject mergedRow in mergedData) + { + string status = mergedRow.Value("status"); + JObject values = mergedRow.Value("values"); + int i = mergedRow.Value("index"); + massQuestionLs.Add(new Running_LogManagementDto + { + RunningId = this.gvSystemOption.Rows[i].DataKeys[0].ToString(), + ProjectId = this.CurrUser.LoginProjectId, + InstallationId = this.gvSystemOption.Rows[i].DataKeys[1].ToString(), + ProcessesId = this.gvSystemOption.Rows[i].DataKeys[2].ToString(), + SystemId = this.gvSystemOption.Rows[i].DataKeys[3].ToString(), + SystemName = this.gvSystemOption.Rows[i].DataKeys[4].ToString(), + Situation = values.Value("Situation"), + Remarks = values.Value("Remarks"), + AddUser = CurrUser.UserId, + AddTime = DateTime.Now, + }); + } + return massQuestionLs; + } + + public class Running_LogManagementDto : Running_LogManagement + { + public string SystemName { get; set; } + } + + #region 操作问题 + + /// + /// 操作问题绑定 + /// + public void gvOperationBrid() + { + var list = Funs.DB.Running_Operation.Where(x => x.RunningId == this.RunningId).ToList(); + gvOperation.DataSource = list; + gvOperation.DataBind(); + } + + /// + /// 操作问题集合 + /// + private List gvOperationLs() + { + List massQuestionLs = new List(); + JArray mergedData = gvOperation.GetMergedData(); + foreach (JObject mergedRow in mergedData) + { + string status = mergedRow.Value("status"); + JObject values = mergedRow.Value("values"); + int i = mergedRow.Value("index"); + massQuestionLs.Add(new Running_Operation + { + OperationId = IsStrVal(this.gvOperation.Rows[i].DataKeys[0]), + RunningId = IsStrVal(this.gvOperation.Rows[i].DataKeys[1]), + ProjectId = this.CurrUser.LoginProjectId, + InstallationId = IsStrVal(this.gvOperation.Rows[i].DataKeys[2]), + ProcessesId = IsStrVal(this.gvOperation.Rows[i].DataKeys[3]), + SystemId = IsStrVal(this.gvOperation.Rows[i].DataKeys[4]), + OperationReason = values.Value("OperationReason"), + OperationHandle = values.Value("OperationHandle"), + AddUser = CurrUser.UserId, + AddTime = DateTime.Now, + Sort = i + }); + } + return massQuestionLs; + } + + /// + /// 维护问题删除 + /// + /// + /// + protected void gvOperation_RowCommand(object sender, GridCommandEventArgs e) + { + if (e.CommandName == "Delete") + { + string rowID = e.RowID; + var model = Funs.DB.Running_Operation.FirstOrDefault(p => p.OperationId == rowID); + if (model != null) + { + Funs.DB.Running_Operation.DeleteOnSubmit(model); + Funs.DB.SubmitChanges(); + gvOperationBrid(); + ShowNotify("删除成功!"); + } + else + { + var list = gvOperationLs(); + list.RemoveAll(x => x.OperationId == rowID); + gvOperation.DataSource = list; + gvOperation.DataBind(); + ShowNotify("删除成功!"); + } + } + } + + /// + /// 新增 + /// + protected void btnOperationAdd_Click(object sender, EventArgs e) + { + var list = gvOperationLs(); + Running_Operation model = new Running_Operation + { + OperationId = Guid.NewGuid().ToString() + }; + list.Add(model); + this.gvOperation.DataSource = list; + this.gvOperation.DataBind(); + } + + #endregion + + #region 维护问题 + + /// + /// 维护问题绑定 + /// + public void gvMaintenanceBrid() + { + var list = Funs.DB.Running_Maintenance.Where(x => x.RunningId == this.RunningId).ToList(); + gvMaintenance.DataSource = list; + gvMaintenance.DataBind(); + } + + /// + /// 维护问题集合 + /// + private List gvMaintenanceLs() + { + List massQuestionLs = new List(); + JArray mergedData = gvMaintenance.GetMergedData(); + foreach (JObject mergedRow in mergedData) + { + string status = mergedRow.Value("status"); + JObject values = mergedRow.Value("values"); + int i = mergedRow.Value("index"); + massQuestionLs.Add(new Running_Maintenance + { + MaintenanceId = IsStrVal(this.gvMaintenance.Rows[i].DataKeys[0]), + RunningId = IsStrVal(this.gvMaintenance.Rows[i].DataKeys[1]), + ProjectId = this.CurrUser.LoginProjectId, + InstallationId = IsStrVal(this.gvMaintenance.Rows[i].DataKeys[2]), + ProcessesId = IsStrVal(this.gvMaintenance.Rows[i].DataKeys[3]), + SystemId = IsStrVal(this.gvMaintenance.Rows[i].DataKeys[4]), + MaintenanceReason = values.Value("MaintenanceReason"), + MaintenanceHandle = values.Value("MaintenanceHandle"), + AddUser = CurrUser.UserId, + AddTime = DateTime.Now, + Sort = i + }); + } + return massQuestionLs; + } + + /// + /// 维护问题删除 + /// + protected void gvMaintenance_RowCommand(object sender, GridCommandEventArgs e) + { + if (e.CommandName == "Delete") + { + string rowID = e.RowID; + var model = Funs.DB.Running_Maintenance.FirstOrDefault(p => p.MaintenanceId == rowID); + if (model != null) + { + Funs.DB.Running_Maintenance.DeleteOnSubmit(model); + Funs.DB.SubmitChanges(); + gvMaintenanceBrid(); + ShowNotify("删除成功!"); + } + else + { + var list = gvMaintenanceLs(); + list.RemoveAll(x => x.MaintenanceId == rowID); + gvMaintenance.DataSource = list; + gvMaintenance.DataBind(); + ShowNotify("删除成功!"); + } + } + } + + /// + /// 新增 + /// + protected void btnMaintenanceAdd_Click(object sender, EventArgs e) + { + var list = gvMaintenanceLs(); + Running_Maintenance model = new Running_Maintenance + { + MaintenanceId = Guid.NewGuid().ToString() + }; + list.Add(model); + this.gvMaintenance.DataSource = list; + this.gvMaintenance.DataBind(); + } + + #endregion + + public string IsStrVal(object value) + { + var result = string.Empty; + if (value != null) result = value.ToString(); + return result; + } + } } \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/TestRun/ProduceTestRun/RunningLogManagementEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/TestRun/ProduceTestRun/RunningLogManagementEdit.aspx.designer.cs index 716dd71c..bd1e4335 100644 --- a/SGGL/FineUIPro.Web/TestRun/ProduceTestRun/RunningLogManagementEdit.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/TestRun/ProduceTestRun/RunningLogManagementEdit.aspx.designer.cs @@ -150,166 +150,67 @@ namespace FineUIPro.Web.TestRun.ProduceTestRun protected global::FineUIPro.CheckBoxList rdbOperation; /// - /// tys 控件。 + /// ContentPanel4 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.FormRow tys; + protected global::FineUIPro.ContentPanel ContentPanel4; /// - /// txtDesalinatedSituation 控件。 + /// Form5 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.TextArea txtDesalinatedSituation; + protected global::FineUIPro.Form Form5; /// - /// txtDesalinatedRemarks 控件。 + /// gvSystemOption 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.TextArea txtDesalinatedRemarks; + protected global::FineUIPro.Grid gvSystemOption; /// - /// xhs 控件。 + /// txtSituation 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.FormRow xhs; + protected global::FineUIPro.TextArea txtSituation; /// - /// txtLoopSituation 控件。 + /// txtRemarks 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.TextArea txtLoopSituation; + protected global::FineUIPro.TextArea txtRemarks; /// - /// txtLoopRemarks 控件。 + /// ContentPanel5 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.TextArea txtLoopRemarks; + protected global::FineUIPro.ContentPanel ContentPanel5; /// - /// zq 控件。 + /// Form6 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.FormRow zq; - - /// - /// txtSteamSituation 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.TextArea txtSteamSituation; - - /// - /// txtSteamRemarks 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.TextArea txtSteamRemarks; - - /// - /// kyz 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.FormRow kyz; - - /// - /// txtAirCompressionSituation 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.TextArea txtAirCompressionSituation; - - /// - /// txtAirCompressionRemarks 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.TextArea txtAirCompressionRemarks; - - /// - /// hca 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.FormRow hca; - - /// - /// txtCompoundAmmoniaSituation 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.TextArea txtCompoundAmmoniaSituation; - - /// - /// txtCompoundAmmoniaRemarks 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.TextArea txtCompoundAmmoniaRemarks; - - /// - /// ns 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.FormRow ns; - - /// - /// txtUreaSituation 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.TextArea txtUreaSituation; - - /// - /// txtUreaRemarks 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.TextArea txtUreaRemarks; + protected global::FineUIPro.Form Form6; /// /// txtHandoverCare 控件。 @@ -338,6 +239,33 @@ namespace FineUIPro.Web.TestRun.ProduceTestRun /// protected global::FineUIPro.Form Form3; + /// + /// gvOperation 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid gvOperation; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// btnOperationAdd 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnOperationAdd; + /// /// txtOperationReason 控件。 /// @@ -374,6 +302,33 @@ namespace FineUIPro.Web.TestRun.ProduceTestRun /// protected global::FineUIPro.Form Form4; + /// + /// gvMaintenance 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid gvMaintenance; + + /// + /// Toolbar3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar3; + + /// + /// btnMaintenanceAdd 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnMaintenanceAdd; + /// /// txtMaintenanceReason 控件。 /// diff --git a/SGGL/FineUIPro.Web/TestRun/ProduceTestRun/RunningLogManagementList.aspx b/SGGL/FineUIPro.Web/TestRun/ProduceTestRun/RunningLogManagementList.aspx index 470d6eab..4492d70c 100644 --- a/SGGL/FineUIPro.Web/TestRun/ProduceTestRun/RunningLogManagementList.aspx +++ b/SGGL/FineUIPro.Web/TestRun/ProduceTestRun/RunningLogManagementList.aspx @@ -84,6 +84,12 @@ + + + + + + diff --git a/SGGL/FineUIPro.Web/TestRun/ProduceTestRun/RunningLogManagementList.aspx.cs b/SGGL/FineUIPro.Web/TestRun/ProduceTestRun/RunningLogManagementList.aspx.cs index f037aa0d..88b9b82e 100644 --- a/SGGL/FineUIPro.Web/TestRun/ProduceTestRun/RunningLogManagementList.aspx.cs +++ b/SGGL/FineUIPro.Web/TestRun/ProduceTestRun/RunningLogManagementList.aspx.cs @@ -19,17 +19,13 @@ namespace FineUIPro.Web.TestRun.ProduceTestRun { public partial class RunningLogManagementList : PageBase { - /// - /// 系统主键 - /// - public string SystemId { get { return (string)ViewState["SystemId"]; } set { ViewState["SystemId"] = value; } } - protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //绑定数据 InitTreeMenu(); + BindGrid(); } } @@ -99,10 +95,6 @@ namespace FineUIPro.Web.TestRun.ProduceTestRun /// protected void tvControlItem_NodeCommand(object sender, TreeCommandEventArgs e) { - if (this.tvControlItem.SelectedNodeID.Split('|').Length > 2) - { - this.SystemId = this.tvControlItem.SelectedNodeID.Split('|').Last(); - } this.BindGrid(); } @@ -115,14 +107,17 @@ namespace FineUIPro.Web.TestRun.ProduceTestRun /// public void BindGrid() { - string strSql = @"select a.RunningId,a.ProjectId,project.ProjectName as ProjectName,a.InstallationId,a.ProcessesId,a.SystemId,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.IsDesalinated,a.DesalinatedSituation,a.DesalinatedRemarks,a.IsLoop,a.LoopSituation,a.LoopRemarks,a.IsSteam,a.SteamSituation,a.SteamRemarks,a.IsAirCompression,a.AirCompressionSituation,a.AirCompressionRemarks,a.IsCompoundAmmonia,a.CompoundAmmoniaSituation,a.CompoundAmmoniaRemarks,a.IsUrea,a.UreaSituation,a.UreaRemarks,a.HandoverCare,a.OperationReason,a.OperationHandle,a.MaintenanceReason,a.MaintenanceHandle,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 "; + 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)); + listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId)); if (this.tvControlItem.SelectedNodeID.Split('|').Length > 0) { var installationId = this.tvControlItem.SelectedNodeID.Split('|').First(); - strSql += " and a.InstallationId=@InstallationId"; - listStr.Add(new SqlParameter("@InstallationId", installationId)); + if (installationId != "0") + { + strSql += " and a.InstallationId=@InstallationId"; + listStr.Add(new SqlParameter("@InstallationId", installationId)); + } } if (this.tvControlItem.SelectedNodeID.Split('|').Length > 1) { @@ -209,12 +204,7 @@ namespace FineUIPro.Web.TestRun.ProduceTestRun /// protected void btnAdd_Click(object sender, EventArgs e) { - if (string.IsNullOrWhiteSpace(this.SystemId)) - { - Alert.ShowInTop("请选择系统!", MessageBoxIcon.Warning); - return; - } - PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("RunningLogManagementEdit.aspx?RunningId=&SystemId=" + this.SystemId, "新增 - "))); + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("RunningLogManagementEdit.aspx?RunningId=", "新增 - "))); } /// @@ -227,7 +217,7 @@ namespace FineUIPro.Web.TestRun.ProduceTestRun Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); return; } - PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("RunningLogManagementEdit.aspx?RunningId={0}&SystemId={1}", Grid1.SelectedRowID, this.SystemId, "编辑 - "))); + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("RunningLogManagementEdit.aspx?RunningId={0}", Grid1.SelectedRowID, "编辑 - "))); } /// @@ -292,29 +282,8 @@ namespace FineUIPro.Web.TestRun.ProduceTestRun SuccessionUserName = d.UserName, a.StartData, a.EndData, - a.IsDesalinated, - a.DesalinatedSituation, - a.DesalinatedRemarks, - a.IsLoop, - a.LoopSituation, - a.LoopRemarks, - a.IsSteam, - a.SteamSituation, - a.SteamRemarks, - a.IsAirCompression, - a.AirCompressionSituation, - a.AirCompressionRemarks, - a.IsCompoundAmmonia, - a.CompoundAmmoniaSituation, - a.CompoundAmmoniaRemarks, - a.IsUrea, - a.UreaSituation, - a.UreaRemarks, - a.HandoverCare, - a.OperationReason, - a.OperationHandle, - a.MaintenanceReason, - a.MaintenanceHandle, + a.Situation, + a.Remarks, a.AddUser, a.AddTime, a.Sort @@ -404,181 +373,181 @@ namespace FineUIPro.Web.TestRun.ProduceTestRun #region 数据 var dataIndex = 5; - if (model.IsDesalinated == 1) - { - ws = ExcelCreateRowTitle(ws, hssfworkbook, style, dataIndex + 1, dataIndex + 1, 0, 5); - region = new CellRangeAddress(dataIndex + 1, dataIndex + 1, 0, 3); - ws.AddMergedRegion(region); - ws.GetRow(dataIndex + 1).GetCell(0).SetCellValue("DW Station 脱盐水"); - ws.GetRow(dataIndex + 1).GetCell(0).CellStyle = styleLeftBold; - region = new CellRangeAddress(dataIndex + 1, dataIndex + 1, 4, 5); - ws.AddMergedRegion(region); - ws.GetRow(dataIndex + 1).GetCell(4).SetCellValue(""); - ws.GetRow(dataIndex + 1).GetCell(4).CellStyle = leftStyle; - ws = ExcelCreateRowTitle(ws, hssfworkbook, style, dataIndex + 2, dataIndex + 2, 0, 5, 90); - region = new CellRangeAddress(dataIndex + 2, dataIndex + 2, 0, 3); - ws.AddMergedRegion(region); - ws.GetRow(dataIndex + 2).GetCell(0).SetCellValue(model.DesalinatedSituation); - ws.GetRow(dataIndex + 2).GetCell(0).CellStyle = leftStyle; - region = new CellRangeAddress(dataIndex + 2, dataIndex + 2, 4, 5); - ws.AddMergedRegion(region); - ws.GetRow(dataIndex + 2).GetCell(4).SetCellValue(model.DesalinatedRemarks); - ws.GetRow(dataIndex + 2).GetCell(4).CellStyle = leftStyle; - dataIndex += 2; - } - if (model.IsLoop == 1) - { - ws = ExcelCreateRowTitle(ws, hssfworkbook, style, dataIndex + 1, dataIndex + 1, 0, 5); - region = new CellRangeAddress(dataIndex + 1, dataIndex + 1, 0, 3); - ws.AddMergedRegion(region); - ws.GetRow(dataIndex + 1).GetCell(0).SetCellValue("ACW/UCW/ECW Station 循环水"); - ws.GetRow(dataIndex + 1).GetCell(0).CellStyle = styleLeftBold; - region = new CellRangeAddress(dataIndex + 1, dataIndex + 1, 4, 5); - ws.AddMergedRegion(region); - ws.GetRow(dataIndex + 1).GetCell(4).SetCellValue(""); - ws.GetRow(dataIndex + 1).GetCell(4).CellStyle = leftStyle; - ws = ExcelCreateRowTitle(ws, hssfworkbook, style, dataIndex + 2, dataIndex + 2, 0, 5, 90); - region = new CellRangeAddress(dataIndex + 2, dataIndex + 2, 0, 3); - ws.AddMergedRegion(region); - ws.GetRow(dataIndex + 2).GetCell(0).SetCellValue(model.LoopSituation); - ws.GetRow(dataIndex + 2).GetCell(0).CellStyle = leftStyle; - region = new CellRangeAddress(dataIndex + 2, dataIndex + 2, 4, 5); - ws.AddMergedRegion(region); - ws.GetRow(dataIndex + 2).GetCell(4).SetCellValue(model.LoopRemarks); - ws.GetRow(dataIndex + 2).GetCell(4).CellStyle = leftStyle; - dataIndex += 2; - } - if (model.IsSteam == 1) - { - ws = ExcelCreateRowTitle(ws, hssfworkbook, style, dataIndex + 1, dataIndex + 1, 0, 5); - region = new CellRangeAddress(dataIndex + 1, dataIndex + 1, 0, 3); - ws.AddMergedRegion(region); - ws.GetRow(dataIndex + 1).GetCell(0).SetCellValue("Steam System蒸汽"); - ws.GetRow(dataIndex + 1).GetCell(0).CellStyle = styleLeftBold; - region = new CellRangeAddress(dataIndex + 1, dataIndex + 1, 4, 5); - ws.AddMergedRegion(region); - ws.GetRow(dataIndex + 1).GetCell(4).SetCellValue(""); - ws.GetRow(dataIndex + 1).GetCell(4).CellStyle = leftStyle; - ws = ExcelCreateRowTitle(ws, hssfworkbook, style, dataIndex + 2, dataIndex + 2, 0, 5, 90); - region = new CellRangeAddress(dataIndex + 2, dataIndex + 2, 0, 3); - ws.AddMergedRegion(region); - ws.GetRow(dataIndex + 2).GetCell(0).SetCellValue(model.SteamSituation); - ws.GetRow(dataIndex + 2).GetCell(0).CellStyle = leftStyle; - region = new CellRangeAddress(dataIndex + 2, dataIndex + 2, 4, 5); - ws.AddMergedRegion(region); - ws.GetRow(dataIndex + 2).GetCell(4).SetCellValue(model.SteamRemarks); - ws.GetRow(dataIndex + 2).GetCell(4).CellStyle = leftStyle; - dataIndex += 2; - } - if (model.IsAirCompression == 1) - { - ws = ExcelCreateRowTitle(ws, hssfworkbook, style, dataIndex + 1, dataIndex + 1, 0, 5); - region = new CellRangeAddress(dataIndex + 1, dataIndex + 1, 0, 3); - ws.AddMergedRegion(region); - ws.GetRow(dataIndex + 1).GetCell(0).SetCellValue("Air Station 空压站"); - ws.GetRow(dataIndex + 1).GetCell(0).CellStyle = styleLeftBold; - region = new CellRangeAddress(dataIndex + 1, dataIndex + 1, 4, 5); - ws.AddMergedRegion(region); - ws.GetRow(dataIndex + 1).GetCell(4).SetCellValue(""); - ws.GetRow(dataIndex + 1).GetCell(4).CellStyle = leftStyle; - ws = ExcelCreateRowTitle(ws, hssfworkbook, style, dataIndex + 2, dataIndex + 2, 0, 5, 90); - region = new CellRangeAddress(dataIndex + 2, dataIndex + 2, 0, 3); - ws.AddMergedRegion(region); - ws.GetRow(dataIndex + 2).GetCell(0).SetCellValue(model.AirCompressionSituation); - ws.GetRow(dataIndex + 2).GetCell(0).CellStyle = leftStyle; - region = new CellRangeAddress(dataIndex + 2, dataIndex + 2, 4, 5); - ws.AddMergedRegion(region); - ws.GetRow(dataIndex + 2).GetCell(4).SetCellValue(model.AirCompressionRemarks); - ws.GetRow(dataIndex + 2).GetCell(4).CellStyle = leftStyle; - dataIndex += 2; - } - if (model.IsCompoundAmmonia == 1) - { - ws = ExcelCreateRowTitle(ws, hssfworkbook, style, dataIndex + 1, dataIndex + 1, 0, 5); - region = new CellRangeAddress(dataIndex + 1, dataIndex + 1, 0, 3); - ws.AddMergedRegion(region); - ws.GetRow(dataIndex + 1).GetCell(0).SetCellValue("Ammonia Plant 合成氨"); - ws.GetRow(dataIndex + 1).GetCell(0).CellStyle = styleLeftBold; - region = new CellRangeAddress(dataIndex + 1, dataIndex + 1, 4, 5); - ws.AddMergedRegion(region); - ws.GetRow(dataIndex + 1).GetCell(4).SetCellValue(""); - ws.GetRow(dataIndex + 1).GetCell(4).CellStyle = leftStyle; - ws = ExcelCreateRowTitle(ws, hssfworkbook, style, dataIndex + 2, dataIndex + 2, 0, 5, 90); - region = new CellRangeAddress(dataIndex + 2, dataIndex + 2, 0, 3); - ws.AddMergedRegion(region); - ws.GetRow(dataIndex + 2).GetCell(0).SetCellValue(model.CompoundAmmoniaSituation); - ws.GetRow(dataIndex + 2).GetCell(0).CellStyle = leftStyle; - region = new CellRangeAddress(dataIndex + 2, dataIndex + 2, 4, 5); - ws.AddMergedRegion(region); - ws.GetRow(dataIndex + 2).GetCell(4).SetCellValue(model.CompoundAmmoniaRemarks); - ws.GetRow(dataIndex + 2).GetCell(4).CellStyle = leftStyle; - dataIndex += 2; - } - if (model.IsUrea == 1) - { - ws = ExcelCreateRowTitle(ws, hssfworkbook, style, dataIndex + 1, dataIndex + 1, 0, 5); - region = new CellRangeAddress(dataIndex + 1, dataIndex + 1, 0, 3); - ws.AddMergedRegion(region); - ws.GetRow(dataIndex + 1).GetCell(0).SetCellValue("Urea Plant 尿素"); - ws.GetRow(dataIndex + 1).GetCell(0).CellStyle = styleLeftBold; - region = new CellRangeAddress(dataIndex + 1, dataIndex + 1, 4, 5); - ws.AddMergedRegion(region); - ws.GetRow(dataIndex + 1).GetCell(4).SetCellValue(""); - ws.GetRow(dataIndex + 1).GetCell(4).CellStyle = leftStyle; - ws = ExcelCreateRowTitle(ws, hssfworkbook, style, dataIndex + 2, dataIndex + 2, 0, 5, 90); - region = new CellRangeAddress(dataIndex + 2, dataIndex + 2, 0, 3); - ws.AddMergedRegion(region); - ws.GetRow(dataIndex + 2).GetCell(0).SetCellValue(model.UreaSituation); - ws.GetRow(dataIndex + 2).GetCell(0).CellStyle = leftStyle; - region = new CellRangeAddress(dataIndex + 2, dataIndex + 2, 4, 5); - ws.AddMergedRegion(region); - ws.GetRow(dataIndex + 2).GetCell(4).SetCellValue(model.UreaRemarks); - ws.GetRow(dataIndex + 2).GetCell(4).CellStyle = leftStyle; - dataIndex += 2; - } - ws = ExcelCreateRowTitle(ws, hssfworkbook, style, dataIndex + 1, dataIndex + 1, 0, 5); - region = new CellRangeAddress(dataIndex + 1, dataIndex + 1, 0, 5); - ws.AddMergedRegion(region); - ws.GetRow(dataIndex + 1).GetCell(0).SetCellValue("Attention of next shift交班注意"); - ws.GetRow(dataIndex + 1).GetCell(0).CellStyle = styleLeftBold; - ws = ExcelCreateRowTitle(ws, hssfworkbook, style, dataIndex + 2, dataIndex + 2, 0, 5, 30); - region = new CellRangeAddress(dataIndex + 2, dataIndex + 2, 0, 5); - ws.AddMergedRegion(region); - ws.GetRow(dataIndex + 2).GetCell(0).SetCellValue(model.HandoverCare); - ws.GetRow(dataIndex + 2).GetCell(0).CellStyle = leftStyle; - dataIndex += 2; - ws = ExcelCreateRowTitle(ws, hssfworkbook, style, dataIndex + 1, dataIndex + 1, 0, 5); - region = new CellRangeAddress(dataIndex + 1, dataIndex + 1, 0, 5); - ws.AddMergedRegion(region); - ws.GetRow(dataIndex + 1).GetCell(0).SetCellValue("operation issue操作问题"); - ws.GetRow(dataIndex + 1).GetCell(0).CellStyle = styleLeftBold; - ws = ExcelCreateRowTitle(ws, hssfworkbook, style, dataIndex + 2, dataIndex + 2, 0, 5, 30); - region = new CellRangeAddress(dataIndex + 2, dataIndex + 2, 0, 5); - ws.AddMergedRegion(region); - ws.GetRow(dataIndex + 2).GetCell(0).SetCellValue($"reason原因:{model.OperationReason}"); - ws.GetRow(dataIndex + 2).GetCell(0).CellStyle = leftStyle; - ws = ExcelCreateRowTitle(ws, hssfworkbook, style, dataIndex + 3, dataIndex + 3, 0, 5, 30); - region = new CellRangeAddress(dataIndex + 3, dataIndex + 3, 0, 5); - ws.AddMergedRegion(region); - ws.GetRow(dataIndex + 3).GetCell(0).SetCellValue($"solution处理:{model.OperationHandle}"); - ws.GetRow(dataIndex + 3).GetCell(0).CellStyle = leftStyle; - dataIndex += 3; - ws = ExcelCreateRowTitle(ws, hssfworkbook, style, dataIndex + 1, dataIndex + 1, 0, 5); - region = new CellRangeAddress(dataIndex + 1, dataIndex + 1, 0, 5); - ws.AddMergedRegion(region); - ws.GetRow(dataIndex + 1).GetCell(0).SetCellValue("maintenance issue维护问题"); - ws.GetRow(dataIndex + 1).GetCell(0).CellStyle = styleLeftBold; - ws = ExcelCreateRowTitle(ws, hssfworkbook, style, dataIndex + 2, dataIndex + 2, 0, 5, 30); - region = new CellRangeAddress(dataIndex + 2, dataIndex + 2, 0, 5); - ws.AddMergedRegion(region); - ws.GetRow(dataIndex + 2).GetCell(0).SetCellValue($"reason原因:{model.MaintenanceReason}"); - ws.GetRow(dataIndex + 2).GetCell(0).CellStyle = leftStyle; - ws = ExcelCreateRowTitle(ws, hssfworkbook, style, dataIndex + 3, dataIndex + 3, 0, 5, 30); - region = new CellRangeAddress(dataIndex + 3, dataIndex + 3, 0, 5); - ws.AddMergedRegion(region); - ws.GetRow(dataIndex + 3).GetCell(0).SetCellValue($"solution处理:{model.MaintenanceHandle}"); - ws.GetRow(dataIndex + 3).GetCell(0).CellStyle = leftStyle; - dataIndex += 3; + //if (model.IsDesalinated == 1) + //{ + // ws = ExcelCreateRowTitle(ws, hssfworkbook, style, dataIndex + 1, dataIndex + 1, 0, 5); + // region = new CellRangeAddress(dataIndex + 1, dataIndex + 1, 0, 3); + // ws.AddMergedRegion(region); + // ws.GetRow(dataIndex + 1).GetCell(0).SetCellValue("DW Station 脱盐水"); + // ws.GetRow(dataIndex + 1).GetCell(0).CellStyle = styleLeftBold; + // region = new CellRangeAddress(dataIndex + 1, dataIndex + 1, 4, 5); + // ws.AddMergedRegion(region); + // ws.GetRow(dataIndex + 1).GetCell(4).SetCellValue(""); + // ws.GetRow(dataIndex + 1).GetCell(4).CellStyle = leftStyle; + // ws = ExcelCreateRowTitle(ws, hssfworkbook, style, dataIndex + 2, dataIndex + 2, 0, 5, 90); + // region = new CellRangeAddress(dataIndex + 2, dataIndex + 2, 0, 3); + // ws.AddMergedRegion(region); + // ws.GetRow(dataIndex + 2).GetCell(0).SetCellValue(model.DesalinatedSituation); + // ws.GetRow(dataIndex + 2).GetCell(0).CellStyle = leftStyle; + // region = new CellRangeAddress(dataIndex + 2, dataIndex + 2, 4, 5); + // ws.AddMergedRegion(region); + // ws.GetRow(dataIndex + 2).GetCell(4).SetCellValue(model.DesalinatedRemarks); + // ws.GetRow(dataIndex + 2).GetCell(4).CellStyle = leftStyle; + // dataIndex += 2; + //} + //if (model.IsLoop == 1) + //{ + // ws = ExcelCreateRowTitle(ws, hssfworkbook, style, dataIndex + 1, dataIndex + 1, 0, 5); + // region = new CellRangeAddress(dataIndex + 1, dataIndex + 1, 0, 3); + // ws.AddMergedRegion(region); + // ws.GetRow(dataIndex + 1).GetCell(0).SetCellValue("ACW/UCW/ECW Station 循环水"); + // ws.GetRow(dataIndex + 1).GetCell(0).CellStyle = styleLeftBold; + // region = new CellRangeAddress(dataIndex + 1, dataIndex + 1, 4, 5); + // ws.AddMergedRegion(region); + // ws.GetRow(dataIndex + 1).GetCell(4).SetCellValue(""); + // ws.GetRow(dataIndex + 1).GetCell(4).CellStyle = leftStyle; + // ws = ExcelCreateRowTitle(ws, hssfworkbook, style, dataIndex + 2, dataIndex + 2, 0, 5, 90); + // region = new CellRangeAddress(dataIndex + 2, dataIndex + 2, 0, 3); + // ws.AddMergedRegion(region); + // ws.GetRow(dataIndex + 2).GetCell(0).SetCellValue(model.LoopSituation); + // ws.GetRow(dataIndex + 2).GetCell(0).CellStyle = leftStyle; + // region = new CellRangeAddress(dataIndex + 2, dataIndex + 2, 4, 5); + // ws.AddMergedRegion(region); + // ws.GetRow(dataIndex + 2).GetCell(4).SetCellValue(model.LoopRemarks); + // ws.GetRow(dataIndex + 2).GetCell(4).CellStyle = leftStyle; + // dataIndex += 2; + //} + //if (model.IsSteam == 1) + //{ + // ws = ExcelCreateRowTitle(ws, hssfworkbook, style, dataIndex + 1, dataIndex + 1, 0, 5); + // region = new CellRangeAddress(dataIndex + 1, dataIndex + 1, 0, 3); + // ws.AddMergedRegion(region); + // ws.GetRow(dataIndex + 1).GetCell(0).SetCellValue("Steam System蒸汽"); + // ws.GetRow(dataIndex + 1).GetCell(0).CellStyle = styleLeftBold; + // region = new CellRangeAddress(dataIndex + 1, dataIndex + 1, 4, 5); + // ws.AddMergedRegion(region); + // ws.GetRow(dataIndex + 1).GetCell(4).SetCellValue(""); + // ws.GetRow(dataIndex + 1).GetCell(4).CellStyle = leftStyle; + // ws = ExcelCreateRowTitle(ws, hssfworkbook, style, dataIndex + 2, dataIndex + 2, 0, 5, 90); + // region = new CellRangeAddress(dataIndex + 2, dataIndex + 2, 0, 3); + // ws.AddMergedRegion(region); + // ws.GetRow(dataIndex + 2).GetCell(0).SetCellValue(model.SteamSituation); + // ws.GetRow(dataIndex + 2).GetCell(0).CellStyle = leftStyle; + // region = new CellRangeAddress(dataIndex + 2, dataIndex + 2, 4, 5); + // ws.AddMergedRegion(region); + // ws.GetRow(dataIndex + 2).GetCell(4).SetCellValue(model.SteamRemarks); + // ws.GetRow(dataIndex + 2).GetCell(4).CellStyle = leftStyle; + // dataIndex += 2; + //} + //if (model.IsAirCompression == 1) + //{ + // ws = ExcelCreateRowTitle(ws, hssfworkbook, style, dataIndex + 1, dataIndex + 1, 0, 5); + // region = new CellRangeAddress(dataIndex + 1, dataIndex + 1, 0, 3); + // ws.AddMergedRegion(region); + // ws.GetRow(dataIndex + 1).GetCell(0).SetCellValue("Air Station 空压站"); + // ws.GetRow(dataIndex + 1).GetCell(0).CellStyle = styleLeftBold; + // region = new CellRangeAddress(dataIndex + 1, dataIndex + 1, 4, 5); + // ws.AddMergedRegion(region); + // ws.GetRow(dataIndex + 1).GetCell(4).SetCellValue(""); + // ws.GetRow(dataIndex + 1).GetCell(4).CellStyle = leftStyle; + // ws = ExcelCreateRowTitle(ws, hssfworkbook, style, dataIndex + 2, dataIndex + 2, 0, 5, 90); + // region = new CellRangeAddress(dataIndex + 2, dataIndex + 2, 0, 3); + // ws.AddMergedRegion(region); + // ws.GetRow(dataIndex + 2).GetCell(0).SetCellValue(model.AirCompressionSituation); + // ws.GetRow(dataIndex + 2).GetCell(0).CellStyle = leftStyle; + // region = new CellRangeAddress(dataIndex + 2, dataIndex + 2, 4, 5); + // ws.AddMergedRegion(region); + // ws.GetRow(dataIndex + 2).GetCell(4).SetCellValue(model.AirCompressionRemarks); + // ws.GetRow(dataIndex + 2).GetCell(4).CellStyle = leftStyle; + // dataIndex += 2; + //} + //if (model.IsCompoundAmmonia == 1) + //{ + // ws = ExcelCreateRowTitle(ws, hssfworkbook, style, dataIndex + 1, dataIndex + 1, 0, 5); + // region = new CellRangeAddress(dataIndex + 1, dataIndex + 1, 0, 3); + // ws.AddMergedRegion(region); + // ws.GetRow(dataIndex + 1).GetCell(0).SetCellValue("Ammonia Plant 合成氨"); + // ws.GetRow(dataIndex + 1).GetCell(0).CellStyle = styleLeftBold; + // region = new CellRangeAddress(dataIndex + 1, dataIndex + 1, 4, 5); + // ws.AddMergedRegion(region); + // ws.GetRow(dataIndex + 1).GetCell(4).SetCellValue(""); + // ws.GetRow(dataIndex + 1).GetCell(4).CellStyle = leftStyle; + // ws = ExcelCreateRowTitle(ws, hssfworkbook, style, dataIndex + 2, dataIndex + 2, 0, 5, 90); + // region = new CellRangeAddress(dataIndex + 2, dataIndex + 2, 0, 3); + // ws.AddMergedRegion(region); + // ws.GetRow(dataIndex + 2).GetCell(0).SetCellValue(model.CompoundAmmoniaSituation); + // ws.GetRow(dataIndex + 2).GetCell(0).CellStyle = leftStyle; + // region = new CellRangeAddress(dataIndex + 2, dataIndex + 2, 4, 5); + // ws.AddMergedRegion(region); + // ws.GetRow(dataIndex + 2).GetCell(4).SetCellValue(model.CompoundAmmoniaRemarks); + // ws.GetRow(dataIndex + 2).GetCell(4).CellStyle = leftStyle; + // dataIndex += 2; + //} + //if (model.IsUrea == 1) + //{ + // ws = ExcelCreateRowTitle(ws, hssfworkbook, style, dataIndex + 1, dataIndex + 1, 0, 5); + // region = new CellRangeAddress(dataIndex + 1, dataIndex + 1, 0, 3); + // ws.AddMergedRegion(region); + // ws.GetRow(dataIndex + 1).GetCell(0).SetCellValue("Urea Plant 尿素"); + // ws.GetRow(dataIndex + 1).GetCell(0).CellStyle = styleLeftBold; + // region = new CellRangeAddress(dataIndex + 1, dataIndex + 1, 4, 5); + // ws.AddMergedRegion(region); + // ws.GetRow(dataIndex + 1).GetCell(4).SetCellValue(""); + // ws.GetRow(dataIndex + 1).GetCell(4).CellStyle = leftStyle; + // ws = ExcelCreateRowTitle(ws, hssfworkbook, style, dataIndex + 2, dataIndex + 2, 0, 5, 90); + // region = new CellRangeAddress(dataIndex + 2, dataIndex + 2, 0, 3); + // ws.AddMergedRegion(region); + // ws.GetRow(dataIndex + 2).GetCell(0).SetCellValue(model.UreaSituation); + // ws.GetRow(dataIndex + 2).GetCell(0).CellStyle = leftStyle; + // region = new CellRangeAddress(dataIndex + 2, dataIndex + 2, 4, 5); + // ws.AddMergedRegion(region); + // ws.GetRow(dataIndex + 2).GetCell(4).SetCellValue(model.UreaRemarks); + // ws.GetRow(dataIndex + 2).GetCell(4).CellStyle = leftStyle; + // dataIndex += 2; + //} + //ws = ExcelCreateRowTitle(ws, hssfworkbook, style, dataIndex + 1, dataIndex + 1, 0, 5); + //region = new CellRangeAddress(dataIndex + 1, dataIndex + 1, 0, 5); + //ws.AddMergedRegion(region); + //ws.GetRow(dataIndex + 1).GetCell(0).SetCellValue("Attention of next shift交班注意"); + //ws.GetRow(dataIndex + 1).GetCell(0).CellStyle = styleLeftBold; + //ws = ExcelCreateRowTitle(ws, hssfworkbook, style, dataIndex + 2, dataIndex + 2, 0, 5, 30); + //region = new CellRangeAddress(dataIndex + 2, dataIndex + 2, 0, 5); + //ws.AddMergedRegion(region); + //ws.GetRow(dataIndex + 2).GetCell(0).SetCellValue(model.HandoverCare); + //ws.GetRow(dataIndex + 2).GetCell(0).CellStyle = leftStyle; + //dataIndex += 2; + //ws = ExcelCreateRowTitle(ws, hssfworkbook, style, dataIndex + 1, dataIndex + 1, 0, 5); + //region = new CellRangeAddress(dataIndex + 1, dataIndex + 1, 0, 5); + //ws.AddMergedRegion(region); + //ws.GetRow(dataIndex + 1).GetCell(0).SetCellValue("operation issue操作问题"); + //ws.GetRow(dataIndex + 1).GetCell(0).CellStyle = styleLeftBold; + //ws = ExcelCreateRowTitle(ws, hssfworkbook, style, dataIndex + 2, dataIndex + 2, 0, 5, 30); + //region = new CellRangeAddress(dataIndex + 2, dataIndex + 2, 0, 5); + //ws.AddMergedRegion(region); + //ws.GetRow(dataIndex + 2).GetCell(0).SetCellValue($"reason原因:{model.OperationReason}"); + //ws.GetRow(dataIndex + 2).GetCell(0).CellStyle = leftStyle; + //ws = ExcelCreateRowTitle(ws, hssfworkbook, style, dataIndex + 3, dataIndex + 3, 0, 5, 30); + //region = new CellRangeAddress(dataIndex + 3, dataIndex + 3, 0, 5); + //ws.AddMergedRegion(region); + //ws.GetRow(dataIndex + 3).GetCell(0).SetCellValue($"solution处理:{model.OperationHandle}"); + //ws.GetRow(dataIndex + 3).GetCell(0).CellStyle = leftStyle; + //dataIndex += 3; + //ws = ExcelCreateRowTitle(ws, hssfworkbook, style, dataIndex + 1, dataIndex + 1, 0, 5); + //region = new CellRangeAddress(dataIndex + 1, dataIndex + 1, 0, 5); + //ws.AddMergedRegion(region); + //ws.GetRow(dataIndex + 1).GetCell(0).SetCellValue("maintenance issue维护问题"); + //ws.GetRow(dataIndex + 1).GetCell(0).CellStyle = styleLeftBold; + //ws = ExcelCreateRowTitle(ws, hssfworkbook, style, dataIndex + 2, dataIndex + 2, 0, 5, 30); + //region = new CellRangeAddress(dataIndex + 2, dataIndex + 2, 0, 5); + //ws.AddMergedRegion(region); + //ws.GetRow(dataIndex + 2).GetCell(0).SetCellValue($"reason原因:{model.MaintenanceReason}"); + //ws.GetRow(dataIndex + 2).GetCell(0).CellStyle = leftStyle; + //ws = ExcelCreateRowTitle(ws, hssfworkbook, style, dataIndex + 3, dataIndex + 3, 0, 5, 30); + //region = new CellRangeAddress(dataIndex + 3, dataIndex + 3, 0, 5); + //ws.AddMergedRegion(region); + //ws.GetRow(dataIndex + 3).GetCell(0).SetCellValue($"solution处理:{model.MaintenanceHandle}"); + //ws.GetRow(dataIndex + 3).GetCell(0).CellStyle = leftStyle; + //dataIndex += 3; #endregion ws.PrintSetup.Landscape = false; @@ -616,7 +585,6 @@ namespace FineUIPro.Web.TestRun.ProduceTestRun #endregion - #region 私有方法 ///