diff --git a/DataBase/版本日志/SGGLDB_WH_2023-09-18.sql b/DataBase/版本日志/SGGLDB_WH_2023-09-18.sql new file mode 100644 index 00000000..7d7c6905 Binary files /dev/null and b/DataBase/版本日志/SGGLDB_WH_2023-09-18.sql differ diff --git a/SGGL/BLL/HSSE/Check/Check_ProjectCheckItemSetService.cs b/SGGL/BLL/HSSE/Check/Check_ProjectCheckItemSetService.cs index ed18e1b8..381f4147 100644 --- a/SGGL/BLL/HSSE/Check/Check_ProjectCheckItemSetService.cs +++ b/SGGL/BLL/HSSE/Check/Check_ProjectCheckItemSetService.cs @@ -62,36 +62,42 @@ namespace BLL string type = string.Empty; if (CheckItem != null) { - Model.Check_ProjectCheckItemDetail detail = BLL.Check_ProjectCheckItemDetailService.GetCheckItemDetailById(CheckItem.ToString()); + //Model.Check_ProjectCheckItemDetail detail = BLL.Check_ProjectCheckItemDetailService.GetCheckItemDetailById(CheckItem.ToString()); + + //修改为项目安全检查项 + Model.Technique_CheckItemSet detail = Funs.DB.Technique_CheckItemSet.FirstOrDefault(x => x.CheckItemSetId == CheckItem.ToString()); + if (detail != null) { - Model.Check_ProjectCheckItemSet item = BLL.Check_ProjectCheckItemSetService.GetCheckItemSetById(detail.CheckItemSetId); - if (item != null) - { - if (item.SupCheckItem == "0") - { - type = item.CheckItemName; - } - else - { - type = BLL.Check_ProjectCheckItemSetService.GetCheckItemNameBySupCheckItem(item.SupCheckItem); - } - } + type = detail.CheckItemName; + //Model.Check_ProjectCheckItemSet item = BLL.Check_ProjectCheckItemSetService.GetCheckItemSetById(detail.CheckItemSetId); + //if (item != null) + //{ + // if (item.SupCheckItem == "0") + // { + // type = item.CheckItemName; + // } + // else + // { + // type = BLL.Check_ProjectCheckItemSetService.GetCheckItemNameBySupCheckItem(item.SupCheckItem); + // } + //} } else { - Model.Check_ProjectCheckItemSet item = BLL.Check_ProjectCheckItemSetService.GetCheckItemSetById(CheckItem.ToString()); - if (item != null) - { - if (item.SupCheckItem == "0") - { - type = item.CheckItemName; - } - else - { - type = BLL.Check_ProjectCheckItemSetService.GetCheckItemNameBySupCheckItem(item.SupCheckItem); - } - } + type = "季节性/节假日检查(无类型)"; + //Model.Check_ProjectCheckItemSet item = BLL.Check_ProjectCheckItemSetService.GetCheckItemSetById(CheckItem.ToString()); + //if (item != null) + //{ + // if (item.SupCheckItem == "0") + // { + // type = item.CheckItemName; + // } + // else + // { + // type = BLL.Check_ProjectCheckItemSetService.GetCheckItemNameBySupCheckItem(item.SupCheckItem); + // } + //} } } return type; diff --git a/SGGL/BLL/HSSE/Manager/HSSELogService.cs b/SGGL/BLL/HSSE/Manager/HSSELogService.cs index 4c1d448e..690f45be 100644 --- a/SGGL/BLL/HSSE/Manager/HSSELogService.cs +++ b/SGGL/BLL/HSSE/Manager/HSSELogService.cs @@ -988,7 +988,7 @@ namespace BLL /// /// /// - public static List getHSSELogDataList(string projectId, string userId) + public static List getHSSELogDataList(string projectId, string userId,string CompileMan,string CompileDate) { using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) { @@ -1017,6 +1017,15 @@ namespace BLL getInfoList = getInfoList.Where(x => x.CompileMan == userId).ToList(); } } + if (!string.IsNullOrEmpty(CompileMan)) + { + getInfoList = getInfoList.Where(x => x.CompileMan == CompileMan).ToList(); + } + if (!string.IsNullOrEmpty(CompileDate)) + { + getInfoList = getInfoList.Where(x => x.CompileDate == CompileDate).ToList(); + } + return getInfoList; } } @@ -1043,33 +1052,117 @@ namespace BLL WeatherName = z.ConstText, - Num11=x.Num11, - Contents12=x.Contents12, - Contents13=x.Contents13, - Contents21=x.Contents21, - Num21=x.Num21, - Contents22=x.Contents22, - Num22=x.Num22, - Contents23=x.Contents23, - Num23=x.Num23, - Contents24=x.Contents24, - Num24=x.Num24, - Contents210=x.Contents210, - Num210=x.Num210, - Num211=x.Num211, - Contents31=x.Contents31, - Num31=x.Num31, - Contents32=x.Contents32, - Num32=x.Num32, - Contents41=x.Contents41, - Contents42=x.Contents42 + Content1 = x.Num11.ToString(), + Content2= x.Contents12, + Content3= x.Contents13, + Content4= x.Contents21, + Content5= x.Num21.ToString(), + Content6= x.Contents22, + Content7 = x.Num22.ToString(), + Content8 = x.Contents23, + Content9 = x.Num23.ToString(), + Content10 = x.Contents24, + Content11 = x.Num24.ToString(), + Content12 = x.Contents210, + Content13 = x.Num210.ToString(), + Content14 = x.Num211.ToString(), + Content15 = x.Contents31, + Content16 = x.Num31.ToString(), + Content17 = x.Contents32, + Content18 = x.Num32.ToString(), + Content19 = x.Contents41, + Content20 = x.Contents42 }).FirstOrDefault(); return model; } } - + /// + /// 增加HSSE日志暨管理数据收集 + /// + /// HSSE日志暨管理数据收集实体 + public static void AddHSSELogApi(Model.HSSELogItem HSSELog) + { + Model.Manager_HSSELog newHSSELog = new Model.Manager_HSSELog + { + HSSELogId = HSSELog.HSSELogId, + ProjectId = HSSELog.ProjectId, + CompileDate = Convert.ToDateTime(HSSELog.CompileDate), + CompileMan = HSSELog.CompileMan, + Weather = HSSELog.Weather, + IsVisible = HSSELog.IsVisible, + Num11 = Convert.ToInt32(HSSELog.Content1), + Contents12 = HSSELog.Content2, + Contents13 = HSSELog.Content3, + Contents21 = HSSELog.Content4, + Num21 = Convert.ToInt32(HSSELog.Content5), + Contents22 = HSSELog.Content6, + Num22 = Convert.ToInt32(HSSELog.Content7), + Contents23 = HSSELog.Content8, + Num23 = Convert.ToInt32(HSSELog.Content9), + Contents24 = HSSELog.Content10, + Num24 = Convert.ToInt32(HSSELog.Content11), + + Contents210 = HSSELog.Content12, + Num210 = Convert.ToInt32(HSSELog.Content13), + Num211 = Convert.ToInt32(HSSELog.Content14), + Contents31 = HSSELog.Content15, + Num31 = Convert.ToInt32(HSSELog.Content16), + Contents32 = HSSELog.Content17, + Num32 = Convert.ToInt32(HSSELog.Content18), + + Contents41 = HSSELog.Content19, + Contents42 = HSSELog.Content20 + }; + Funs.DB.Manager_HSSELog.InsertOnSubmit(newHSSELog); + Funs.DB.SubmitChanges(); + } + + /// + /// 修改HSSE日志暨管理数据收集 + /// + /// + public static void UpdateHSSELogApi(Model.HSSELogItem updateHSSELog) + { + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + Model.Manager_HSSELog newHSSELog = db.Manager_HSSELog.FirstOrDefault(e => e.HSSELogId == updateHSSELog.HSSELogId); + if (newHSSELog != null) + { + newHSSELog.CompileDate = Convert.ToDateTime(updateHSSELog.CompileDate); + newHSSELog.CompileMan = updateHSSELog.CompileMan; + newHSSELog.Weather = updateHSSELog.Weather; + newHSSELog.IsVisible = updateHSSELog.IsVisible; + + newHSSELog.Num11 = Convert.ToInt32(updateHSSELog.Content1); + newHSSELog.Contents12 = updateHSSELog.Content2; + newHSSELog.Contents13 = updateHSSELog.Content3; + newHSSELog.Contents21 = updateHSSELog.Content4; + newHSSELog.Num21 = Convert.ToInt32(updateHSSELog.Content5); + newHSSELog.Contents22 = updateHSSELog.Content6; + newHSSELog.Num22 = Convert.ToInt32(updateHSSELog.Content7); + newHSSELog.Contents23 = updateHSSELog.Content8; + newHSSELog.Num23 = Convert.ToInt32(updateHSSELog.Content9); + newHSSELog.Contents24 = updateHSSELog.Content10; + newHSSELog.Num24 = Convert.ToInt32(updateHSSELog.Content11); + + newHSSELog.Contents210 = updateHSSELog.Content12; + newHSSELog.Num210 = Convert.ToInt32(updateHSSELog.Content13); + newHSSELog.Num211 = Convert.ToInt32(updateHSSELog.Content14); + newHSSELog.Contents31 = updateHSSELog.Content15; + newHSSELog.Num31 = Convert.ToInt32(updateHSSELog.Content16); + newHSSELog.Contents32 = updateHSSELog.Content17; + newHSSELog.Num32 = Convert.ToInt32(updateHSSELog.Content18); + + newHSSELog.Contents41 = updateHSSELog.Content19; + newHSSELog.Contents42 = updateHSSELog.Content20; + db.SubmitChanges(); + } + } + } + + #endregion } } diff --git a/SGGL/FineUIPro.Web/ZHGL/InspectionSummary/InspectionSummary.aspx.cs b/SGGL/FineUIPro.Web/ZHGL/InspectionSummary/InspectionSummary.aspx.cs index 93fa7ba8..8968a929 100644 --- a/SGGL/FineUIPro.Web/ZHGL/InspectionSummary/InspectionSummary.aspx.cs +++ b/SGGL/FineUIPro.Web/ZHGL/InspectionSummary/InspectionSummary.aspx.cs @@ -137,6 +137,8 @@ namespace FineUIPro.Web.ZHGL.InspectionSummary public string ProjectId { get; set; } public DateTime? Mdate { get; set; } + + public string state { get; set; } } #region 生成按钮 @@ -171,7 +173,8 @@ namespace FineUIPro.Web.ZHGL.InspectionSummary { ProblemTypes = x.ProblemTypes, ProjectId = x.ProjectId, - CheckTime=x.CheckTime + CheckTime=x.CheckTime, + States=x.States }).Where(x => x.ProblemTypes == "1").ToList(); //周例会 var list3 = Funs.DB.Meeting_WeekMeeting.Select(x=>new ProjectIdAndDate { ProjectId=x.ProjectId, Mdate = x.WeekMeetingDate }).ToList(); @@ -196,7 +199,7 @@ namespace FineUIPro.Web.ZHGL.InspectionSummary var list7 = Funs.DB.Manager_MonthReportC.Select(x=> new ProjectIdAndDate { ProjectId=x.ProjectId, Mdate = x.Months }).ToList(); //质量巡检 - var list8 = Funs.DB.Check_CheckControl.Select(x=>new ProjectIdAndDate { ProjectId=x.ProjectId, Mdate = x.CheckDate }).ToList(); + var list8 = Funs.DB.Check_CheckControl.Select(x=>new ProjectIdAndDate { ProjectId=x.ProjectId, Mdate = x.CheckDate,state=x.State }).ToList(); //设备材料报验 var list10 = Funs.DB.Comprehensive_InspectionEquipment.Select @@ -335,6 +338,21 @@ namespace FineUIPro.Web.ZHGL.InspectionSummary allList.Add(model); + //安全巡检已闭合 + model = new Inspection_Summary(); + model.ProjectId = pid; + model.CompileDateMonth = this.drpCompileDateMonth.Text.Trim(); + model.InspectionSummaryId = Guid.NewGuid().ToString(); + model.InspectionSummaryMbId = "28"; + AqxjCount = list2.Where(x => x.ProjectId == pid && x.States=="3").ToList().Count(); + model.SummeryResult = AqxjCount.ToString(); + //时间 + if (AqxjCount > 0) + { + model.CompileDate = list2.Where(x => x.ProjectId == pid).OrderByDescending(x => x.CheckTime).FirstOrDefault().CheckTime; + } + + allList.Add(model); //周例会 model = new Inspection_Summary(); @@ -437,6 +455,23 @@ namespace FineUIPro.Web.ZHGL.InspectionSummary } allList.Add(model); + //质量巡检已闭合项 + model = new Inspection_Summary(); + model.ProjectId = pid; + model.CompileDate = DateTime.Now; + model.CompileDateMonth = this.drpCompileDateMonth.Text.Trim(); + model.InspectionSummaryId = Guid.NewGuid().ToString(); + model.InspectionSummaryMbId = "29"; + //已闭合 + ZlxjCount = list8.Where(x => x.ProjectId == pid&&x.state=="7").ToList().Count; + model.SummeryResult = ZlxjCount.ToString(); + if (ZlxjCount > 0) + { + //巡检日期 + model.CompileDate = list8.Where(x => x.ProjectId == pid).OrderByDescending(x => x.Mdate).FirstOrDefault().Mdate; + } + allList.Add(model); + //WBS数据 model = new Inspection_Summary(); model.ProjectId = pid; diff --git a/SGGL/Model/APIItem/HSSE/HSSELogItem.cs b/SGGL/Model/APIItem/HSSE/HSSELogItem.cs index 8aa16960..9083866d 100644 --- a/SGGL/Model/APIItem/HSSE/HSSELogItem.cs +++ b/SGGL/Model/APIItem/HSSE/HSSELogItem.cs @@ -43,5 +43,28 @@ namespace Model public int? Num32 { get; set; } public string Contents41 { get; set; } public string Contents42 { get; set; } + + #region 添加修改时字段 + public string Content1 { get; set; } + public string Content2 { get; set; } + public string Content3 { get; set; } + public string Content4 { get; set; } + public string Content5 { get; set; } + public string Content6 { get; set; } + public string Content7 { get; set; } + public string Content8 { get; set; } + public string Content9 { get; set; } + public string Content10 { get; set; } + public string Content11 { get; set; } + public string Content12 { get; set; } + public string Content13 { get; set; } + public string Content14 { get; set; } + public string Content15 { get; set; } + public string Content16 { get; set; } + public string Content17 { get; set; } + public string Content18 { get; set; } + public string Content19 { get; set; } + public string Content20 { get; set; } + #endregion } } diff --git a/SGGL/WebAPI/Controllers/HSSE/HSSELogController.cs b/SGGL/WebAPI/Controllers/HSSE/HSSELogController.cs index a9642904..e1064260 100644 --- a/SGGL/WebAPI/Controllers/HSSE/HSSELogController.cs +++ b/SGGL/WebAPI/Controllers/HSSE/HSSELogController.cs @@ -18,12 +18,12 @@ namespace WebAPI.Controllers.HSSE /// /// /// - public Model.ResponeData getHSSELogDataList( string projectId, string userId, int pageIndex=0) + public Model.ResponeData getHSSELogDataList( string projectId, string userId,string CompileDate="",string CompileMan="", int pageIndex=0) { var responeData = new Model.ResponeData(); try { - var getDataList = HSSELogService.getHSSELogDataList(projectId, userId); + var getDataList = HSSELogService.getHSSELogDataList(projectId, userId, CompileMan, CompileDate); int pageCount = getDataList.Count; if (pageCount > 0 && pageIndex > 0) { @@ -86,7 +86,7 @@ namespace WebAPI.Controllers.HSSE /// /// 作业票记录 [HttpPost] - public Model.ResponeData SaveHSSELogData([FromBody] Model.Manager_HSSELog HSSELog) + public Model.ResponeData SaveHSSELogData([FromBody] Model.HSSELogItem HSSELog) { var responeData = new Model.ResponeData(); HSSELog.IsVisible = true; @@ -94,13 +94,13 @@ namespace WebAPI.Controllers.HSSE { if (!string.IsNullOrEmpty(HSSELog.HSSELogId)) { - BLL.HSSELogService.UpdateHSSELog(HSSELog); + BLL.HSSELogService.UpdateHSSELogApi(HSSELog); responeData.message = "修改成功"; } else { HSSELog.HSSELogId = SQLHelper.GetNewID(typeof(Model.Manager_HSSELog)); - BLL.HSSELogService.AddHSSELog(HSSELog); + BLL.HSSELogService.AddHSSELogApi(HSSELog); responeData.message = "保存成功"; }