diff --git a/DataBase/版本日志/SUBQHSE_V2025-12-12-xiaj(View_DCGL_CheckRectifyListFromSUB).sql b/DataBase/版本日志/SUBQHSE_V2025-12-12-xiaj(View_DCGL_CheckRectifyListFromSUB).sql new file mode 100644 index 00000000..26399a2a --- /dev/null +++ b/DataBase/版本日志/SUBQHSE_V2025-12-12-xiaj(View_DCGL_CheckRectifyListFromSUB).sql @@ -0,0 +1,56 @@ + + +ALTER VIEW [dbo].[View_DCGL_CheckRectifyListFromSUB] +AS +/*ӹ˾ĵͼ*/ +SELECT CheckRectifyItem.CheckRectifyItemId + ,CheckRectifyItem.CheckRectifyId + ,CheckRectifyItem.NoticeItemId + ,CheckRectifyItem.ConfirmMan + ,CheckRectifyItem.ConfirmManName + ,CheckRectifyItem.ConfirmDate + ,CheckRectifyItem.OrderEndDate + ,CheckRectifyItem.OrderEndPerson + ,CheckRectifyItem.RealEndDate + ,CheckRectifyItem.Verification + ,CheckRectify.CheckRectifyCode + ,CheckRectify.ProjectId + ,CheckRectify.UnitId + ,CheckRectify.CheckDate + ,CheckRectify.IssueMan + ,CheckRectify.IssueDate + ,CheckRectify.HandleState + ,NoticeItem.ProblemTypes AS ProblemTypes + ,NoticeItem.RiskLevel AS RiskLevel + ,NoticeItem.SortIndex AS SortIndex + ,NoticeItem.Situation AS Situation + ,'' AS WorkType + ,'' AS DangerPoint + ,'⣩:'+NoticeItem.Describe+';ݱ׼:'+NoticeItem.Standards+';:'+NoticeItem.Advice AS RiskExists + ,'' AS IsProject + ,'' AS CheckMan + ,'' AS SubjectUnitMan + --,Table5Item.SortIndex + --,Table5Item.WorkType + --,Table5Item.DangerPoint + --,Table5Item.RiskExists + --,Table5Item.IsProject + --,Table5Item.CheckMan + --,Table5Item.SubjectUnitMan + ,AttachFile.AttachFileId + ,AttachFile.ToKeyId + ,AttachFile.AttachSource + ,AttachFile.AttachUrl + ,AttachFile2.AttachFileId AS AttachFileId2 + ,AttachFile2.ToKeyId AS ToKeyId2 + ,AttachFile2.AttachSource AS AttachSource2 + ,AttachFile2.AttachUrl AS AttachUrl2 +FROM dbo.DCGL_Check_CheckRectifyItem AS CheckRectifyItem +LEFT JOIN dbo.DCGL_Check_CheckRectify AS CheckRectify ON CheckRectifyItem.CheckRectifyid=CheckRectify.CheckRectifyId +--LEFT JOIN dbo.Check_CheckInfo_Table5Item as Table5Item on CheckRectifyItem.Table5ItemId=Table5Item.ID +LEFT JOIN DCGL_Check_CheckInfo_TableNoticeItem AS NoticeItem ON CheckRectifyItem.NoticeItemId=NoticeItem.ID +LEFT JOIN dbo.AttachFile AS AttachFile on AttachFile.ToKeyId =CheckRectifyItem.NoticeItemId +LEFT JOIN dbo.AttachFile AS AttachFile2 on AttachFile2.ToKeyId =CheckRectifyItem.CheckRectifyItemId +GO + + diff --git a/SGGL/FineUIPro.Web/DCGL/ServerCheck/CheckNotice.aspx.cs b/SGGL/FineUIPro.Web/DCGL/ServerCheck/CheckNotice.aspx.cs index a7d158c9..7aebb7ac 100644 --- a/SGGL/FineUIPro.Web/DCGL/ServerCheck/CheckNotice.aspx.cs +++ b/SGGL/FineUIPro.Web/DCGL/ServerCheck/CheckNotice.aspx.cs @@ -40,6 +40,7 @@ namespace FineUIPro.Web.DCGL.ServerCheck { if (!IsPostBack) { + getDCGLCheckInfo(); ////权限按钮方法 this.InitTreeMenu(); this.CheckInfoId = string.Empty; @@ -350,6 +351,16 @@ namespace FineUIPro.Web.DCGL.ServerCheck /// /// protected void btnGet_Click(object sender, EventArgs e) + { + getDCGLCheckInfo(); + } + + /// + /// 从集团获取 + /// + /// + /// + protected void getDCGLCheckInfo() { var returnValue = getDCGLCheckInfo_CheckTeam(); // var returnValue= CNCECHSSEGetWebService.getCheck_CheckInfo_Table8Item(); @@ -364,7 +375,6 @@ namespace FineUIPro.Web.DCGL.ServerCheck Alert.ShowInTop(returnValue.message, MessageBoxIcon.Success); } } - #region 获取 /// /// 获取 diff --git a/SGGL/FineUIPro.Web/DCGL/ServerCheck/CheckRectify.aspx.cs b/SGGL/FineUIPro.Web/DCGL/ServerCheck/CheckRectify.aspx.cs index 14c94429..dad09ccb 100644 --- a/SGGL/FineUIPro.Web/DCGL/ServerCheck/CheckRectify.aspx.cs +++ b/SGGL/FineUIPro.Web/DCGL/ServerCheck/CheckRectify.aspx.cs @@ -18,6 +18,7 @@ namespace FineUIPro.Web.DCGL.ServerCheck { if (!IsPostBack) { + getCheck(); proType = Request.Params["proType"] ?? string.Empty; this.GetButtonPower(); //btnNew.OnClientClick = Window1.GetShowReference("CheckRectifyEdit.aspx") + "return false;"; @@ -36,11 +37,12 @@ namespace FineUIPro.Web.DCGL.ServerCheck sb.Append($@"SELECT S.CheckRectifyId,S.CheckRectifyCode,S.ProjectId,S.ProjectName,S.UnitId,U.UnitName,S.CheckDate,CASE S.HandleState WHEN '{BLL.Const.State_1}' THEN '未签发' WHEN '{BLL.Const.State_2}' THEN '未上报' ELSE '已上报' END AS HandleState, S.IssueMan,S.IssueDate,ISNULL(TotalCount.TotalCount,0) AS TotalCount ,ISNULL(CompleteCount.CompleteCount,0) AS CompleteCount,(ISNULL(TotalCount.TotalCount,0) -ISNULL(CompleteCount.CompleteCount,0)) AS UnCompleteCount "); sb.Append("FROM dbo.DCGL_Check_CheckRectify AS S LEFT JOIN dbo.Base_Unit AS U ON U.UnitId = S.UnitId "); - sb.Append(" LEFT JOIN (SELECT COUNT(1) AS TotalCount, CheckRectifyId FROM dbo.DCGL_Check_CheckRectifyItem GROUP BY CheckRectifyId) AS TotalCount ON S.CheckRectifyId=TotalCount.CheckRectifyId "); - sb.Append(" LEFT JOIN (SELECT COUNT(1) AS CompleteCount, CheckRectifyId FROM dbo.DCGL_Check_CheckRectifyItem WHERE RealEndDate IS NOT NULL GROUP BY CheckRectifyId) AS CompleteCount ON S.CheckRectifyId=CompleteCount.CheckRectifyId "); - if (!string.IsNullOrWhiteSpace(proType) && proType == "1") + sb.Append(" LEFT JOIN (SELECT COUNT(*) AS TotalCount, CheckRectifyId FROM dbo.DCGL_Check_CheckRectifyItem GROUP BY CheckRectifyId) AS TotalCount ON S.CheckRectifyId=TotalCount.CheckRectifyId "); + sb.Append(" LEFT JOIN (SELECT COUNT(*) AS CompleteCount, CheckRectifyId FROM dbo.DCGL_Check_CheckRectifyItem WHERE RealEndDate IS NOT NULL GROUP BY CheckRectifyId) AS CompleteCount ON S.CheckRectifyId=CompleteCount.CheckRectifyId "); + sb.Append("WHERE 1=1 "); + if (!string.IsNullOrWhiteSpace(this.CurrUser.LoginProjectId) && !string.IsNullOrWhiteSpace(proType) && proType == "1") {//只查询本项目检查数据 - sb.Append($"WHERE S.ProjectId='{this.CurrUser.LoginProjectId}' "); + sb.Append($"And S.ProjectId='{this.CurrUser.LoginProjectId}' "); } sb.Append("ORDER BY HandleState"); SqlParameter[] parameter = new SqlParameter[] { }; @@ -135,7 +137,7 @@ namespace FineUIPro.Web.DCGL.ServerCheck return; } string CheckRectifyId = Grid1.SelectedRowID; - PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("CheckRectifyEdit.aspx?CheckRectifyId={0}", CheckRectifyId, "编辑 - "))); + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("CheckRectifyEdit.aspx?CheckRectifyId={0}&proType={1}", CheckRectifyId, proType, "编辑 - "))); } #endregion @@ -378,6 +380,14 @@ namespace FineUIPro.Web.DCGL.ServerCheck /// /// protected void btnGet_Click(object sender, EventArgs e) + { + getCheck(); + } + + /// + /// 从集团获取整改单 + /// + protected void getCheck() { var returnValue = getCheck_CheckRectifyListToSUB(); if (returnValue.code == 1) @@ -391,7 +401,6 @@ namespace FineUIPro.Web.DCGL.ServerCheck } } - #region 获取 /// diff --git a/SGGL/FineUIPro.Web/DCGL/ServerCheck/CheckRectifyEdit.aspx b/SGGL/FineUIPro.Web/DCGL/ServerCheck/CheckRectifyEdit.aspx index a70892a9..d4ac1623 100644 --- a/SGGL/FineUIPro.Web/DCGL/ServerCheck/CheckRectifyEdit.aspx +++ b/SGGL/FineUIPro.Web/DCGL/ServerCheck/CheckRectifyEdit.aspx @@ -14,6 +14,7 @@ white-space: normal; word-break: break-all; } + .imgPreview { display: none; top: 0; @@ -82,23 +83,35 @@ - - + + + + + <%----%> + <%-- - + --%> + - + + <%-- + --%> + + @@ -109,7 +122,13 @@ ToolTip="相关照片附件" DataIFrameUrlFields="NoticeItemId" DataIFrameUrlFormatString="../../AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/Check&type=-1" Title="相关照片" ColumnID="WindowAtt"> --%> - + + + + + @@ -139,18 +158,18 @@ - <%-- --%> - - - + + + + @@ -185,7 +207,7 @@ - <%----%> diff --git a/SGGL/FineUIPro.Web/DCGL/ServerCheck/CheckRectifyEdit.aspx.cs b/SGGL/FineUIPro.Web/DCGL/ServerCheck/CheckRectifyEdit.aspx.cs index 82c0d2c5..3075aa46 100644 --- a/SGGL/FineUIPro.Web/DCGL/ServerCheck/CheckRectifyEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/DCGL/ServerCheck/CheckRectifyEdit.aspx.cs @@ -1,13 +1,16 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Text; using BLL; using Newtonsoft.Json.Linq; +using AspNet = System.Web.UI.WebControls; namespace FineUIPro.Web.DCGL.ServerCheck { public partial class CheckRectifyEdit : PageBase { + private static string proType; /// /// 主键 /// @@ -40,6 +43,7 @@ namespace FineUIPro.Web.DCGL.ServerCheck { this.GetButtonPower(); this.CheckRectifyId = Request.Params["CheckRectifyId"]; + proType = Request.Params["proType"] ?? string.Empty; if (!string.IsNullOrEmpty(this.CheckRectifyId)) { var rectify = Funs.DB.DCGL_Check_CheckRectify.FirstOrDefault(x => x.CheckRectifyId == this.CheckRectifyId); @@ -72,8 +76,8 @@ namespace FineUIPro.Web.DCGL.ServerCheck Grid1.DataBind(); //if (CheckRectifyItems.FirstOrDefault(x => x.DangerPoint.Length > 1) == null) //{ - this.Grid1.Columns[1].Hidden = true; - this.Grid1.Columns[2].Hidden = true; + //this.Grid1.Columns[1].Hidden = true; + //this.Grid1.Columns[2].Hidden = true; //} } } @@ -101,6 +105,27 @@ namespace FineUIPro.Web.DCGL.ServerCheck } return url; } + /// + /// 获取整改后图片(放于Img中) + /// + /// + /// + protected string ConvertImaUrlByImage(object id) + { + string url = string.Empty; + string httpUrl = string.Empty; + var sysSet6 = (from x in Funs.DB.Sys_Set where x.SetName == "程序访问地址" select x).ToList().FirstOrDefault(); + if (sysSet6 != null) + { + httpUrl = sysSet6.SetValue; + } + var attachFile = Funs.DB.AttachFile.FirstOrDefault(x => x.ToKeyId == id.ToString()); + if (attachFile != null) + { + url = BLL.UploadAttachmentService.ShowImage(httpUrl, attachFile.AttachUrl); + } + return url; + } /// /// 保存按钮 @@ -208,7 +233,14 @@ namespace FineUIPro.Web.DCGL.ServerCheck if (buttonList.Contains(BLL.Const.BtnSave)) { this.btnSave.Hidden = false; - this.btnSaveUp.Hidden = false; + if (proType == "1") + { + this.btnSaveUp.Hidden = true; + } + else + { + this.btnSaveUp.Hidden = false; + } } } } @@ -225,5 +257,85 @@ namespace FineUIPro.Web.DCGL.ServerCheck PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); } #endregion + + #region 导出 + + /// + /// 导出按钮 + /// + /// + /// + protected void btnOutExcel_Click(object sender, EventArgs e) + { + Response.ClearContent(); + var unitProjectName = $"{this.lbUnitName.Text}{this.lbProjectName.Text}"; + string filename = Funs.GetNewFileName(); + Response.AddHeader("content-disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode(unitProjectName + "隐患问题表" + filename, System.Text.Encoding.UTF8) + ".xls"); + Response.ContentType = "application/excel"; + Response.ContentEncoding = System.Text.Encoding.UTF8; + this.Grid1.PageSize = this.Grid1.RecordCount; + //this.BindGrid(); + Response.Write(GetGridTableHtml(Grid1)); + Response.End(); + } + + /// + /// 导出方法 + /// + /// + /// + private string GetGridTableHtml(Grid grid) + { + StringBuilder sb = new StringBuilder(); + sb.Append(""); + sb.Append(""); + sb.Append(""); + sb.AppendFormat("", ""); + sb.Append(""); + sb.Append(""); + foreach (GridColumn column in grid.Columns) + { + if (column.ColumnID != "ckbIsSelected" && column.ColumnID != "Punish" && column.ColumnID != "Del" && column.ColumnID != "CheckRectifyItemId" && column.ColumnID != "WindowAtt1") + { + sb.AppendFormat("", column.HeaderText); + } + } + sb.Append(""); + foreach (GridRow row in grid.Rows) + { + sb.Append(""); + foreach (GridColumn column in grid.Columns) + { + if (column.ColumnID != "ckbIsSelected" && column.ColumnID != "Punish" && column.ColumnID != "Del" && column.ColumnID != "CheckRectifyItemId" && column.ColumnID != "WindowAtt1") + { + string html = row.Values[column.ColumnIndex].ToString(); + if (column.ColumnID == "tfPageIndex") + { + html = (row.FindControl("lblPageIndex") as AspNet.Label).Text; + } + if (column.ColumnID == "tfRiskExists") + { + html = (row.FindControl("lbRiskExists") as AspNet.Label).Text; + } + if (column.ColumnID == "tfImageUrl1") + { + html = (row.FindControl("lbImageUrl1") as AspNet.Label).Text; + } + if (column.ColumnID == "tfImageUrl2") + { + html = (row.FindControl("tfImageUrl2") as AspNet.Label).Text; + } + sb.AppendFormat("", html); + } + } + sb.Append(""); + } + sb.Append("
集团督查检查隐患列表
{0}
{0}
"); + + return sb.ToString(); + } + + + #endregion } } \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/DCGL/ServerCheck/CheckRectifyEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/DCGL/ServerCheck/CheckRectifyEdit.aspx.designer.cs index d4dbed10..ef71075f 100644 --- a/SGGL/FineUIPro.Web/DCGL/ServerCheck/CheckRectifyEdit.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/DCGL/ServerCheck/CheckRectifyEdit.aspx.designer.cs @@ -132,22 +132,22 @@ namespace FineUIPro.Web.DCGL.ServerCheck protected global::FineUIPro.Grid Grid1; /// - /// Label15 控件。 + /// lblPageIndex 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::System.Web.UI.WebControls.Label Label15; + protected global::System.Web.UI.WebControls.Label lblPageIndex; /// - /// Label4 控件。 + /// lbRiskExists 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::System.Web.UI.WebControls.Label Label4; + protected global::System.Web.UI.WebControls.Label lbRiskExists; /// /// lbImageUrl1 控件。 @@ -158,6 +158,15 @@ namespace FineUIPro.Web.DCGL.ServerCheck /// protected global::System.Web.UI.WebControls.Label lbImageUrl1; + /// + /// tfImageUrl2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label tfImageUrl2; + /// /// txtOrderEndPerson 控件。 /// @@ -183,7 +192,7 @@ namespace FineUIPro.Web.DCGL.ServerCheck /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.TextBox txtSituation; + protected global::FineUIPro.TextArea txtSituation; /// /// Toolbar1 控件。 @@ -194,6 +203,15 @@ namespace FineUIPro.Web.DCGL.ServerCheck /// protected global::FineUIPro.Toolbar Toolbar1; + /// + /// btnOutExcel 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnOutExcel; + /// /// btnSave 控件。 /// diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj index 172b83e9..3d823f99 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj @@ -20247,7 +20247,7 @@ - +