From 6b5fb3a86548d1d3207d998356be804ba26b3f0e Mon Sep 17 00:00:00 2001 From: yhw0507 Date: Wed, 24 Jan 2024 15:56:52 +0800 Subject: [PATCH 1/5] =?UTF-8?q?20240124=E5=AE=89=E5=85=A8=E9=A3=8E?= =?UTF-8?q?=E9=99=A9=E5=8F=96=E5=80=BC=E4=B8=8A=E6=8A=A5=E9=9B=86=E5=9B=A2?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=96=B9=E6=B3=95=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../InterFaceService/InterFaceLogService .cs | 38 +++++++++---------- .../Project_HSSEData_HSSEService.cs | 12 ++++-- .../DataShow/SecurityRisk.aspx.cs | 3 +- .../TaskScheduling/InterFace/IFLogList.aspx | 28 +++++++------- .../InterFace/IFLogList.aspx.designer.cs | 9 +++++ .../InterFace/InterFaceSet.aspx | 2 +- .../InterFace/InterFaceTask.aspx | 2 +- 7 files changed, 55 insertions(+), 39 deletions(-) diff --git a/SGGL/BLL/TaskScheduling/InterFaceService/InterFaceLogService .cs b/SGGL/BLL/TaskScheduling/InterFaceService/InterFaceLogService .cs index 073b2938..353ace12 100644 --- a/SGGL/BLL/TaskScheduling/InterFaceService/InterFaceLogService .cs +++ b/SGGL/BLL/TaskScheduling/InterFaceService/InterFaceLogService .cs @@ -29,25 +29,25 @@ namespace BLL get; set; } - public static List GetInterFaceLogByModle(Model.InterFaceLog table) - { - var q= from x in db.InterFaceLog - where - ( string.IsNullOrEmpty(table.InterFaceLogId)||x.InterFaceLogId.Contains(table.InterFaceLogId)) && - ( string.IsNullOrEmpty(table.UserId)||x.UserId.Contains(table.UserId)) && - ( string.IsNullOrEmpty(table.UnitId)||x.UnitId.Contains(table.UnitId)) && - ( string.IsNullOrEmpty(table.InterFaceName)||x.InterFaceName.Contains(table.InterFaceName)) && - ( string.IsNullOrEmpty(table.InterFaceUrl)||x.InterFaceUrl.Contains(table.InterFaceUrl)) && - ( string.IsNullOrEmpty(table.InterFaceMehtod)||x.InterFaceMehtod.Contains(table.InterFaceMehtod)) && - ( string.IsNullOrEmpty(table.InterFaceBody)||x.InterFaceBody.Contains(table.InterFaceBody)) && - ( string.IsNullOrEmpty(table.InterFaceReturnData)||x.InterFaceReturnData.Contains(table.InterFaceReturnData)) && - ( string.IsNullOrEmpty(table.InterFaceType)||x.InterFaceType.Contains(table.InterFaceType)) && - ( string.IsNullOrEmpty(table.IP)||x.IP.Contains(table.IP)) - orderby x.InterFaceLogDate descending - select x - ; - - return q.ToList(); + public static List GetInterFaceLogByModle(Model.InterFaceLog table) + { + var q = from x in db.InterFaceLog + where + (string.IsNullOrEmpty(table.InterFaceLogId) || x.InterFaceLogId.Contains(table.InterFaceLogId)) && + (string.IsNullOrEmpty(table.UserId) || x.UserId.Contains(table.UserId)) && + (string.IsNullOrEmpty(table.UnitId) || x.UnitId.Contains(table.UnitId)) && + (string.IsNullOrEmpty(table.InterFaceName) || x.InterFaceName.Contains(table.InterFaceName)) && + (string.IsNullOrEmpty(table.InterFaceUrl) || x.InterFaceUrl.Contains(table.InterFaceUrl)) && + (string.IsNullOrEmpty(table.InterFaceMehtod) || x.InterFaceMehtod.Contains(table.InterFaceMehtod)) && + (string.IsNullOrEmpty(table.InterFaceBody) || x.InterFaceBody.Contains(table.InterFaceBody)) && + (string.IsNullOrEmpty(table.InterFaceReturnData) || x.InterFaceReturnData.Contains(table.InterFaceReturnData)) && + (string.IsNullOrEmpty(table.InterFaceType) || x.InterFaceType.Contains(table.InterFaceType)) && + (string.IsNullOrEmpty(table.IP) || x.IP.Contains(table.IP)) + orderby x.InterFaceLogDate descending + select x + ; + + return q.ToList(); } /// 获取分页列表 diff --git a/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HSSEData_HSSEService.cs b/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HSSEData_HSSEService.cs index ee27a6ef..7fbb5bec 100644 --- a/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HSSEData_HSSEService.cs +++ b/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HSSEData_HSSEService.cs @@ -1355,7 +1355,8 @@ namespace BLL { var result = (from x in Funs.DB.Hazard_HazardSelectedItem join y in Funs.DB.Base_RiskLevel on x.HazardLevel equals y.RiskLevelId - where x.ProjectId == projectid && y.RiskLevel == 2 + join z in Funs.DB.Hazard_HazardList on x.HazardListId equals z.HazardListId + where z.ProjectId == projectid && y.RiskLevel == 2 && z.CompileDate.Value.Year >= 2023 select x).Count(); return result; } @@ -1368,7 +1369,8 @@ namespace BLL { var result = (from x in Funs.DB.Hazard_HazardSelectedItem join y in Funs.DB.Base_RiskLevel on x.HazardLevel equals y.RiskLevelId - where x.ProjectId == projectid && y.RiskLevel == 1 + join z in Funs.DB.Hazard_HazardList on x.HazardListId equals z.HazardListId + where z.ProjectId == projectid && y.RiskLevel == 1 && z.CompileDate.Value.Year >= 2023 select x).Count(); return result; } @@ -1381,7 +1383,8 @@ namespace BLL { var result = (from x in Funs.DB.Hazard_HazardSelectedItem join y in Funs.DB.Base_RiskLevel on x.HazardLevel equals y.RiskLevelId - where x.ProjectId == projectid && y.RiskLevel == 3 + join z in Funs.DB.Hazard_HazardList on x.HazardListId equals z.HazardListId + where z.ProjectId == projectid && y.RiskLevel == 3 && z.CompileDate.Value.Year >= 2023 select x).Count(); return result; } @@ -1394,7 +1397,8 @@ namespace BLL { var result = (from x in Funs.DB.Hazard_HazardSelectedItem join y in Funs.DB.Base_RiskLevel on x.HazardLevel equals y.RiskLevelId - where x.ProjectId == projectid && y.RiskLevel == 4 + join z in Funs.DB.Hazard_HazardList on x.HazardListId equals z.HazardListId + where z.ProjectId == projectid && y.RiskLevel == 4 && z.CompileDate.Value.Year >= 2023 select x).Count(); return result; } diff --git a/SGGL/FineUIPro.Web/DataShow/SecurityRisk.aspx.cs b/SGGL/FineUIPro.Web/DataShow/SecurityRisk.aspx.cs index 52fbf7ea..6f06481e 100644 --- a/SGGL/FineUIPro.Web/DataShow/SecurityRisk.aspx.cs +++ b/SGGL/FineUIPro.Web/DataShow/SecurityRisk.aspx.cs @@ -235,7 +235,7 @@ namespace FineUIPro.Web.DataShow count = (from x in Funs.DB.Hazard_HazardSelectedItem join y in Funs.DB.Hazard_HazardList on x.HazardListId equals y.HazardListId where y.ProjectId == projectId && (x.HazardLevel == getlevel.RiskLevelId || x.HazardLevel == level.ToString()) && y.States == Const.State_2 - + && y.CompileDate.Value.Year >= 2023 select x).Count(); } else @@ -243,6 +243,7 @@ namespace FineUIPro.Web.DataShow count = (from x in Funs.DB.Hazard_HazardSelectedItem join y in Funs.DB.Hazard_HazardList on x.HazardListId equals y.HazardListId where y.ProjectId == projectId && x.HazardLevel == level.ToString() && y.States == Const.State_2 + && y.CompileDate.Value.Year >= 2023 select x).Count(); } return count; diff --git a/SGGL/FineUIPro.Web/TaskScheduling/InterFace/IFLogList.aspx b/SGGL/FineUIPro.Web/TaskScheduling/InterFace/IFLogList.aspx index dae759f9..a5eea11a 100644 --- a/SGGL/FineUIPro.Web/TaskScheduling/InterFace/IFLogList.aspx +++ b/SGGL/FineUIPro.Web/TaskScheduling/InterFace/IFLogList.aspx @@ -24,10 +24,10 @@ - <%-- --%> <%-- --%> - - - - - - - - + + + + + - - diff --git a/SGGL/FineUIPro.Web/TaskScheduling/InterFace/IFLogList.aspx.designer.cs b/SGGL/FineUIPro.Web/TaskScheduling/InterFace/IFLogList.aspx.designer.cs index fb1941da..7d990fcc 100644 --- a/SGGL/FineUIPro.Web/TaskScheduling/InterFace/IFLogList.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/TaskScheduling/InterFace/IFLogList.aspx.designer.cs @@ -95,6 +95,15 @@ namespace FineUIPro.Web.InterFace /// protected global::System.Web.UI.WebControls.Label Label1; + /// + /// Label2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label Label2; + /// /// Label4 控件。 /// diff --git a/SGGL/FineUIPro.Web/TaskScheduling/InterFace/InterFaceSet.aspx b/SGGL/FineUIPro.Web/TaskScheduling/InterFace/InterFaceSet.aspx index 429f3687..2993c933 100644 --- a/SGGL/FineUIPro.Web/TaskScheduling/InterFace/InterFaceSet.aspx +++ b/SGGL/FineUIPro.Web/TaskScheduling/InterFace/InterFaceSet.aspx @@ -120,7 +120,7 @@ Date: Thu, 25 Jan 2024 17:24:20 +0800 Subject: [PATCH 2/5] =?UTF-8?q?20240125=E6=9C=AC=E9=83=A8=E6=A3=80?= =?UTF-8?q?=E6=9F=A5=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../OfficeCheck/Check/CheckNoticeService.cs | 97 +++++++++------ .../Check/CheckReportItemService.cs | 11 +- .../OfficeCheck/Check/CheckReportService.cs | 12 +- .../ProjectSupervision_RectifyItemService.cs | 11 +- .../ProjectSupervision_RectifyService.cs | 13 +- SGGL/FineUIPro.Web/FineUIPro.Web.csproj | 2 +- .../FineUIPro.Web/HSSE/Check/OfficeCheck.aspx | 41 ++++++- .../HSSE/Check/OfficeCheck.aspx.cs | 60 ++++++--- .../HSSE/Check/OfficeCheck.aspx.designer.cs | 42 +++++-- .../OfficeCheck/Check/CheckInfo.aspx.cs | 59 ++++++--- .../OfficeCheck/Check/CheckNotice.aspx | 4 +- .../OfficeCheck/Check/RectifyEdit.aspx | 13 +- .../OfficeCheck/Check/RectifyEdit.aspx.cs | 115 ++++++++++++------ .../Check/RectifyEdit.aspx.designer.cs | 77 +++++++----- 14 files changed, 381 insertions(+), 176 deletions(-) diff --git a/SGGL/BLL/OfficeCheck/Check/CheckNoticeService.cs b/SGGL/BLL/OfficeCheck/Check/CheckNoticeService.cs index 4738fca9..dde84109 100644 --- a/SGGL/BLL/OfficeCheck/Check/CheckNoticeService.cs +++ b/SGGL/BLL/OfficeCheck/Check/CheckNoticeService.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using NPOI.SS.Formula; +using System.Collections.Generic; using System.Linq; namespace BLL @@ -96,19 +97,34 @@ namespace BLL /// public static void DeleteCheckNoticeByCheckNoticeId(string checkNoticeId) { - Model.ProjectSupervision_CheckNotice checkNotice = Funs.DB.ProjectSupervision_CheckNotice.FirstOrDefault(e => e.CheckNoticeId == checkNoticeId); - if (checkNotice != null) + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) { - var checkTeams = from x in Funs.DB.ProjectSupervision_CheckTeam where x.CheckNoticeId == checkNoticeId select x; - if (checkTeams.Count() > 0) + var checkNotice = db.ProjectSupervision_CheckNotice.FirstOrDefault(e => e.CheckNoticeId == checkNoticeId); + if (checkNotice != null) { - foreach (var item in checkTeams) + var checkTeams = from x in db.ProjectSupervision_CheckTeam where x.CheckNoticeId == checkNoticeId select x; + if (checkTeams.Count() > 0) { - BLL.CheckTeamService.DeleteCheckTeamByCheckTeamId(item.CheckTeamId); + db.ProjectSupervision_CheckTeam.DeleteAllOnSubmit(checkTeams); } + + var getCheck1 = from x in db.ProjectSupervision_Check1 where x.CheckNoticeId == checkNoticeId select x; + if (getCheck1.Count() > 0) + { + db.ProjectSupervision_Check1.DeleteAllOnSubmit(getCheck1); + } + + var getCheckTable1 = from x in db.ProjectSupervision_CheckTable1 where x.CheckNoticeId == checkNoticeId select x; + if (getCheckTable1.Count() > 0) + { + db.ProjectSupervision_CheckTable1.DeleteAllOnSubmit(getCheckTable1); + } + + CheckReportService.DeleteCheckReportByCheckNoticeId(checkNoticeId); + ProjectSupervision_RectifyService.DeleteRectifyByCheckNoticeId(checkNoticeId); + db.ProjectSupervision_CheckNotice.DeleteOnSubmit(checkNotice); + db.SubmitChanges(); } - Funs.DB.ProjectSupervision_CheckNotice.DeleteOnSubmit(checkNotice); - Funs.DB.SubmitChanges(); } } @@ -119,44 +135,47 @@ namespace BLL /// public static List GetCheckInfoList(string unitId, string userId, string roleId) { - List checkInfoLists = new List(); - var role = BLL.RoleService.GetRoleByRoleId(roleId); - if (userId == BLL.Const.sysglyId || (BLL.CommonService.IsMainUnitOrAdmin(unitId) && role != null)) + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) { - checkInfoLists = (from x in Funs.DB.ProjectSupervision_CheckNotice orderby x.CheckStartTime select x).ToList(); - } - else - { - var checkInfoIdList = (from x in Funs.DB.ProjectSupervision_CheckTeam - where x.UserId == userId && x.UnitId == unitId - select x.CheckNoticeId).Distinct().ToList(); - if (checkInfoIdList.Count() > 0) + List checkInfoLists = new List(); + var role = BLL.RoleService.GetRoleByRoleId(roleId); + if (userId == BLL.Const.sysglyId || (BLL.CommonService.IsMainUnitOrAdmin(unitId) && role != null)) { - checkInfoLists = (from x in Funs.DB.ProjectSupervision_CheckNotice - where checkInfoIdList.Contains(x.CheckNoticeId) - orderby x.CheckStartTime - select x).ToList(); + checkInfoLists = (from x in db.ProjectSupervision_CheckNotice orderby x.CheckStartTime select x).ToList(); } - - var checkInfoIdList1 = (from x in Funs.DB.ProjectSupervision_CheckNotice - where x.CompileMan == userId - orderby x.CheckStartTime - select x).ToList(); - if (checkInfoIdList1.Count() > 0) + else { - if (checkInfoLists.Count() > 0) + var checkInfoIdList = (from x in db.ProjectSupervision_CheckTeam + where x.UserId == userId && x.UnitId == unitId + select x.CheckNoticeId).Distinct().ToList(); + if (checkInfoIdList.Count() > 0) { - checkInfoLists.AddRange(checkInfoIdList1); + checkInfoLists = (from x in db.ProjectSupervision_CheckNotice + where checkInfoIdList.Contains(x.CheckNoticeId) + orderby x.CheckStartTime + select x).ToList(); } - else - { - checkInfoLists = checkInfoIdList1; - } - } - checkInfoLists = checkInfoLists.Distinct().ToList(); + var checkInfoIdList1 = (from x in db.ProjectSupervision_CheckNotice + where x.CompileMan == userId + orderby x.CheckStartTime + select x).ToList(); + if (checkInfoIdList1.Count() > 0) + { + if (checkInfoLists.Count() > 0) + { + checkInfoLists.AddRange(checkInfoIdList1); + } + else + { + checkInfoLists = checkInfoIdList1; + } + } + + checkInfoLists = checkInfoLists.Distinct().ToList(); + } + return checkInfoLists; } - return checkInfoLists; } #region 根据检查ID得到检查内容项 diff --git a/SGGL/BLL/OfficeCheck/Check/CheckReportItemService.cs b/SGGL/BLL/OfficeCheck/Check/CheckReportItemService.cs index 30e25805..2375b227 100644 --- a/SGGL/BLL/OfficeCheck/Check/CheckReportItemService.cs +++ b/SGGL/BLL/OfficeCheck/Check/CheckReportItemService.cs @@ -28,11 +28,14 @@ namespace BLL /// public static void DeleteCheckReportItemByCheckReportId(string checkReportId) { - var q = (from x in Funs.DB.ProjectSupervision_CheckReportItem where x.CheckReportId == checkReportId select x).ToList(); - if (q != null) + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) { - Funs.DB.ProjectSupervision_CheckReportItem.DeleteAllOnSubmit(q); - Funs.DB.SubmitChanges(); + var q = (from x in db.ProjectSupervision_CheckReportItem where x.CheckReportId == checkReportId select x).ToList(); + if (q != null) + { + db.ProjectSupervision_CheckReportItem.DeleteAllOnSubmit(q); + db.SubmitChanges(); + } } } } diff --git a/SGGL/BLL/OfficeCheck/Check/CheckReportService.cs b/SGGL/BLL/OfficeCheck/Check/CheckReportService.cs index 906ee3ce..338d9ed1 100644 --- a/SGGL/BLL/OfficeCheck/Check/CheckReportService.cs +++ b/SGGL/BLL/OfficeCheck/Check/CheckReportService.cs @@ -61,11 +61,15 @@ namespace BLL /// public static void DeleteCheckReportByCheckNoticeId(string checkNoticeId) { - Model.ProjectSupervision_CheckReport checkReport = Funs.DB.ProjectSupervision_CheckReport.FirstOrDefault(e => e.CheckNoticeId == checkNoticeId); - if (checkReport != null) + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) { - Funs.DB.ProjectSupervision_CheckReport.DeleteOnSubmit(checkReport); - Funs.DB.SubmitChanges(); + Model.ProjectSupervision_CheckReport checkReport = db.ProjectSupervision_CheckReport.FirstOrDefault(e => e.CheckNoticeId == checkNoticeId); + if (checkReport != null) + { + CheckReportItemService.DeleteCheckReportItemByCheckReportId(checkReport.CheckReportId); + db.ProjectSupervision_CheckReport.DeleteOnSubmit(checkReport); + db.SubmitChanges(); + } } } } diff --git a/SGGL/BLL/OfficeCheck/Check/ProjectSupervision_RectifyItemService.cs b/SGGL/BLL/OfficeCheck/Check/ProjectSupervision_RectifyItemService.cs index 221dafa2..4436d891 100644 --- a/SGGL/BLL/OfficeCheck/Check/ProjectSupervision_RectifyItemService.cs +++ b/SGGL/BLL/OfficeCheck/Check/ProjectSupervision_RectifyItemService.cs @@ -36,11 +36,14 @@ namespace BLL public static void DeleteRectifyItemByRectifyId(string rectifyId) { - var q = (from x in Funs.DB.ProjectSupervision_RectifyItem where x.RectifyId == rectifyId select x).ToList(); - if (q != null) + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) { - Funs.DB.ProjectSupervision_RectifyItem.DeleteAllOnSubmit(q); - Funs.DB.SubmitChanges(); + var q = (from x in db.ProjectSupervision_RectifyItem where x.RectifyId == rectifyId select x).ToList(); + if (q != null) + { + db.ProjectSupervision_RectifyItem.DeleteAllOnSubmit(q); + db.SubmitChanges(); + } } } diff --git a/SGGL/BLL/OfficeCheck/Check/ProjectSupervision_RectifyService.cs b/SGGL/BLL/OfficeCheck/Check/ProjectSupervision_RectifyService.cs index 338c802f..3c539049 100644 --- a/SGGL/BLL/OfficeCheck/Check/ProjectSupervision_RectifyService.cs +++ b/SGGL/BLL/OfficeCheck/Check/ProjectSupervision_RectifyService.cs @@ -75,13 +75,16 @@ namespace BLL /// public static void DeleteRectifyByCheckNoticeId(string checkNoticeId) { - Model.ProjectSupervision_Rectify newRectify = Funs.DB.ProjectSupervision_Rectify.FirstOrDefault(e => e.CheckNoticeId == checkNoticeId); - if (newRectify != null) + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) { - Funs.DB.ProjectSupervision_Rectify.DeleteOnSubmit(newRectify); - Funs.DB.SubmitChanges(); + var newRectify = db.ProjectSupervision_Rectify.FirstOrDefault(e => e.CheckNoticeId == checkNoticeId); + if (newRectify != null) + { + ProjectSupervision_RectifyItemService.DeleteRectifyItemByRectifyId(newRectify.RectifyId); + db.ProjectSupervision_Rectify.DeleteOnSubmit(newRectify); + db.SubmitChanges(); + } } - } } } diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj index a85d8861..8299ad1e 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj @@ -14435,7 +14435,7 @@ True 0 / - http://localhost:2828/ + http://localhost:14574/ False False diff --git a/SGGL/FineUIPro.Web/HSSE/Check/OfficeCheck.aspx b/SGGL/FineUIPro.Web/HSSE/Check/OfficeCheck.aspx index 6c71a848..a7faddac 100644 --- a/SGGL/FineUIPro.Web/HSSE/Check/OfficeCheck.aspx +++ b/SGGL/FineUIPro.Web/HSSE/Check/OfficeCheck.aspx @@ -17,15 +17,16 @@ - - - + + + @@ -34,6 +35,12 @@ + + + @@ -52,6 +59,10 @@ + + + + @@ -59,6 +70,26 @@ Target="Parent" EnableResize="false" runat="server" IsModal="true" Width="700px" Height="500px"> + + + + + + + diff --git a/SGGL/FineUIPro.Web/HSSE/Check/OfficeCheck.aspx.cs b/SGGL/FineUIPro.Web/HSSE/Check/OfficeCheck.aspx.cs index 712b754d..c4a06e2e 100644 --- a/SGGL/FineUIPro.Web/HSSE/Check/OfficeCheck.aspx.cs +++ b/SGGL/FineUIPro.Web/HSSE/Check/OfficeCheck.aspx.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; using System.Data; using System.Data.SqlClient; +using System.Linq; namespace FineUIPro.Web.HSSE.Check { @@ -21,22 +22,16 @@ namespace FineUIPro.Web.HSSE.Check /// public void BindGrid() { - string strSql = @"SELECT Item.RectifyItemId, - Item.RectifyId, - Item.WrongContent, - Item.Requirement, - Item.LimitTime, - Item.RectifyResults, - Item.IsRectify, - Rectify.States, - Rectify.ProjectId " - + @" FROM ProjectSupervision_RectifyItem AS Item " - + @" LEFT JOIN ProjectSupervision_Rectify AS Rectify ON Rectify.RectifyId=Item.RectifyId"; + string strSql = @"SELECT (CASE WHEN Rectify.States=1 THEN '待整改' WHEN Rectify.States=2 THEN '待确认' WHEN Rectify.States=3 THEN '已完成' ELSE '待签发' END) AS StatesName, + Rectify.RectifyCode,Item.RectifyItemId,Item.RectifyId,Item.WrongContent,Item.Requirement,Item.LimitTime,Item.RectifyResults,Item.IsRectify,Rectify.States,Rectify.ProjectId + FROM ProjectSupervision_RectifyItem AS Item + LEFT JOIN ProjectSupervision_Rectify AS Rectify ON Rectify.RectifyId=Item.RectifyId + WHERE Rectify.States !='0' AND Rectify.States IS NOT NULL "; List listStr = new List(); - strSql += " WHERE Rectify.ProjectId = @ProjectId"; - strSql += " AND Rectify.States = @States"; + strSql += " AND Rectify.ProjectId = @ProjectId"; + strSql += " AND Item.IsRectify = @IsRectify"; listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId)); - listStr.Add(new SqlParameter("@States", this.rbStates.SelectedValue)); + listStr.Add(new SqlParameter("@IsRectify", this.rbStates.SelectedValue)); SqlParameter[] parameter = listStr.ToArray(); DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); var table = this.GetPagedDataTable(Grid1, tb); @@ -52,6 +47,14 @@ namespace FineUIPro.Web.HSSE.Check protected void rbStates_SelectedIndexChanged(object sender, EventArgs e) { BindGrid(); + if (this.rbStates.SelectedValue == "1") + { + this.btnSubmit.Hidden = true; + } + else + { + this.btnSubmit.Hidden = false; + } } /// @@ -95,5 +98,34 @@ namespace FineUIPro.Web.HSSE.Check } } } + + /// + /// + /// + /// + /// + protected void btnSubmit_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length > 0) + { + foreach (int rowIndex in Grid1.SelectedRowIndexArray) + { + string rowID = Grid1.DataKeys[rowIndex][0].ToString().Split(',')[0]; + var getV = Funs.DB.ProjectSupervision_RectifyItem.FirstOrDefault(x => x.RectifyItemId == rowID); + if (getV != null) + { + var getR = Funs.DB.ProjectSupervision_Rectify.FirstOrDefault(x => x.RectifyId == getV.RectifyId); + if (getR != null && getR.States != Const.State_3) + { + getR.States = BLL.Const.State_2; + Funs.DB.SubmitChanges(); + } + } + } + + BindGrid(); + ShowNotify("数据已提交成功!"); + } + } } } \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/HSSE/Check/OfficeCheck.aspx.designer.cs b/SGGL/FineUIPro.Web/HSSE/Check/OfficeCheck.aspx.designer.cs index b87f765c..cdf4faec 100644 --- a/SGGL/FineUIPro.Web/HSSE/Check/OfficeCheck.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/HSSE/Check/OfficeCheck.aspx.designer.cs @@ -7,11 +7,13 @@ // //------------------------------------------------------------------------------ -namespace FineUIPro.Web.HSSE.Check { - - - public partial class OfficeCheck { - +namespace FineUIPro.Web.HSSE.Check +{ + + + public partial class OfficeCheck + { + /// /// form1 控件。 /// @@ -20,7 +22,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.HtmlControls.HtmlForm form1; - + /// /// PageManager1 控件。 /// @@ -29,7 +31,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.PageManager PageManager1; - + /// /// Panel1 控件。 /// @@ -38,7 +40,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Panel Panel1; - + /// /// Grid1 控件。 /// @@ -47,7 +49,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Grid Grid1; - + /// /// Toolbar1 控件。 /// @@ -56,7 +58,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Toolbar Toolbar1; - + /// /// rbStates 控件。 /// @@ -65,7 +67,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.RadioButtonList rbStates; - + /// /// WindowAtt 控件。 /// @@ -74,5 +76,23 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Window WindowAtt; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + + /// + /// btnSubmit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnSubmit; } } diff --git a/SGGL/FineUIPro.Web/OfficeCheck/Check/CheckInfo.aspx.cs b/SGGL/FineUIPro.Web/OfficeCheck/Check/CheckInfo.aspx.cs index 5ad4439b..bb0482b5 100644 --- a/SGGL/FineUIPro.Web/OfficeCheck/Check/CheckInfo.aspx.cs +++ b/SGGL/FineUIPro.Web/OfficeCheck/Check/CheckInfo.aspx.cs @@ -187,6 +187,18 @@ namespace FineUIPro.Web.OfficeCheck.Check /// private void PageInfoLoad() { + this.drpSubjectUnit.Text = string.Empty; + this.txtSubjectUnitMan.Text = string.Empty; + this.txtSubjectUnitTel.Text = string.Empty; + this.txtSubjectUnitAdd.Text = string.Empty; + this.txtCheckStartTime.Text = string.Empty; + this.txtCheckEndTime.Text = string.Empty; + this.txtCompileMan.Text = string.Empty; + this.txtCompileDate.Text = string.Empty; + this.lblResult.Text = string.Empty; + this.lblCheckReportResult.Text = string.Empty; + this.lblCheckResult.Text = string.Empty; + var checkInfo = BLL.CheckNoticeService.GetCheckNoticeById(this.CheckNoticeId); if (checkInfo != null) { @@ -208,41 +220,50 @@ namespace FineUIPro.Web.OfficeCheck.Check var checkTable = BLL.CheckTable1Service.GetCheckTable1ByCheckNoticeId(this.CheckNoticeId); if (checkTable != null) { - // this.lblSubjectUnitId.Text = BLL.ProjectService.GetProjectNameByProjectId(checkTable.SubjectProjectId); - // this.lblCheckDate.Text = string.Format("{0:yyyy-MM-dd}", checkTable.CheckDate); + // this.lblSubjectUnitId.Text = BLL.ProjectService.GetProjectNameByProjectId(checkTable.SubjectProjectId); + // this.lblCheckDate.Text = string.Format("{0:yyyy-MM-dd}", checkTable.CheckDate); this.lblResult.Text = "评定得分:" + checkTable.TotalLastScore + ";评定结果:" + checkTable.EvaluationResult; } //检查报告 var checkReport = BLL.CheckReportService.GetCheckReportByCheckNoticeId(this.CheckNoticeId); if (checkReport != null) { - // this.lblCheckObject.Text = BLL.ProjectService.GetProjectNameByProjectId(checkInfo.SubjectProjectId); - // this.lblCheckStartTime.Text = string.Format("{0:yyyy-MM-dd}", checkInfo.CheckStartTime); + // this.lblCheckObject.Text = BLL.ProjectService.GetProjectNameByProjectId(checkInfo.SubjectProjectId); + // this.lblCheckStartTime.Text = string.Format("{0:yyyy-MM-dd}", checkInfo.CheckStartTime); this.lblCheckReportResult.Text = checkReport.CheckResult; } //隐患整改 var rectify = BLL.ProjectSupervision_RectifyService.GetRectifyByCheckNoticeId(this.CheckNoticeId); if (rectify != null) { - // this.lblUnitId.Text = BLL.ProjectService.GetProjectNameByProjectId(rectify.ProjectId); - // this.lblCheckedDate.Text = string.Format("{0:yyyy-MM-dd}", rectify.CheckedDate); + string stateText = "【待提交】"; + if (rectify.States == Const.State_2) + { + stateText = "【待复查确认】"; + } + else if (rectify.States == Const.State_1) + { + stateText = "【待项目整改】"; + } + else if (rectify.States == Const.State_0) + { + stateText = "【待签发】"; + } + else if (rectify.States == Const.State_3) + { + stateText = "【整改完成】"; + } + // this.lblUnitId.Text = BLL.ProjectService.GetProjectNameByProjectId(rectify.ProjectId); + // this.lblCheckedDate.Text = string.Format("{0:yyyy-MM-dd}", rectify.CheckedDate); var item = BLL.ProjectSupervision_RectifyItemService.GetRectifyItemByRectifyId(rectify.RectifyId); if (item != null) { - this.lblCheckResult.Text = "隐患:" + item.Count() + "条"; + this.lblCheckResult.Text = "隐患:" + item.Count() + "条。单据状态:" + stateText; } } } else { - this.drpSubjectUnit.Text = string.Empty; - this.txtSubjectUnitMan.Text = string.Empty; - this.txtSubjectUnitTel.Text = string.Empty; - this.txtSubjectUnitAdd.Text = string.Empty; - this.txtCheckStartTime.Text = string.Empty; - this.txtCheckEndTime.Text = string.Empty; - this.txtCompileMan.Text = string.Empty; - this.txtCompileDate.Text = string.Empty; this.CheckNoticeId = string.Empty; } } @@ -357,6 +378,14 @@ namespace FineUIPro.Web.OfficeCheck.Check protected void btnCheck2_Click(object sender, EventArgs e) { string window = String.Format("RectifyEdit.aspx?CheckNoticeId={0}", this.CheckNoticeId, "编辑 - "); + var getCheckNotice = CheckNoticeService.GetCheckNoticeById(this.CheckNoticeId); + var getRectify = ProjectSupervision_RectifyService.GetRectifyByCheckNoticeId(this.CheckNoticeId); + if (getRectify != null && getRectify.States != "0" && !string.IsNullOrEmpty(getRectify.States)) + { + window = String.Format("RectifyEdit.aspx?CheckNoticeId={0}&type=1", this.CheckNoticeId, "编辑 - "); + PageContext.RegisterStartupScript(Window2.GetShowReference(window)); + } + PageContext.RegisterStartupScript(Window2.GetShowReference(window)); } diff --git a/SGGL/FineUIPro.Web/OfficeCheck/Check/CheckNotice.aspx b/SGGL/FineUIPro.Web/OfficeCheck/Check/CheckNotice.aspx index e07a912f..1df9a507 100644 --- a/SGGL/FineUIPro.Web/OfficeCheck/Check/CheckNotice.aspx +++ b/SGGL/FineUIPro.Web/OfficeCheck/Check/CheckNotice.aspx @@ -162,11 +162,11 @@ <%--