diff --git a/.gitignore b/.gitignore index 7b2f1c8f..6271f906 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,4 @@ SGGL/.svn /WebAPI/obj /FineUIPro.Mobile/bin /FineUIPro.Mobile/obj +/SGGL/FineUIPro.Web/FileUpload/CQMS/Meeting/2022-09 diff --git a/DataBase/版本日志/SGGLDB_V2022-09-14.sql b/DataBase/版本日志/SGGLDB_V2022-09-14.sql new file mode 100644 index 00000000..8cac6454 --- /dev/null +++ b/DataBase/版本日志/SGGLDB_V2022-09-14.sql @@ -0,0 +1,7 @@ +INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) +VALUES('B9CE4D86-4A6E-42B2-8736-15595B3C57FC','','CQMS/Meeting/MonthMeetingFile.aspx',31,'390A78F0-43B2-4AF1-81B9-7C216FA7E0A4','Menu_CQMS',0,1,1) +GO + +INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) +VALUES('9F7C7E64-2743-4CF0-B09E-DDB43444A69A','ר','CQMS/Meeting/SpecialMeetingFile.aspx',32,'390A78F0-43B2-4AF1-81B9-7C216FA7E0A4','Menu_CQMS',0,1,1) +GO \ No newline at end of file diff --git a/DataBase/版本日志/SGGLDB_V2022-09-14修改明细.txt b/DataBase/版本日志/SGGLDB_V2022-09-14修改明细.txt new file mode 100644 index 00000000..906b910c --- /dev/null +++ b/DataBase/版本日志/SGGLDB_V2022-09-14修改明细.txt @@ -0,0 +1,3 @@ +--ADD BY gaofei 2022-09-14 +1,质量会议增加导出PDF功能 +--END diff --git a/DataBase/菜单初始化脚本/1-2质量管理(Menu_CQMS).sql b/DataBase/菜单初始化脚本/1-2质量管理(Menu_CQMS).sql index a364fe6f..213266e3 100644 --- a/DataBase/菜单初始化脚本/1-2质量管理(Menu_CQMS).sql +++ b/DataBase/菜单初始化脚本/1-2质量管理(Menu_CQMS).sql @@ -483,6 +483,14 @@ INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffi VALUES('0E6E6022-356E-42A1-9D16-C75BF69EBFB5','施工质量检查记录','CQMS/Check/JointCheckFile.aspx',30,'390A78F0-43B2-4AF1-81B9-7C216FA7E0A4','Menu_CQMS',0,1,1) GO +INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) +VALUES('B9CE4D86-4A6E-42B2-8736-15595B3C57FC','质量月例会','CQMS/Meeting/MonthMeetingFile.aspx',31,'390A78F0-43B2-4AF1-81B9-7C216FA7E0A4','Menu_CQMS',0,1,1) +GO + +INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) +VALUES('9F7C7E64-2743-4CF0-B09E-DDB43444A69A','质量专题会','CQMS/Meeting/SpecialMeetingFile.aspx',32,'390A78F0-43B2-4AF1-81B9-7C216FA7E0A4','Menu_CQMS',0,1,1) +GO + INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) VALUES('3354E9AA-8D71-401B-9CFC-03D69DA86B05','工程联络单','CQMS/Check/TechnicalContactListFile.aspx',40,'390A78F0-43B2-4AF1-81B9-7C216FA7E0A4','Menu_CQMS',0,1,1) GO diff --git a/SGGL/BLL/CQMS/Solution/CQMSConstructSolutionService.cs b/SGGL/BLL/CQMS/Solution/CQMSConstructSolutionService.cs index b9f2f11b..6b0b33f1 100644 --- a/SGGL/BLL/CQMS/Solution/CQMSConstructSolutionService.cs +++ b/SGGL/BLL/CQMS/Solution/CQMSConstructSolutionService.cs @@ -98,19 +98,19 @@ namespace BLL { if (state != null) { - if (state.ToString() == BLL.Const.SubPlan_ReCompile) + if (state.ToString() == BLL.Const.CQMSConstructSolution_ReCompile) { return "重报"; } - else if (state.ToString() == BLL.Const.SubPlan_Compile) + else if (state.ToString() == BLL.Const.CQMSConstructSolution_Compile) { return "编制"; } - else if (state.ToString() == BLL.Const.SubPlan_Audit) + else if (state.ToString() == BLL.Const.CQMSConstructSolution_Audit) { return "会签"; } - else if (state.ToString() == BLL.Const.SubPlan_Complete) + else if (state.ToString() == BLL.Const.CQMSConstructSolution_Complete) { return "审批完成"; } diff --git a/SGGL/BLL/Common/Const.cs b/SGGL/BLL/Common/Const.cs index d908756c..8474608d 100644 --- a/SGGL/BLL/Common/Const.cs +++ b/SGGL/BLL/Common/Const.cs @@ -4055,6 +4055,10 @@ /// public const string ConstructSolutionTemplateUrl = "File\\Word\\CQMS\\Check\\施工方案.doc"; /// + /// 质量会议的虚拟路径 + /// + public const string CQMSMeetingTemplateUrl = "File\\Word\\CQMS\\Check\\质量会议.doc"; + /// /// 质量月报的虚拟路径 /// public const string CheckMonthTemplateUrl = "File\\Word\\CQMS\\Check\\质量月报.doc"; diff --git a/SGGL/FineUIPro.Web/CQMS/Meeting/MonthMeetingEdit.aspx.cs b/SGGL/FineUIPro.Web/CQMS/Meeting/MonthMeetingEdit.aspx.cs index 4e817e8f..b233634d 100644 --- a/SGGL/FineUIPro.Web/CQMS/Meeting/MonthMeetingEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/CQMS/Meeting/MonthMeetingEdit.aspx.cs @@ -344,7 +344,7 @@ namespace FineUIPro.Web.CQMS.Meeting } CQMSMeeting.AttentPersonNum = num; CQMSMeeting.MeetingTheme = this.txtMeetingTheme.Text.Trim(); - CQMSMeeting.MeetingContents = this.txtMeetingContents.Text.Trim(); + CQMSMeeting.MeetingContents = this.txtMeetingContents.Text; if (saveType == "submit") { CQMSMeeting.State = this.drpHandleType.SelectedValue; diff --git a/SGGL/FineUIPro.Web/CQMS/Meeting/MonthMeetingFile.aspx b/SGGL/FineUIPro.Web/CQMS/Meeting/MonthMeetingFile.aspx new file mode 100644 index 00000000..b30c63d8 --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Meeting/MonthMeetingFile.aspx @@ -0,0 +1,125 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MonthMeetingFile.aspx.cs" Inherits="FineUIPro.Web.CQMS.Meeting.MonthMeetingFile" %> + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/CQMS/Meeting/MonthMeetingFile.aspx.cs b/SGGL/FineUIPro.Web/CQMS/Meeting/MonthMeetingFile.aspx.cs new file mode 100644 index 00000000..2865fd3d --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Meeting/MonthMeetingFile.aspx.cs @@ -0,0 +1,402 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.Linq; +using System.Threading.Tasks; +using Aspose.Words; +using System.IO; + +namespace FineUIPro.Web.CQMS.Meeting +{ + public partial class MonthMeetingFile : PageBase + { + /// + /// 项目id + /// + public string ProjectId + { + get + { + return (string)ViewState["ProjectId"]; + } + set + { + ViewState["ProjectId"] = value; + } + } + #region 加载页面 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + + // 表头过滤 + //FilterDataRowItem = FilterDataRowItemImplement; + if (!IsPostBack) + { + this.ProjectId = this.CurrUser.LoginProjectId; + ddlPageSize.SelectedValue = Grid1.PageSize.ToString(); + // 绑定表格 + BindGrid(); + } + } + #endregion + + protected DataTable insklistData() + { + string strSql = @"SELECT ins.*,un.UnitName,u.PersonName as CompileManName" + + @" FROM Meeting_CQMSMeeting ins" + + @" left join Base_Unit un on un.UnitId = ins.UnitId" + + @" left join Person_Persons u on u.PersonId = ins.CompileMan" + + @" where ins.ProjectId=@ProjectId and ins.MeetingType='M' and ins.State=@State "; + + List listStr = new List(); + listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId)); + listStr.Add(new SqlParameter("@State", BLL.Const.CQMSMeeting_Complete)); + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); + return tb; + } + + /// + /// 绑定数据 + /// + + public void BindGrid() + { + DataTable tb = insklistData(); + + // 2.获取当前分页数据 + //var table = this.GetPagedDataTable(Grid1, tb1); + + Grid1.RecordCount = tb.Rows.Count; + tb = GetFilteredTable(Grid1.FilteredData, tb); + var table = this.GetPagedDataTable(Grid1, tb); + Grid1.DataSource = table; + Grid1.DataBind(); + } + + + #region 查询 + /// + /// 查询 + /// + /// + /// + protected void TextBox_TextChanged(object sender, EventArgs e) + { + this.BindGrid(); + } + #endregion + + #region 过滤表头、排序、分页、关闭窗口 + /// + /// 过滤表头 + /// + /// + /// + protected void Grid1_FilterChange(object sender, EventArgs e) + { + BindGrid(); + } + + /// + /// 分页 + /// + /// + /// + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + Grid1.PageIndex = e.NewPageIndex; + BindGrid(); + } + + /// + /// 排序 + /// + /// + /// + protected void Grid1_Sort(object sender, GridSortEventArgs e) + { + //Grid1.SortDirection = e.SortDirection; + //Grid1.SortField = e.SortField; + BindGrid(); + } + + /// + /// 分页显示条数下拉框 + /// + /// + /// + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue); + BindGrid(); + } + + /// + /// 关闭弹出窗 + /// + /// + /// + protected void Window1_Close(object sender, WindowCloseEventArgs e) + { + BindGrid(); + string str = this.hdID.Text; + if (!string.IsNullOrEmpty(str)) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("MonthMeetingEdit.aspx?MeetingId={0}", str, "查看 - "))); + } + this.hdID.Text = string.Empty; + } + #endregion + + #region Grid双击事件 + /// + /// Grid行双击事件 + /// + /// + /// + protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) + { + btnMenuView_Click(null, null); + } + #endregion + + protected void Grid1_RowCommand(object sender, GridCommandEventArgs e) + { + object[] keys = Grid1.DataKeys[e.RowIndex]; + string fileId = string.Empty; + if (keys == null) + { + return; + } + else + { + fileId = keys[0].ToString(); + } + if (e.CommandName == "export") + { + string rootPath = Server.MapPath("~/"); + string initTemplatePath = string.Empty; + string uploadfilepath = string.Empty; + string newUrl = string.Empty; + string filePath = string.Empty; + Model.Meeting_CQMSMeeting meeting = CQMS_MeetingService.GetCQMSMeetingById(fileId); + initTemplatePath = Const.CQMSMeetingTemplateUrl; + uploadfilepath = rootPath + initTemplatePath; + newUrl = uploadfilepath.Replace(".doc", meeting.MeetingCode.Replace("/", "-") + ".doc"); + filePath = initTemplatePath.Replace(".doc", meeting.MeetingCode.Replace("/", "-") + ".pdf"); + File.Copy(uploadfilepath, newUrl); + //更新书签内容 + Document doc = new Aspose.Words.Document(newUrl); + Bookmark bookmarkProjectName = doc.Range.Bookmarks["ProjectName"]; + if (bookmarkProjectName != null) + { + var project = ProjectService.GetProjectByProjectId(meeting.ProjectId); + if (project != null) + { + bookmarkProjectName.Text = project.ProjectName; + } + } + Bookmark bookmarkMeetingCode = doc.Range.Bookmarks["MeetingCode"]; + if (bookmarkMeetingCode != null) + { + bookmarkMeetingCode.Text = meeting.MeetingCode; + } + Bookmark bookmarkMeetingDate = doc.Range.Bookmarks["MeetingDate"]; + if (bookmarkMeetingDate != null) + { + if (meeting.MeetingDate != null) + { + bookmarkMeetingDate.Text = string.Format("{0:yyyy-MM-dd}", meeting.MeetingDate); + } + } + Bookmark bookmarkPlace = doc.Range.Bookmarks["Place"]; + if (bookmarkPlace != null) + { + bookmarkPlace.Text = meeting.Place; + } + Bookmark bookmarkHostMan = doc.Range.Bookmarks["HostMan"]; + if (bookmarkHostMan != null) + { + bookmarkHostMan.Text = ConvertHostMan(meeting.HostMan); + } + Bookmark bookmarkAttentPerson = doc.Range.Bookmarks["AttentPerson"]; + if (bookmarkAttentPerson != null) + { + bookmarkAttentPerson.Text = ConvertHostMan(meeting.AttentPerson); + } + Bookmark bookmarkMeetingTheme = doc.Range.Bookmarks["MeetingTheme"]; + if (bookmarkMeetingTheme != null) + { + bookmarkMeetingTheme.Text = meeting.MeetingTheme; + } + Bookmark bookmarkMeetingContents = doc.Range.Bookmarks["MeetingContents"]; + if (bookmarkMeetingContents != null) + { + bookmarkMeetingContents.Text = meeting.MeetingContents; + } + var compileApprove = (from x in Funs.DB.Meeting_CQMSMeetingApprove where x.MeetingId == fileId && x.ApproveType == Const.CQMSMeeting_Compile orderby x.ApproveDate descending select x).FirstOrDefault(); + var auditApprove = (from x in Funs.DB.Meeting_CQMSMeetingApprove where x.MeetingId == fileId && x.ApproveType == Const.CQMSMeeting_Audit orderby x.ApproveDate descending select x).FirstOrDefault(); + Bookmark bookmarkCompileMan = doc.Range.Bookmarks["CompileMan"]; + if (bookmarkCompileMan != null) + { + var user = Person_PersonsService.GetPerson_PersonsById(compileApprove.ApproveMan); + if (user != null) + { + bookmarkCompileMan.Text = user.PersonName; + } + } + Bookmark bookmarkAuditMan = doc.Range.Bookmarks["AuditMan"]; + if (bookmarkAuditMan != null) + { + var user = Person_PersonsService.GetPerson_PersonsById(auditApprove.ApproveMan); + if (user != null) + { + bookmarkAuditMan.Text = user.PersonName; + } + } + doc.Save(newUrl); + //生成PDF文件 + string pdfUrl = newUrl.Replace(".doc", ".pdf"); + Document doc1 = new Aspose.Words.Document(newUrl); + //验证参数 + if (doc1 == null) { throw new Exception("Word文件无效"); } + doc1.Save(pdfUrl, Aspose.Words.SaveFormat.Pdf);//还可以改成其它格式 + string fileName = Path.GetFileName(filePath); + FileInfo info = new FileInfo(pdfUrl); + long fileSize = info.Length; + Response.Clear(); + Response.ContentType = "application/x-zip-compressed"; + Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8)); + Response.AddHeader("Content-Length", fileSize.ToString()); + Response.TransmitFile(pdfUrl, 0, fileSize); + Response.Flush(); + Response.Close(); + File.Delete(newUrl); + File.Delete(pdfUrl); + } + if (e.CommandName.Equals("download")) + { + string menuId = Const.CQMSMonthMeetingMenuId; + PageContext.RegisterStartupScript(Windowtt.GetShowReference( + String.Format("../../AttachFile/webuploader.aspx?type=-1&source=1&toKeyId={0}&path=FileUpload/CQMS/Meeting&menuId={1}", fileId, menuId))); + } + } + + // + //获取主持人 + // + // + // + protected string ConvertHostMan(object HostMan) + { + string names = string.Empty; + if (HostMan != null) + { + string[] strs = HostMan.ToString().Split(','); + foreach (var item in strs) + { + names += BLL.Person_PersonsService.GetPersonsNameById(item) + ","; + } + if (!string.IsNullOrEmpty(names)) + { + names = names.Substring(0, names.Length - 1); + } + } + return names; + } + /// + /// 把状态转换代号为文字形式 + /// + /// + /// + protected string ConvertState(object state) + { + if (state != null) + { + if (state.ToString() == BLL.Const.CQMSMeeting_ReCompile) + { + return "重新编制"; + } + else if (state.ToString() == BLL.Const.CQMSMeeting_Compile) + { + return "编制"; + } + else if (state.ToString() == BLL.Const.CQMSMeeting_Audit) + { + return "总包质量经理审批"; + } + else if (state.ToString() == BLL.Const.CQMSMeeting_Complete) + { + return "审批完成"; + } + else + { + return ""; + } + } + return ""; + } + // + //获取办理人姓名 + // + // + // + protected string ConvertMan(object MeetingId) + { + if (MeetingId != null) + { + Model.Meeting_CQMSMeetingApprove a = BLL.CQMS_MeetingApproveService.GetCQMSMeetingApproveByMeetingId(MeetingId.ToString()); + if (a != null) + { + if (a.ApproveMan != null) + { + return BLL.Person_PersonsService.GetPersonsNameById(a.ApproveMan); + } + } + else + { + return ""; + } + } + return ""; + } + + protected void Grid1_RowDataBound(object sender, GridRowEventArgs e) + { + + } + + protected void btnMenuView_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); + return; + } + string id = Grid1.SelectedRowID; + var ins = BLL.CQMS_MeetingService.GetCQMSMeetingById(id); + + if (ins != null) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("MonthMeetingView.aspx?MeetingId={0}", id, "查看 - "))); + } + } + + protected void btnQuery_Click(object sender, EventArgs e) + { + BindGrid(); + } + protected void btnRset_Click(object sender, EventArgs e) + { + BindGrid(); + } + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CQMS/Meeting/MonthMeetingFile.aspx.designer.cs b/SGGL/FineUIPro.Web/CQMS/Meeting/MonthMeetingFile.aspx.designer.cs new file mode 100644 index 00000000..af584dfb --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Meeting/MonthMeetingFile.aspx.designer.cs @@ -0,0 +1,159 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.CQMS.Meeting { + + + public partial class MonthMeetingFile { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// hdID 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hdID; + + /// + /// lblPageIndex 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lblPageIndex; + + /// + /// Label2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label Label2; + + /// + /// Label1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label Label1; + + /// + /// ToolbarSeparator1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; + + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// Windowtt 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Windowtt; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + + /// + /// btnMenuView 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuView; + } +} diff --git a/SGGL/FineUIPro.Web/CQMS/Meeting/SpecialMeetingEdit.aspx.cs b/SGGL/FineUIPro.Web/CQMS/Meeting/SpecialMeetingEdit.aspx.cs index 204b172a..bb6d42f6 100644 --- a/SGGL/FineUIPro.Web/CQMS/Meeting/SpecialMeetingEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/CQMS/Meeting/SpecialMeetingEdit.aspx.cs @@ -222,7 +222,7 @@ namespace FineUIPro.Web.CQMS.Meeting { hdId.Text = SQLHelper.GetNewID(); } - PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../../AttachFile/webuploader.aspx?type=1&toKeyId={0}&path=FileUpload/CQMS/Meeting&menuId={1}", hdId.Text, BLL.Const.CQMSMonthMeetingMenuId))); + PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../../AttachFile/webuploader.aspx?type=1&toKeyId={0}&path=FileUpload/CQMS/Meeting&menuId={1}", hdId.Text, BLL.Const.CQMSSpecialMeetingMenuId))); } /// @@ -344,7 +344,7 @@ namespace FineUIPro.Web.CQMS.Meeting } CQMSMeeting.AttentPersonNum = num; CQMSMeeting.MeetingTheme = this.txtMeetingTheme.Text.Trim(); - CQMSMeeting.MeetingContents = this.txtMeetingContents.Text.Trim(); + CQMSMeeting.MeetingContents = this.txtMeetingContents.Text; if (saveType == "submit") { CQMSMeeting.State = this.drpHandleType.SelectedValue; diff --git a/SGGL/FineUIPro.Web/CQMS/Meeting/SpecialMeetingFile.aspx b/SGGL/FineUIPro.Web/CQMS/Meeting/SpecialMeetingFile.aspx new file mode 100644 index 00000000..7b00c53a --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Meeting/SpecialMeetingFile.aspx @@ -0,0 +1,125 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SpecialMeetingFile.aspx.cs" Inherits="FineUIPro.Web.CQMS.Meeting.SpecialMeetingFile" %> + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/CQMS/Meeting/SpecialMeetingFile.aspx.cs b/SGGL/FineUIPro.Web/CQMS/Meeting/SpecialMeetingFile.aspx.cs new file mode 100644 index 00000000..2a20bcb7 --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Meeting/SpecialMeetingFile.aspx.cs @@ -0,0 +1,402 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.Linq; +using System.Threading.Tasks; +using Aspose.Words; +using System.IO; + +namespace FineUIPro.Web.CQMS.Meeting +{ + public partial class SpecialMeetingFile : PageBase + { + /// + /// 项目id + /// + public string ProjectId + { + get + { + return (string)ViewState["ProjectId"]; + } + set + { + ViewState["ProjectId"] = value; + } + } + #region 加载页面 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + + // 表头过滤 + //FilterDataRowItem = FilterDataRowItemImplement; + if (!IsPostBack) + { + this.ProjectId = this.CurrUser.LoginProjectId; + ddlPageSize.SelectedValue = Grid1.PageSize.ToString(); + // 绑定表格 + BindGrid(); + } + } + #endregion + + protected DataTable insklistData() + { + string strSql = @"SELECT ins.*,un.UnitName,u.PersonName as CompileManName" + + @" FROM Meeting_CQMSMeeting ins" + + @" left join Base_Unit un on un.UnitId = ins.UnitId" + + @" left join Person_Persons u on u.PersonId = ins.CompileMan" + + @" where ins.ProjectId=@ProjectId and ins.MeetingType='S' and ins.State=@State "; + + List listStr = new List(); + listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId)); + listStr.Add(new SqlParameter("@State", BLL.Const.CQMSMeeting_Complete)); + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); + return tb; + } + + /// + /// 绑定数据 + /// + + public void BindGrid() + { + DataTable tb = insklistData(); + + // 2.获取当前分页数据 + //var table = this.GetPagedDataTable(Grid1, tb1); + + Grid1.RecordCount = tb.Rows.Count; + tb = GetFilteredTable(Grid1.FilteredData, tb); + var table = this.GetPagedDataTable(Grid1, tb); + Grid1.DataSource = table; + Grid1.DataBind(); + } + + + #region 查询 + /// + /// 查询 + /// + /// + /// + protected void TextBox_TextChanged(object sender, EventArgs e) + { + this.BindGrid(); + } + #endregion + + #region 过滤表头、排序、分页、关闭窗口 + /// + /// 过滤表头 + /// + /// + /// + protected void Grid1_FilterChange(object sender, EventArgs e) + { + BindGrid(); + } + + /// + /// 分页 + /// + /// + /// + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + Grid1.PageIndex = e.NewPageIndex; + BindGrid(); + } + + /// + /// 排序 + /// + /// + /// + protected void Grid1_Sort(object sender, GridSortEventArgs e) + { + //Grid1.SortDirection = e.SortDirection; + //Grid1.SortField = e.SortField; + BindGrid(); + } + + /// + /// 分页显示条数下拉框 + /// + /// + /// + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue); + BindGrid(); + } + + /// + /// 关闭弹出窗 + /// + /// + /// + protected void Window1_Close(object sender, WindowCloseEventArgs e) + { + BindGrid(); + string str = this.hdID.Text; + if (!string.IsNullOrEmpty(str)) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("SpecialMeetingEdit.aspx?MeetingId={0}", str, "查看 - "))); + } + this.hdID.Text = string.Empty; + } + #endregion + + #region Grid双击事件 + /// + /// Grid行双击事件 + /// + /// + /// + protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) + { + btnMenuView_Click(null, null); + } + #endregion + + protected void Grid1_RowCommand(object sender, GridCommandEventArgs e) + { + object[] keys = Grid1.DataKeys[e.RowIndex]; + string fileId = string.Empty; + if (keys == null) + { + return; + } + else + { + fileId = keys[0].ToString(); + } + if (e.CommandName == "export") + { + string rootPath = Server.MapPath("~/"); + string initTemplatePath = string.Empty; + string uploadfilepath = string.Empty; + string newUrl = string.Empty; + string filePath = string.Empty; + Model.Meeting_CQMSMeeting meeting = CQMS_MeetingService.GetCQMSMeetingById(fileId); + initTemplatePath = Const.CQMSMeetingTemplateUrl; + uploadfilepath = rootPath + initTemplatePath; + newUrl = uploadfilepath.Replace(".doc", meeting.MeetingCode.Replace("/", "-") + ".doc"); + filePath = initTemplatePath.Replace(".doc", meeting.MeetingCode.Replace("/", "-") + ".pdf"); + File.Copy(uploadfilepath, newUrl); + //更新书签内容 + Document doc = new Aspose.Words.Document(newUrl); + Bookmark bookmarkProjectName = doc.Range.Bookmarks["ProjectName"]; + if (bookmarkProjectName != null) + { + var project = ProjectService.GetProjectByProjectId(meeting.ProjectId); + if (project != null) + { + bookmarkProjectName.Text = project.ProjectName; + } + } + Bookmark bookmarkMeetingCode = doc.Range.Bookmarks["MeetingCode"]; + if (bookmarkMeetingCode != null) + { + bookmarkMeetingCode.Text = meeting.MeetingCode; + } + Bookmark bookmarkMeetingDate = doc.Range.Bookmarks["MeetingDate"]; + if (bookmarkMeetingDate != null) + { + if (meeting.MeetingDate != null) + { + bookmarkMeetingDate.Text = string.Format("{0:yyyy-MM-dd}", meeting.MeetingDate); + } + } + Bookmark bookmarkPlace = doc.Range.Bookmarks["Place"]; + if (bookmarkPlace != null) + { + bookmarkPlace.Text = meeting.Place; + } + Bookmark bookmarkHostMan = doc.Range.Bookmarks["HostMan"]; + if (bookmarkHostMan != null) + { + bookmarkHostMan.Text = ConvertHostMan(meeting.HostMan); + } + Bookmark bookmarkAttentPerson = doc.Range.Bookmarks["AttentPerson"]; + if (bookmarkAttentPerson != null) + { + bookmarkAttentPerson.Text = ConvertHostMan(meeting.AttentPerson); + } + Bookmark bookmarkMeetingTheme = doc.Range.Bookmarks["MeetingTheme"]; + if (bookmarkMeetingTheme != null) + { + bookmarkMeetingTheme.Text = meeting.MeetingTheme; + } + Bookmark bookmarkMeetingContents = doc.Range.Bookmarks["MeetingContents"]; + if (bookmarkMeetingContents != null) + { + bookmarkMeetingContents.Text = meeting.MeetingContents; + } + var compileApprove = (from x in Funs.DB.Meeting_CQMSMeetingApprove where x.MeetingId == fileId && x.ApproveType == Const.CQMSMeeting_Compile orderby x.ApproveDate descending select x).FirstOrDefault(); + var auditApprove = (from x in Funs.DB.Meeting_CQMSMeetingApprove where x.MeetingId == fileId && x.ApproveType == Const.CQMSMeeting_Audit orderby x.ApproveDate descending select x).FirstOrDefault(); + Bookmark bookmarkCompileMan = doc.Range.Bookmarks["CompileMan"]; + if (bookmarkCompileMan != null) + { + var user = Person_PersonsService.GetPerson_PersonsById(compileApprove.ApproveMan); + if (user != null) + { + bookmarkCompileMan.Text = user.PersonName; + } + } + Bookmark bookmarkAuditMan = doc.Range.Bookmarks["AuditMan"]; + if (bookmarkAuditMan != null) + { + var user = Person_PersonsService.GetPerson_PersonsById(auditApprove.ApproveMan); + if (user != null) + { + bookmarkAuditMan.Text = user.PersonName; + } + } + doc.Save(newUrl); + //生成PDF文件 + string pdfUrl = newUrl.Replace(".doc", ".pdf"); + Document doc1 = new Aspose.Words.Document(newUrl); + //验证参数 + if (doc1 == null) { throw new Exception("Word文件无效"); } + doc1.Save(pdfUrl, Aspose.Words.SaveFormat.Pdf);//还可以改成其它格式 + string fileName = Path.GetFileName(filePath); + FileInfo info = new FileInfo(pdfUrl); + long fileSize = info.Length; + Response.Clear(); + Response.ContentType = "application/x-zip-compressed"; + Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8)); + Response.AddHeader("Content-Length", fileSize.ToString()); + Response.TransmitFile(pdfUrl, 0, fileSize); + Response.Flush(); + Response.Close(); + File.Delete(newUrl); + File.Delete(pdfUrl); + } + if (e.CommandName.Equals("download")) + { + string menuId = Const.CQMSSpecialMeetingMenuId; + PageContext.RegisterStartupScript(Windowtt.GetShowReference( + String.Format("../../AttachFile/webuploader.aspx?type=-1&source=1&toKeyId={0}&path=FileUpload/CQMS/Meeting&menuId={1}", fileId, menuId))); + } + } + + // + //获取主持人 + // + // + // + protected string ConvertHostMan(object HostMan) + { + string names = string.Empty; + if (HostMan != null) + { + string[] strs = HostMan.ToString().Split(','); + foreach (var item in strs) + { + names += BLL.Person_PersonsService.GetPersonsNameById(item) + ","; + } + if (!string.IsNullOrEmpty(names)) + { + names = names.Substring(0, names.Length - 1); + } + } + return names; + } + /// + /// 把状态转换代号为文字形式 + /// + /// + /// + protected string ConvertState(object state) + { + if (state != null) + { + if (state.ToString() == BLL.Const.CQMSMeeting_ReCompile) + { + return "重新编制"; + } + else if (state.ToString() == BLL.Const.CQMSMeeting_Compile) + { + return "编制"; + } + else if (state.ToString() == BLL.Const.CQMSMeeting_Audit) + { + return "总包质量经理审批"; + } + else if (state.ToString() == BLL.Const.CQMSMeeting_Complete) + { + return "审批完成"; + } + else + { + return ""; + } + } + return ""; + } + // + //获取办理人姓名 + // + // + // + protected string ConvertMan(object MeetingId) + { + if (MeetingId != null) + { + Model.Meeting_CQMSMeetingApprove a = BLL.CQMS_MeetingApproveService.GetCQMSMeetingApproveByMeetingId(MeetingId.ToString()); + if (a != null) + { + if (a.ApproveMan != null) + { + return BLL.Person_PersonsService.GetPersonsNameById(a.ApproveMan); + } + } + else + { + return ""; + } + } + return ""; + } + + protected void Grid1_RowDataBound(object sender, GridRowEventArgs e) + { + + } + + protected void btnMenuView_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); + return; + } + string id = Grid1.SelectedRowID; + var ins = BLL.CQMS_MeetingService.GetCQMSMeetingById(id); + + if (ins != null) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("SpecialMeetingView.aspx?MeetingId={0}", id, "查看 - "))); + } + } + + protected void btnQuery_Click(object sender, EventArgs e) + { + BindGrid(); + } + protected void btnRset_Click(object sender, EventArgs e) + { + BindGrid(); + } + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CQMS/Meeting/SpecialMeetingFile.aspx.designer.cs b/SGGL/FineUIPro.Web/CQMS/Meeting/SpecialMeetingFile.aspx.designer.cs new file mode 100644 index 00000000..4d53040b --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Meeting/SpecialMeetingFile.aspx.designer.cs @@ -0,0 +1,159 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.CQMS.Meeting { + + + public partial class SpecialMeetingFile { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// hdID 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hdID; + + /// + /// lblPageIndex 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lblPageIndex; + + /// + /// Label2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label Label2; + + /// + /// Label1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label Label1; + + /// + /// ToolbarSeparator1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; + + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// Windowtt 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Windowtt; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + + /// + /// btnMenuView 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuView; + } +} diff --git a/SGGL/FineUIPro.Web/CQMS/Meeting/SpecialMeetingView.aspx.cs b/SGGL/FineUIPro.Web/CQMS/Meeting/SpecialMeetingView.aspx.cs index 3509dbd3..33a68a11 100644 --- a/SGGL/FineUIPro.Web/CQMS/Meeting/SpecialMeetingView.aspx.cs +++ b/SGGL/FineUIPro.Web/CQMS/Meeting/SpecialMeetingView.aspx.cs @@ -176,7 +176,7 @@ namespace FineUIPro.Web.CQMS.Meeting { hdId.Text = SQLHelper.GetNewID(); } - PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../../AttachFile/webuploader.aspx?type=-1&toKeyId={0}&path=FileUpload/CQMS/Meeting&menuId={1}", hdId.Text, BLL.Const.CQMSMonthMeetingMenuId))); + PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../../AttachFile/webuploader.aspx?type=-1&toKeyId={0}&path=FileUpload/CQMS/Meeting&menuId={1}", hdId.Text, BLL.Const.CQMSSpecialMeetingMenuId))); } private string GetStringByArray(string[] array) diff --git a/SGGL/FineUIPro.Web/File/Word/CQMS/Check/质量会议.doc b/SGGL/FineUIPro.Web/File/Word/CQMS/Check/质量会议.doc new file mode 100644 index 00000000..8c556493 Binary files /dev/null and b/SGGL/FineUIPro.Web/File/Word/CQMS/Check/质量会议.doc differ diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj index 078f9428..3611a660 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj @@ -354,9 +354,11 @@ + + @@ -6364,6 +6366,13 @@ MonthMeetingEdit.aspx + + MonthMeetingFile.aspx + ASPXCodeBehind + + + MonthMeetingFile.aspx + MonthMeetingView.aspx ASPXCodeBehind @@ -6385,6 +6394,13 @@ SpecialMeetingEdit.aspx + + SpecialMeetingFile.aspx + ASPXCodeBehind + + + SpecialMeetingFile.aspx + SpecialMeetingView.aspx ASPXCodeBehind