diff --git a/DataBase/版本日志/SGGLDB_WH_2024-04-10-gaofei.sql b/DataBase/版本日志/SGGLDB_WH_2024-04-10-gaofei.sql new file mode 100644 index 00000000..8e026ff7 --- /dev/null +++ b/DataBase/版本日志/SGGLDB_WH_2024-04-10-gaofei.sql @@ -0,0 +1,50 @@ +delete Sys_Menu where MenuId='2590BA0B-3B56-4F8A-8EB8-2D047EF90753' +INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Icon,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed)VALUES('2590BA0B-3B56-4F8A-8EB8-2D047EF90753','־',null,'TestRun/ProduceTestRun/RunningLogManagementList.aspx',1,'110E8BDB-8121-4C5B-A3C3-AF2B34B1B29B','Menu_TestRun',0,1,1) + +--==־ +if object_id(N'Running_LogManagement',N'U') is not null +drop table dbo.Running_LogManagement +CREATE TABLE dbo.Running_LogManagement( + RunningId varchar(50) NOT NULL,-- + ProjectId varchar(50) NULL,--Ŀ + InstallationId varchar(50) NULL,--װ + ProcessesId varchar(50) NULL,-- + SystemId varchar(50) NULL,--ϵͳ + JobNo varchar(50) NULL,--ְ + ShiftType varchar(50) NULL,--ְ1:װ2:ҹ + ShiftUser varchar(50) NULL,--ְְ + SuccessionUser varchar(50) NULL,--ְ + StartData datetime NULL,--ʼ + EndData datetime NULL,-- + IsDesalinated int NULL,--Ƿˮ + DesalinatedSituation varchar(1000),--ˮ + DesalinatedRemarks varchar(1000),--ˮע + IsLoop int NULL,--Ƿѭˮ + LoopSituation varchar(1000),--ѭˮ + LoopRemarks varchar(1000),--ѭˮע + IsSteam int NULL,--Ƿ + SteamSituation varchar(1000),-- + SteamRemarks varchar(1000),--ע + IsAirCompression int NULL,--Ƿڿѹվ + AirCompressionSituation varchar(1000),--ѹվ + AirCompressionRemarks varchar(1000),--ѹվע + IsCompoundAmmonia int NULL,--Ƿںϳɰ + CompoundAmmoniaSituation varchar(1000),--ϳɰ + CompoundAmmoniaRemarks varchar(1000),--ϳɰע + IsUrea int NULL,--Ƿ + UreaSituation varchar(1000),-- + UreaRemarks varchar(1000),--رע + HandoverCare varchar(1000),--ע + OperationReason varchar(1000),--ԭ + OperationHandle varchar(1000),--⴦ + MaintenanceReason varchar(1000),--άԭ + MaintenanceHandle varchar(1000),--ά⴦ + AddUser varchar(50) NULL,-- + AddTime datetime NULL,-- + Sort int NULL,-- + CONSTRAINT PK_Running_LogManagement PRIMARY KEY CLUSTERED +( + RunningId ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] +GO \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj index b8fdde4f..089b21b8 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj @@ -1855,6 +1855,8 @@ + + @@ -16603,6 +16605,20 @@ PropertyRunReportEdit.aspx + + RunningLogManagementEdit.aspx + ASPXCodeBehind + + + RunningLogManagementEdit.aspx + + + RunningLogManagementList.aspx + ASPXCodeBehind + + + RunningLogManagementList.aspx + TestRunOthersCheck.aspx ASPXCodeBehind diff --git a/SGGL/FineUIPro.Web/TestRun/ProduceTestRun/RunningLogManagementEdit.aspx b/SGGL/FineUIPro.Web/TestRun/ProduceTestRun/RunningLogManagementEdit.aspx new file mode 100644 index 00000000..facbc433 --- /dev/null +++ b/SGGL/FineUIPro.Web/TestRun/ProduceTestRun/RunningLogManagementEdit.aspx @@ -0,0 +1,188 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="RunningLogManagementEdit.aspx.cs" Inherits="FineUIPro.Web.TestRun.ProduceTestRun.RunningLogManagementEdit" %> + + + + + + + 编辑运行记录管理 + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/TestRun/ProduceTestRun/RunningLogManagementEdit.aspx.cs b/SGGL/FineUIPro.Web/TestRun/ProduceTestRun/RunningLogManagementEdit.aspx.cs new file mode 100644 index 00000000..5f124b52 --- /dev/null +++ b/SGGL/FineUIPro.Web/TestRun/ProduceTestRun/RunningLogManagementEdit.aspx.cs @@ -0,0 +1,258 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices.ComTypes; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.TestRun.ProduceTestRun +{ + public partial class RunningLogManagementEdit : PageBase + { + /// + /// 日志 + /// + 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(); + } + } + + /// + /// 页面控件处理 + /// + public void PageBase() + { + //获取人员 + var userList = from user in Funs.DB.Sys_User + join projectrole in Funs.DB.Project_ProjectUser on user.UserId equals projectrole.UserId + where projectrole.ProjectId == this.CurrUser.LoginProjectId + select user; + var userids = new List() { Const.sysglyId, Const.hfnbdId, Const.sedinId }; + var addUserList = Funs.DB.Sys_User.Where(x => userids.Contains(x.UserId)); + var users = userList.ToList(); + if (addUserList.Count() > 0) + { + users.AddRange(addUserList); + } + //轮班职工 + ddlShiftUser.DataTextField = "UserName"; + ddlShiftUser.DataValueField = "UserId"; + ddlShiftUser.DataSource = users; + ddlShiftUser.DataBind(); + ddlShiftUser.SelectedValue = this.CurrUser.UserId; + //继任职工 + ddlSuccessionUser.DataTextField = "UserName"; + ddlSuccessionUser.DataValueField = "UserId"; + ddlSuccessionUser.DataSource = users; + ddlSuccessionUser.DataBind(); + ddlSuccessionUser.SelectedValue = this.CurrUser.UserId; + List options = new List(); + var model = Funs.DB.Running_LogManagement.FirstOrDefault(x => x.RunningId == this.RunningId); + if (model != null) + { + 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; + } + 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; + } + } + + /// + /// 选择项 + /// + 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; + } + + /// + /// 保存 + /// + protected void btnSave_Click(object sender, EventArgs e) + { + if (string.IsNullOrWhiteSpace(ddlShiftUser.SelectedValue)) + { + ShowNotify("请选择轮班职工!", MessageBoxIcon.Warning); + return; + } + if (string.IsNullOrWhiteSpace(ddlSuccessionUser.SelectedValue)) + { + ShowNotify("请选择继任职工!", MessageBoxIcon.Warning); + return; + } + var sysmodel = Funs.DB.PreRun_SysDevice.FirstOrDefault(x => x.PreRunId == this.SystemId); + if (sysmodel == null) + { + Alert.ShowInTop("系统参数错误!", MessageBoxIcon.Warning); + return; + } + + var edata = DateTime.Parse(txtEndData.Text); + if (!string.IsNullOrWhiteSpace(this.RunningId)) + { + 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) + { + Alert.ShowInTop($"{DateTime.Now.ToString("yyyy-MM-dd")}已添加{ddlShiftType.SelectedText}日志,无法继续添加!", MessageBoxIcon.Warning); + return; + } + } + else + { + 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; + } + } + bool add = false; + var model = Funs.DB.Running_LogManagement.FirstOrDefault(x => x.RunningId == this.RunningId); + if (model == null) + { + 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; + } + 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.SubmitChanges(); + ShowNotify("操作成功!", MessageBoxIcon.Success); + PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); + } + } +} \ 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 new file mode 100644 index 00000000..716dd71c --- /dev/null +++ b/SGGL/FineUIPro.Web/TestRun/ProduceTestRun/RunningLogManagementEdit.aspx.designer.cs @@ -0,0 +1,395 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.TestRun.ProduceTestRun +{ + + + public partial class RunningLogManagementEdit + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// ContentPanel2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ContentPanel ContentPanel2; + + /// + /// Form2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form2; + + /// + /// txtJobNo 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtJobNo; + + /// + /// ddlShiftType 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlShiftType; + + /// + /// ddlShiftUser 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlShiftUser; + + /// + /// ddlSuccessionUser 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlSuccessionUser; + + /// + /// txtStartData 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtStartData; + + /// + /// txtEndData 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtEndData; + + /// + /// rdbOperation 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.CheckBoxList rdbOperation; + + /// + /// tys 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.FormRow tys; + + /// + /// txtDesalinatedSituation 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtDesalinatedSituation; + + /// + /// txtDesalinatedRemarks 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtDesalinatedRemarks; + + /// + /// xhs 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.FormRow xhs; + + /// + /// txtLoopSituation 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtLoopSituation; + + /// + /// txtLoopRemarks 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtLoopRemarks; + + /// + /// zq 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + 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; + + /// + /// txtHandoverCare 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtHandoverCare; + + /// + /// ContentPanel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ContentPanel ContentPanel1; + + /// + /// Form3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form3; + + /// + /// txtOperationReason 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtOperationReason; + + /// + /// txtOperationHandle 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtOperationHandle; + + /// + /// ContentPanel3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ContentPanel ContentPanel3; + + /// + /// Form4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form4; + + /// + /// txtMaintenanceReason 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtMaintenanceReason; + + /// + /// txtMaintenanceHandle 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtMaintenanceHandle; + } +} diff --git a/SGGL/FineUIPro.Web/TestRun/ProduceTestRun/RunningLogManagementList.aspx b/SGGL/FineUIPro.Web/TestRun/ProduceTestRun/RunningLogManagementList.aspx new file mode 100644 index 00000000..470d6eab --- /dev/null +++ b/SGGL/FineUIPro.Web/TestRun/ProduceTestRun/RunningLogManagementList.aspx @@ -0,0 +1,144 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="RunningLogManagementList.aspx.cs" Inherits="FineUIPro.Web.TestRun.ProduceTestRun.RunningLogManagementList" %> + + + + + + + + + 运行日志管理 + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/TestRun/ProduceTestRun/RunningLogManagementList.aspx.cs b/SGGL/FineUIPro.Web/TestRun/ProduceTestRun/RunningLogManagementList.aspx.cs new file mode 100644 index 00000000..f037aa0d --- /dev/null +++ b/SGGL/FineUIPro.Web/TestRun/ProduceTestRun/RunningLogManagementList.aspx.cs @@ -0,0 +1,666 @@ +using BLL; +using NPOI.SS.UserModel; +using NPOI.XSSF.UserModel; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.IO; +using System.Linq; +using System.Web; +using System.Web.UI; +using NPOI.SS.UserModel; +using NPOI.SS.Util; +using NPOI.XSSF.UserModel; +using Model; +using NPOI.SS.Formula.Functions; + +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(); + } + } + + #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 alllist = Funs.DB.PreRun_SysDevice.Where(x => x.ProjectId == this.CurrUser.LoginProjectId && x.PreRunLevel != 4).ToList(); + if (alllist.Count() > 0) + { + var onelist = alllist.Where(x => x.PreRunLevel == 1).ToList(); + + foreach (var itemOne in onelist) + { + 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; + var twolist = alllist.Where(x => x.PreRunLevel == 2 && x.ParentId == itemOne.PreRunId).ToList(); + foreach (var itemTwo in twolist) + { + TreeNode rootTwoNode = new TreeNode(); + rootTwoNode.NodeID = itemOne.PreRunId + "|" + itemTwo.PreRunId; + rootTwoNode.Text = itemTwo.PreRunName; + rootTwoNode.ToolTip = itemTwo.PreRunName; + rootTwoNode.CommandName = ""; + rootTwoNode.EnableClickEvent = true; + rootTwoNode.EnableExpandEvent = false; + rootOneNode.Nodes.Add(rootTwoNode); + rootTwoNode.Expanded = true; + var threelist = alllist.Where(x => x.PreRunLevel == 3 && x.ParentId == itemTwo.PreRunId).ToList(); + foreach (var itemThree in threelist) + { + TreeNode rootThreeNode = new TreeNode(); + rootThreeNode.NodeID = itemOne.PreRunId + "|" + itemTwo.PreRunId + "|" + itemThree.PreRunId; + rootThreeNode.Text = itemThree.PreRunName; + rootThreeNode.ToolTip = itemThree.PreRunName; + rootThreeNode.CommandName = ""; + rootThreeNode.EnableClickEvent = true; + rootThreeNode.EnableExpandEvent = false; + rootTwoNode.Nodes.Add(rootThreeNode); + rootThreeNode.Expanded = true; + } + } + } + } + } + + /// + /// 点击TreeView + /// + protected void tvControlItem_NodeCommand(object sender, TreeCommandEventArgs e) + { + if (this.tvControlItem.SelectedNodeID.Split('|').Length > 2) + { + this.SystemId = this.tvControlItem.SelectedNodeID.Split('|').Last(); + } + this.BindGrid(); + } + + #endregion + + #region 绑定数据 + + /// + /// 数据绑定 + /// + 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 "; + List listStr = new List(); + 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 (this.tvControlItem.SelectedNodeID.Split('|').Length > 1) + { + var processesId = this.tvControlItem.SelectedNodeID.Split('|')[1]; + strSql += " and a.ProcessesId=@ProcessesId"; + listStr.Add(new SqlParameter("@ProcessesId", processesId)); + } + if (this.tvControlItem.SelectedNodeID.Split('|').Length > 2) + { + var systemId = this.tvControlItem.SelectedNodeID.Split('|').Last(); + strSql += " and a.SystemId=@SystemId"; + listStr.Add(new SqlParameter("@SystemId", systemId)); + } + if (!string.IsNullOrWhiteSpace(ddlShiftType.SelectedValue)) + { + strSql += " and a.ShiftType=@ShiftType"; + listStr.Add(new SqlParameter("@ShiftType", ddlShiftType.SelectedValue)); + } + strSql += " order by a.AddTime asc"; + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); + Grid1.RecordCount = tb.Rows.Count; + var table = this.GetPagedDataTable(Grid1, tb); + Grid1.DataSource = table; + Grid1.DataBind(); + } + + /// + /// 分页 + /// + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + Grid1.PageIndex = e.NewPageIndex; + BindGrid(); + } + + /// + /// 分页下拉框 + /// + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue); + BindGrid(); + } + + /// + /// 排序 + /// + protected void Grid1_Sort(object sender, GridSortEventArgs e) + { + BindGrid(); + } + + /// + /// 双击修改 + /// + protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) + { + btnMenuModify_Click(null, null); + } + + #endregion + + #region 按钮 + + /// + /// 关闭弹框 + /// + protected void Window1_Close(object sender, WindowCloseEventArgs e) + { + BindGrid(); + } + + /// + /// 搜索 + /// + protected void btnQuery_Click(object sender, EventArgs e) + { + BindGrid(); + } + + /// + /// 添加 + /// + 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, "新增 - "))); + } + + /// + /// 修改 + /// + protected void btnModify_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); + return; + } + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("RunningLogManagementEdit.aspx?RunningId={0}&SystemId={1}", Grid1.SelectedRowID, this.SystemId, "编辑 - "))); + } + + /// + /// 删除 + /// + protected void btnDel_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); + return; + } + var ids = Grid1.SelectedRowIDArray.ToList(); + var list = Funs.DB.Running_LogManagement.Where(x => ids.Contains(x.RunningId)).ToList(); + if (list.Count > 0) + { + Funs.DB.Running_LogManagement.DeleteAllOnSubmit(list); + Funs.DB.SubmitChanges(); + BindGrid(); + Alert.ShowInTop("删除成功!", MessageBoxIcon.Success); + } + } + + /// + /// 导出 + /// + protected void btnExport_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0 || Grid1.SelectedRowIndexArray.Length > 1) + { + Alert.ShowInTop("请至少选择记录,最大只可选择一条!", MessageBoxIcon.Warning); + return; + } + var runningId = this.Grid1.Rows[Grid1.SelectedRowIndex].DataKeys[0].ToString(); + + string rootPath = Server.MapPath("~/") + Const.ExcelUrl; + //导出文件 + string filePath = rootPath + DateTime.Now.ToString("yyyyMMddhhmmss") + "\\"; + if (!Directory.Exists(filePath)) + { + Directory.CreateDirectory(filePath); + } + + var data = from a in Funs.DB.Running_LogManagement + join b in Funs.DB.Base_Project on a.ProjectId equals b.ProjectId + join c in Funs.DB.Sys_User on a.ShiftUser equals c.UserId + join d in Funs.DB.Sys_User on a.SuccessionUser equals d.UserId + where a.RunningId == runningId + select new + { + a.RunningId, + a.ProjectId, + a.InstallationId, + a.ProcessesId, + a.SystemId, + a.JobNo, + a.ShiftType, + ShiftTypeName = a.ShiftType == "1" ? "白班" : "夜班", + a.ShiftUser, + ShiftUserName = c.UserName, + a.SuccessionUser, + 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.AddUser, + a.AddTime, + a.Sort + }; + var model = data.FirstOrDefault(); + if (model != null) + { + string ReportFileName = $"{filePath}Production report({DateTime.Now.ToString("yyyy-MM-dd")} {model.ShiftUserName}).xlsx"; + int rowIndex = 0; + XSSFWorkbook hssfworkbook = new XSSFWorkbook(); + XSSFSheet ws = (XSSFSheet)hssfworkbook.CreateSheet($"Production report({DateTime.Now.ToString("yyyy-MM-dd")} {model.ShiftUserName})"); + + #region 列宽 + + ws.SetColumnWidth(0, (9 * 256)); + ws.SetColumnWidth(1, (9 * 256)); + ws.SetColumnWidth(2, (43 * 256)); + ws.SetColumnWidth(3, (7 * 256)); + ws.SetColumnWidth(4, (8 * 256)); + ws.SetColumnWidth(5, (5 * 256)); + + #endregion + + #region 样式 + //头部样式居中 + ICellStyle titleStyle = SetExcelStyle(hssfworkbook, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, VerticalAlignment.Center, HorizontalAlignment.Center, 14, true, true); + //头部样式靠左 + ICellStyle leftTitleStyle = SetExcelStyle(hssfworkbook, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, VerticalAlignment.Center, HorizontalAlignment.Left, 14, true, true); + //公共样式 + ICellStyle style = SetExcelStyle(hssfworkbook, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, VerticalAlignment.Center, HorizontalAlignment.Center, 10.5, true); + //公共样式靠左 + ICellStyle leftStyle = SetExcelStyle(hssfworkbook, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, VerticalAlignment.Center, HorizontalAlignment.Left, 10.5, true); + //公共样式靠左上对其 + ICellStyle leftTopStyle = SetExcelStyle(hssfworkbook, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, VerticalAlignment.Top, HorizontalAlignment.Left, 10.5, true); + //公共样式加粗 + ICellStyle styleBold = SetExcelStyle(hssfworkbook, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, VerticalAlignment.Center, HorizontalAlignment.Center, 10.5, true, true); + //公共样式靠左加粗 + ICellStyle styleLeftBold = SetExcelStyle(hssfworkbook, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, VerticalAlignment.Center, HorizontalAlignment.Left, 10.5, true, true); + + #endregion + + #region 头部 + + ws = ExcelCreateRowTitle(ws, hssfworkbook, style, rowIndex, rowIndex + 5, 0, 5); + //行1 + var region = new CellRangeAddress(rowIndex, rowIndex + 3, 0, 1); + ws.AddMergedRegion(region); + ws.GetRow(rowIndex).GetCell(0).SetCellValue("WUHUAN ENGINEERING CO.,LTD"); + ws.GetRow(rowIndex).GetCell(0).CellStyle = titleStyle; + ws.GetRow(rowIndex).GetCell(2).SetCellValue("PT PETROKIMIA GRESIK"); + ws.GetRow(rowIndex).GetCell(2).CellStyle = titleStyle; + region = new CellRangeAddress(rowIndex, rowIndex, 3, 5); + ws.AddMergedRegion(region); + ws.GetRow(rowIndex).GetCell(3).SetCellValue("WUHUAN Job. No."); + ws.GetRow(rowIndex).GetCell(3).CellStyle = styleBold; + //行2 + ws.GetRow(rowIndex + 1).GetCell(2).SetCellValue("AMMONIA-Urea II PROJECT"); + ws.GetRow(rowIndex + 1).GetCell(2).CellStyle = titleStyle; + region = new CellRangeAddress(rowIndex + 1, rowIndex + 1, 3, 5); + ws.AddMergedRegion(region); + //行3行4 + region = new CellRangeAddress(rowIndex + 2, rowIndex + 3, 2, 2); + ws.AddMergedRegion(region); + ws.GetRow(rowIndex + 2).GetCell(2).SetCellValue("Production report"); + ws.GetRow(rowIndex + 2).GetCell(2).CellStyle = titleStyle; + region = new CellRangeAddress(rowIndex + 2, rowIndex + 3, 3, 5); + ws.AddMergedRegion(region); + ws.GetRow(rowIndex + 2).GetCell(3).SetCellValue("Page 1"); + ws.GetRow(rowIndex + 2).GetCell(3).CellStyle = titleStyle; + //行5 + region = new CellRangeAddress(rowIndex + 4, rowIndex + 4, 0, 5); + ws.AddMergedRegion(region); + ws.GetRow(rowIndex + 4).GetCell(0).SetCellValue($"Shift:({model.ShiftUserName}) Succession:({model.SuccessionUserName}) {model.StartData.Value.ToString("yyyy-MM-dd")}— {model.EndData.Value.ToString("yyyy-MM-dd")}"); + ws.GetRow(rowIndex + 4).GetCell(0).CellStyle = styleBold; + //行6 + region = new CellRangeAddress(rowIndex + 5, rowIndex + 5, 0, 3); + ws.AddMergedRegion(region); + ws.GetRow(rowIndex + 5).GetCell(0).SetCellValue("Operation situation"); + ws.GetRow(rowIndex + 5).GetCell(0).CellStyle = styleBold; + region = new CellRangeAddress(rowIndex + 5, rowIndex + 5, 4, 5); + ws.AddMergedRegion(region); + ws.GetRow(rowIndex + 5).GetCell(4).SetCellValue("Remarks"); + ws.GetRow(rowIndex + 5).GetCell(4).CellStyle = styleBold; + + #endregion + + #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; + #endregion + + ws.PrintSetup.Landscape = false; + ws.PrintSetup.PaperSize = 9; + ws.ForceFormulaRecalculation = true; + using (FileStream filess = File.OpenWrite(ReportFileName)) + { + hssfworkbook.Write(filess); + } + FileInfo filet = new FileInfo(ReportFileName); + Response.Clear(); + Response.Charset = "GB2312"; + Response.ContentEncoding = System.Text.Encoding.UTF8; + // 添加头信息,为"文件下载/另存为"对话框指定默认文件名 + Response.AddHeader("Content-Disposition", "attachment; filename=" + Server.UrlEncode($"Production report({DateTime.Now.ToString("yyyy-MM-dd")} {model.ShiftUserName}).xlsx")); + // 添加头信息,指定文件大小,让浏览器能够显示下载进度 + Response.AddHeader("Content-Length", filet.Length.ToString()); + // 指定返回的是一个不能被客户端读取的流,必须被下载 + Response.ContentType = "application/ms-excel"; + // 把文件流发送到客户端 + Response.WriteFile(filet.FullName); + // 停止页面的执行 + Response.End(); + + } + } + + /// + ///右击修改 + /// + protected void btnMenuModify_Click(object sender, EventArgs e) + { + btnModify_Click(null, null); + } + + #endregion + + + #region 私有方法 + + /// + /// 创建样式 + /// + /// + public static ICellStyle SetExcelStyle(XSSFWorkbook wb, BorderStyle Bottom, BorderStyle Left, BorderStyle Right, BorderStyle Top, VerticalAlignment VerAig, HorizontalAlignment HorAig, double FontSize, bool WrapText = true, bool Bold = false, string FontName = "宋体") + { + ICellStyle style = wb.CreateCellStyle(); + style.BorderBottom = Bottom; + style.BorderLeft = Left; + style.BorderRight = Right; + style.BorderTop = Top; + style.VerticalAlignment = VerAig; + style.Alignment = HorAig; + IFont font = wb.CreateFont(); + font.FontHeightInPoints = FontSize; + font.IsBold = Bold; + font.FontName = FontName; + style.SetFont(font); + style.WrapText = WrapText; + return style; + } + + /// + /// 创建头部 + /// + /// + private XSSFSheet ExcelCreateRowTitle(XSSFSheet ws, XSSFWorkbook hssfworkbook, ICellStyle style, int sRows, int eRows, int cStart, int cEnd, float height = 21) + { + for (int i = sRows; i <= eRows; i++) + { + ws.CreateRow(i); + ws.GetRow(i).HeightInPoints = height; + for (int j = cStart; j <= cEnd; j++) + { + ws.GetRow(i).CreateCell(j); + ws.GetRow(i).CreateCell(j).CellStyle = style; + } + } + return ws; + } + + #endregion + + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/TestRun/ProduceTestRun/RunningLogManagementList.aspx.designer.cs b/SGGL/FineUIPro.Web/TestRun/ProduceTestRun/RunningLogManagementList.aspx.designer.cs new file mode 100644 index 00000000..757b5e83 --- /dev/null +++ b/SGGL/FineUIPro.Web/TestRun/ProduceTestRun/RunningLogManagementList.aspx.designer.cs @@ -0,0 +1,188 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.TestRun.ProduceTestRun +{ + + + public partial class RunningLogManagementList + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// panelLeftRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelLeftRegion; + + /// + /// tvControlItem 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Tree tvControlItem; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// ddlShiftType 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlShiftType; + + /// + /// btnQuery 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnQuery; + + /// + /// btnAdd 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnAdd; + + /// + /// btnModify 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnModify; + + /// + /// btnDel 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnDel; + + /// + /// btnExport 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnExport; + + /// + /// ToolbarSeparator1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; + + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + + /// + /// btnMenuModify 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuModify; + } +}