From b0898907eba156ff0bda39bd9bfceea1ef3dae35 Mon Sep 17 00:00:00 2001 From: geh <1923421292@qq.com> Date: Tue, 28 Oct 2025 17:20:48 +0800 Subject: [PATCH] 1 --- SGGL/BLL/JDGL/SGManPower/SGManPowerService.cs | 184 ++++++++++++++---- .../CQMS/ManageReportNew/MonthReport.aspx.cs | 44 ++++- SGGL/FineUIPro.Web/FineUIPro.Web.csproj | 8 + .../JDGL/SGManPower/SGWarningDetails.aspx | 84 ++++++++ .../JDGL/SGManPower/SGWarningDetails.aspx.cs | 123 ++++++++++++ .../SGWarningDetails.aspx.designer.cs | 134 +++++++++++++ .../Controllers/JDGL/SGManPowerController.cs | 6 +- 7 files changed, 538 insertions(+), 45 deletions(-) create mode 100644 SGGL/FineUIPro.Web/JDGL/SGManPower/SGWarningDetails.aspx create mode 100644 SGGL/FineUIPro.Web/JDGL/SGManPower/SGWarningDetails.aspx.cs create mode 100644 SGGL/FineUIPro.Web/JDGL/SGManPower/SGWarningDetails.aspx.designer.cs diff --git a/SGGL/BLL/JDGL/SGManPower/SGManPowerService.cs b/SGGL/BLL/JDGL/SGManPower/SGManPowerService.cs index c9b5ee1f..3693673d 100644 --- a/SGGL/BLL/JDGL/SGManPower/SGManPowerService.cs +++ b/SGGL/BLL/JDGL/SGManPower/SGManPowerService.cs @@ -12,35 +12,39 @@ namespace BLL /// /// 检查并发送人力资源预警 /// - public static Model.ResponeData CheckAndSendPersonWarning() + public static List CheckAndSendPersonWarning(string userId) { var responeData = new Model.ResponeData(); // 合并两个集合 var allItems = new List(); var projects = Funs.DB.Base_Project.Where(p => p.ProjectState == BLL.Const.ProjectState_1).ToList(); - // foreach (var project in projects) - // { - // 检查管理人员到期未到岗情况 - var items1 = CheckManagerNotArrived("c7ade79e-7646-4c59-a8fd-020a7e3138c6"); - - // 检查作业人员人力偏差情况 - var items2 = CheckWorkerDeviation("c7ade79e-7646-4c59-a8fd-020a7e3138c6"); - - - if (items1 != null) + foreach (var project in projects) { - allItems.AddRange(items1); + // 检查管理人员到期未到岗情况 + var items1 = CheckManagerNotArrived(project.ProjectId); + + // 检查作业人员人力偏差情况 + var items2 = CheckWorkerDeviation(project.ProjectId); + + + if (items1 != null) + { + allItems.AddRange(items1); + } + + if (items2 != null) + { + allItems.AddRange(items2); + } } - if (items2 != null) + if (!string.IsNullOrEmpty(userId)) { - allItems.AddRange(items2); + //过滤出指定用户的数据 + allItems = allItems.Where(x => x.UserId == userId).ToList(); } - // } - responeData.data = allItems; - responeData.message = "人员预警"; - return responeData; + return allItems; } @@ -75,7 +79,8 @@ namespace BLL int num = getInOutRecordNum(data); if (data.Quantity > num) { - lItems = SendManagerWarning(data.UnitId, projectId, data.UnitWorkId, data.PlanDate, data.Quantity, num); + lItems = SendManagerWarning(data.UnitId, projectId, data.WorkPostId, data.UnitWorkId, data.PlanDate, + data.Quantity, num); } } @@ -145,7 +150,8 @@ namespace BLL } else { - dataSource = dataSource.Where(x => x["UnitWorkId"] != DBNull.Value && x["UnitWorkId"].ToString() == sgManPower.UnitWorkId); + dataSource = dataSource.Where(x => + x["UnitWorkId"] != DBNull.Value && x["UnitWorkId"].ToString() == sgManPower.UnitWorkId); } return dataSource.Count(); @@ -156,7 +162,8 @@ namespace BLL /// /// 项目ID /// 单位id - private static List SendManagerWarning(string unitId, string projectId, string unitWorkId, DateTime? planDate, int? quantity, int num) + private static List SendManagerWarning(string unitId, string projectId, string workPostId, + string unitWorkId, DateTime? planDate, int? quantity, int num) { // 发送预警信息 var toDoItems = new List(); @@ -242,26 +249,70 @@ namespace BLL string warningContent = string.Empty; if (unitWorks != null) { - warningContent = $"{projectUnits.UnitName}单位{unitWorks.UnitWorkName}装置计划{planDate}投入人力{quantity}人,实际考勤为{num}人。"; + warningContent = + $"{projectUnits.UnitName}单位{unitWorks.UnitWorkName}装置计划{string.Format("{0:yyyy-MM-dd}", planDate)}投入人力{quantity}人,实际考勤为{num}人。"; } else { - warningContent = $"{projectUnits.UnitName}单位计划{planDate}投入人力{quantity}人,实际考勤为{num}人。"; + warningContent = + $"{projectUnits.UnitName}单位计划{string.Format("{0:yyyy-MM-dd}", planDate)}投入人力{quantity}人,实际考勤为{num}人。"; } + string urlParams = "JDGL/SGManPower/SGWarningDetails.aspx?projectId=" + projectId; + // 添加单位参数(如果已选择) + if (!string.IsNullOrEmpty(unitId)) + { + urlParams += "&unitId=" + unitId; + } + + // 添加装置参数(如果已选择) + if (!string.IsNullOrEmpty(unitWorkId)) + { + urlParams += "&unitWorkId=" + unitWorkId; + } + + // 添加岗位参数(如果已选择) + if (!string.IsNullOrEmpty(workPostId)) + { + urlParams += "&workPostId=" + workPostId; + } + + // 添加时间参数 + if (planDate.HasValue) + { + urlParams += "&planDate=" + string.Format("{0:yyyy-MM-dd}", planDate); + } + + // 添加岗位参数(如果已选择) + if (quantity.HasValue) + { + urlParams += "&quantity=" + quantity.Value; + } + + // 添加岗位参数(如果已选择) + if (num >= 0) + { + urlParams += "&num=" + num; + } + else + { + urlParams += "&num=0"; + } + + foreach (var userId in toUserIds) { Model.ToDoItem toDoItem = new Model.ToDoItem(); toDoItem.DataId = SQLHelper.GetNewID(typeof(Model.ToDoItem)); toDoItem.MenuId = ""; toDoItem.MenuName = "管理人员到岗预警"; + toDoItem.ProjectCode = ""; toDoItem.Content = warningContent; toDoItem.UserId = userId; toDoItem.UserName = UserService.GetUserNameByUserId(userId); toDoItem.DataTime = DateTime.Now; toDoItem.DataTimeStr = DateTime.Now.ToString("yyyy-MM-dd"); - toDoItem.PCUrl = ""; - toDoItem.UrlStr = "pages/exam/examjs"; + toDoItem.PCUrl = urlParams; toDoItems.Add(toDoItem); } } @@ -284,12 +335,16 @@ namespace BLL version = sgMan.Version; } + //当前时间 + var endDate = DateTime.Now; + //当前时间前7天 + var startDate = DateTime.Now.AddDays(-7); // 先获取计划表一周的作业岗位有哪些 var dataList = (from x in Funs.DB.JDGL_SGManPower join p in Funs.DB.Base_WorkPost on x.WorkPostId equals p.WorkPostId into pp from y in pp.DefaultIfEmpty() where x.ProjectId == projectId && (y.PostType == "2" || y.PostType == "3") && - x.PlanDate >= DateTime.Now.AddDays(-7) && x.PlanDate <= DateTime.Now && x.Version == version + x.PlanDate >= startDate && x.PlanDate <= endDate && x.Version == version group x by new { x.UnitId, @@ -310,25 +365,25 @@ namespace BLL foreach (var data in dataList) { //根据人员计划表获取计划中的作业人员数 - int num = getInOutRecordNum1(data.UnitId, data.UnitWorkId, data.WorkPostId,projectId); - + int num = getInOutRecordNum1(data.UnitId, data.UnitWorkId, data.WorkPostId, projectId); + // 计算偏差百分比 - if (data.QuantitySum > num) + if (data.QuantitySum != 0) { double deviationPercentage = Math.Abs((double)((data.QuantitySum - num) / data.QuantitySum)); // 如果偏差超过10%,发出预警 if (deviationPercentage > 0.1) { - lItems = SendWorkerDeviationWarning(data.UnitId, projectId, data.UnitWorkId, data.QuantitySum, 0); + lItems = SendWorkerDeviationWarning(data.UnitId, projectId, data.WorkPostId, data.UnitWorkId, + startDate, endDate, data.QuantitySum, num); } } } return lItems; - } - + //获取实际考勤人员数 private static int getInOutRecordNum1(string unitId, string unitWorkId, string workPostId, string projectId) { @@ -394,12 +449,13 @@ namespace BLL } else { - dataSource = dataSource.Where(x => x["UnitWorkId"] != DBNull.Value && x["UnitWorkId"].ToString() == unitWorkId); + dataSource = dataSource.Where(x => + x["UnitWorkId"] != DBNull.Value && x["UnitWorkId"].ToString() == unitWorkId); } return dataSource.Count(); } - + /// /// 发送作业人员偏差预警 @@ -409,13 +465,14 @@ namespace BLL /// 计划总人数 /// 实际总人数 /// 偏差百分比 - private static List SendWorkerDeviationWarning(string unitId, string projectId, string unitWorkId, int? quantity, int num) + private static List SendWorkerDeviationWarning(string unitId, string projectId, string workPostId, + string unitWorkId, + DateTime? startDate, DateTime? endDate, int? quantity, int num) { - // 发送预警信息 var toDoItems = new List(); List toUserIds = new List(); - + var unitWorks = (from x in Funs.DB.WBS_UnitWork where x.UnitWorkId == unitWorkId select new { x.UnitWorkId, x.UnitWorkName }).FirstOrDefault(); @@ -438,6 +495,7 @@ namespace BLL toUserIds.Add(projectUser.UserId); } } + // 获取总包单位施工经理 var generalContractorUnit = Funs.DB.Project_ProjectUnit.FirstOrDefault(pu => pu.ProjectId == projectId && pu.UnitType == Const.ProjectUnitType_1); // 总包单位 @@ -456,7 +514,7 @@ namespace BLL } } } - + // 构建预警信息内容 string warningContent = string.Empty; if (unitWorks != null) @@ -468,7 +526,50 @@ namespace BLL { warningContent = $"{projectUnits.UnitName}单位计划投入人力{quantity}人,实际考勤为{num}人。"; } - + + string urlParams = "JDGL/SGManPower/SGWarningDetails.aspx?projectId=" + projectId; + // 添加单位参数(如果已选择) + if (!string.IsNullOrEmpty(unitId)) + { + urlParams += "&unitId=" + unitId; + } + + // 添加装置参数(如果已选择) + if (!string.IsNullOrEmpty(unitWorkId)) + { + urlParams += "&unitWorkId=" + unitWorkId; + } + + // 添加岗位参数(如果已选择) + if (!string.IsNullOrEmpty(workPostId)) + { + urlParams += "&workPostId=" + workPostId; + } + + // 添加时间参数 + if (startDate.HasValue && endDate.HasValue) + { + urlParams += "&planDate=" + string.Format("{0:yyyy-MM-dd}", startDate) + "~" + + string.Format("{0:yyyy-MM-dd}", endDate); + } + + + // 添加岗位参数(如果已选择) + if (quantity.HasValue) + { + urlParams += "&quantity=" + quantity.Value; + } + + // 添加岗位参数(如果已选择) + if (num >= 0) + { + urlParams += "&num=" + num; + } + else + { + urlParams += "&num=0"; + } + // 发送预警信息 foreach (var userId in toUserIds) { @@ -476,15 +577,16 @@ namespace BLL toDoItem.DataId = SQLHelper.GetNewID(typeof(Model.ToDoItem)); toDoItem.MenuId = ""; toDoItem.MenuName = "人力资源偏差预警"; + toDoItem.ProjectCode = ""; toDoItem.Content = warningContent; toDoItem.UserId = userId; toDoItem.UserName = UserService.GetUserNameByUserId(userId); toDoItem.DataTime = DateTime.Now; toDoItem.DataTimeStr = DateTime.Now.ToString("yyyy-MM-dd"); - toDoItem.PCUrl = ""; - toDoItem.UrlStr = "pages/exam/examjs"; + toDoItem.PCUrl = urlParams; toDoItems.Add(toDoItem); } + return toDoItems; } } diff --git a/SGGL/FineUIPro.Web/CQMS/ManageReportNew/MonthReport.aspx.cs b/SGGL/FineUIPro.Web/CQMS/ManageReportNew/MonthReport.aspx.cs index 8d50da43..b37656b3 100644 --- a/SGGL/FineUIPro.Web/CQMS/ManageReportNew/MonthReport.aspx.cs +++ b/SGGL/FineUIPro.Web/CQMS/ManageReportNew/MonthReport.aspx.cs @@ -363,6 +363,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew } //自动设置表格样式 table.AutoFit(AutoFitBehavior.FixedColumnWidths); + table.Alignment = TableAlignment.Center; #endregion #region 本月主要工作内容 @@ -447,6 +448,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //自动设置表格样式 table.AutoFit(AutoFitBehavior.FixedColumnWidths); + table.Alignment = TableAlignment.Center; } #endregion @@ -503,6 +505,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //自动设置表格样式 table.AutoFit(AutoFitBehavior.FixedColumnWidths); + table.Alignment = TableAlignment.Center; } #endregion @@ -556,6 +559,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //自动设置表格样式 table.AutoFit(AutoFitBehavior.FixedColumnWidths); + table.Alignment = TableAlignment.Center; } #endregion @@ -611,6 +615,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //自动设置表格样式 table.AutoFit(AutoFitBehavior.FixedColumnWidths); + table.Alignment = TableAlignment.Center; } #endregion @@ -664,6 +669,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //自动设置表格样式 table.AutoFit(AutoFitBehavior.FixedColumnWidths); + table.Alignment = TableAlignment.Center; } #endregion @@ -763,6 +769,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //自动设置表格样式 table.AutoFit(AutoFitBehavior.FixedColumnWidths); + table.Alignment = TableAlignment.Center; } @@ -908,6 +915,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //自动设置表格样式 table.AutoFit(AutoFitBehavior.FixedColumnWidths); + table.Alignment = TableAlignment.Center; } #endregion @@ -968,6 +976,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //自动设置表格样式 table.AutoFit(AutoFitBehavior.FixedColumnWidths); + table.Alignment = TableAlignment.Center; } else { @@ -995,12 +1004,15 @@ namespace FineUIPro.Web.CQMS.ManageReportNew double numcount2 = table.FirstRow.Cells[2].CellFormat.Width; double numcount3 = table.FirstRow.Cells[3].CellFormat.Width; double numcount4 = table.FirstRow.Cells[4].CellFormat.Width; - double numcount = numcount0 + numcount1 + numcount2 + numcount3 + numcount4; + double numcount5 = table.FirstRow.Cells[5].CellFormat.Width; + double numcount6 = table.FirstRow.Cells[6].CellFormat.Width; + double numcount = numcount0 + numcount1 + numcount2 + numcount3 + numcount4 + numcount5 + numcount6; rowhj.Cells.Add(CreateCell("暂无数据", doc, numcount)); table.Rows.Insert(numberIndex + 1, rowhj); //自动设置表格样式 table.AutoFit(AutoFitBehavior.FixedColumnWidths); + table.Alignment = TableAlignment.Center; } #endregion @@ -1227,6 +1239,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //自动设置表格样式 table.AutoFit(AutoFitBehavior.FixedColumnWidths); + table.Alignment = TableAlignment.Center; } else { @@ -1262,6 +1275,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //自动设置表格样式 table.AutoFit(AutoFitBehavior.FixedColumnWidths); + table.Alignment = TableAlignment.Center; } #endregion @@ -1319,6 +1333,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //自动设置表格样式 table.AutoFit(AutoFitBehavior.FixedColumnWidths); + table.Alignment = TableAlignment.Center; } else { @@ -1353,6 +1368,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //自动设置表格样式 table.AutoFit(AutoFitBehavior.FixedColumnWidths); + table.Alignment = TableAlignment.Center; } #endregion @@ -1409,6 +1425,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //自动设置表格样式 table.AutoFit(AutoFitBehavior.FixedColumnWidths); + table.Alignment = TableAlignment.Center; } else { @@ -1533,6 +1550,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //自动设置表格样式 table.AutoFit(AutoFitBehavior.FixedColumnWidths); + table.Alignment = TableAlignment.Center; } else { @@ -1569,6 +1587,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //自动设置表格样式 table.AutoFit(AutoFitBehavior.FixedColumnWidths); + table.Alignment = TableAlignment.Center; } #endregion @@ -1661,6 +1680,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //自动设置表格样式 table.AutoFit(AutoFitBehavior.FixedColumnWidths); + table.Alignment = TableAlignment.Center; } else { @@ -1697,6 +1717,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //自动设置表格样式 table.AutoFit(AutoFitBehavior.FixedColumnWidths); + table.Alignment = TableAlignment.Center; } #endregion @@ -1789,6 +1810,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //自动设置表格样式 table.AutoFit(AutoFitBehavior.FixedColumnWidths); + table.Alignment = TableAlignment.Center; } else { @@ -1825,6 +1847,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //自动设置表格样式 table.AutoFit(AutoFitBehavior.FixedColumnWidths); + table.Alignment = TableAlignment.Center; } #endregion @@ -1917,6 +1940,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //自动设置表格样式 table.AutoFit(AutoFitBehavior.FixedColumnWidths); + table.Alignment = TableAlignment.Center; } else { @@ -1953,6 +1977,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //自动设置表格样式 table.AutoFit(AutoFitBehavior.FixedColumnWidths); + table.Alignment = TableAlignment.Center; } #endregion @@ -2045,6 +2070,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //自动设置表格样式 table.AutoFit(AutoFitBehavior.FixedColumnWidths); + table.Alignment = TableAlignment.Center; } else { @@ -2081,6 +2107,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //自动设置表格样式 table.AutoFit(AutoFitBehavior.FixedColumnWidths); + table.Alignment = TableAlignment.Center; } #endregion @@ -2173,6 +2200,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //自动设置表格样式 table.AutoFit(AutoFitBehavior.FixedColumnWidths); + table.Alignment = TableAlignment.Center; } else { @@ -2209,6 +2237,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //自动设置表格样式 table.AutoFit(AutoFitBehavior.FixedColumnWidths); + table.Alignment = TableAlignment.Center; } #endregion @@ -2301,6 +2330,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //自动设置表格样式 table.AutoFit(AutoFitBehavior.FixedColumnWidths); + table.Alignment = TableAlignment.Center; } else { @@ -2337,6 +2367,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //自动设置表格样式 table.AutoFit(AutoFitBehavior.FixedColumnWidths); + table.Alignment = TableAlignment.Center; } #endregion @@ -2436,6 +2467,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //自动设置表格样式 table.AutoFit(AutoFitBehavior.FixedColumnWidths); + table.Alignment = TableAlignment.Center; } #endregion @@ -2495,6 +2527,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //自动设置表格样式 table.AutoFit(AutoFitBehavior.FixedColumnWidths); + table.Alignment = TableAlignment.Center; } #endregion @@ -2551,6 +2584,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //自动设置表格样式 table.AutoFit(AutoFitBehavior.FixedColumnWidths); + table.Alignment = TableAlignment.Center; } #endregion @@ -2607,6 +2641,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //自动设置表格样式 table.AutoFit(AutoFitBehavior.FixedColumnWidths); + table.Alignment = TableAlignment.Center; } #endregion @@ -2674,6 +2709,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //自动设置表格样式 table.AutoFit(AutoFitBehavior.FixedColumnWidths); + table.Alignment = TableAlignment.Center; } #endregion @@ -2729,6 +2765,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //自动设置表格样式 table.AutoFit(AutoFitBehavior.FixedColumnWidths); + table.Alignment = TableAlignment.Center; } #endregion @@ -2782,6 +2819,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //自动设置表格样式 table.AutoFit(AutoFitBehavior.FixedColumnWidths); + table.Alignment = TableAlignment.Center; } #endregion @@ -2839,6 +2877,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //自动设置表格样式 table.AutoFit(AutoFitBehavior.FixedColumnWidths); + table.Alignment = TableAlignment.Center; } #endregion @@ -2878,6 +2917,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew } //自动设置表格样式 table18_1.AutoFit(AutoFitBehavior.FixedColumnWidths); + table18_1.Alignment = TableAlignment.Center; #endregion #region (2)施工过程问题 @@ -2915,6 +2955,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew } //自动设置表格样式 table18_2.AutoFit(AutoFitBehavior.FixedColumnWidths); + table18_2.Alignment = TableAlignment.Center; #endregion #endregion @@ -2949,6 +2990,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew } //自动设置表格样式 table19.AutoFit(AutoFitBehavior.FixedColumnWidths); + table19.Alignment = TableAlignment.Center; #endregion #region 20.项目质量体系审核 diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj index d6efab7a..f671a8a9 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj @@ -1552,6 +1552,7 @@ + @@ -15047,6 +15048,13 @@ ManPowerWorkGrid.aspx + + ASPXCodeBehind + SGWarningDetails.aspx + + + SGWarningDetails.aspx + WBSCompleteAudit.aspx ASPXCodeBehind diff --git a/SGGL/FineUIPro.Web/JDGL/SGManPower/SGWarningDetails.aspx b/SGGL/FineUIPro.Web/JDGL/SGManPower/SGWarningDetails.aspx new file mode 100644 index 00000000..991a3074 --- /dev/null +++ b/SGGL/FineUIPro.Web/JDGL/SGManPower/SGWarningDetails.aspx @@ -0,0 +1,84 @@ +<%@ Page Language="C#" CodeBehind="SGWarningDetails.aspx.cs" Inherits="FineUIPro.Web.JDGL.SGManPower.SGWarningDetails" %> + + + + + + + 预警详情 + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- + + + + --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/JDGL/SGManPower/SGWarningDetails.aspx.cs b/SGGL/FineUIPro.Web/JDGL/SGManPower/SGWarningDetails.aspx.cs new file mode 100644 index 00000000..52312655 --- /dev/null +++ b/SGGL/FineUIPro.Web/JDGL/SGManPower/SGWarningDetails.aspx.cs @@ -0,0 +1,123 @@ +using BLL; +using System; +using System.Linq; + + +namespace FineUIPro.Web.JDGL.SGManPower +{ + public partial class SGWarningDetails : PageBase + { + #region 定义项 + + /// + /// 项目主键 + /// + public string ProjectId + { + get { return (string)ViewState["ProjectId"]; } + set { ViewState["ProjectId"] = value; } + } + + public string UnitId + { + get => (string)ViewState["UnitId"]; + set => ViewState["UnitId"] = value; + } + + public string UnitWorkId + { + get => (string)ViewState["UnitWorkId"]; + set => ViewState["UnitWorkId"] = value; + } + + public string WorkPostId + { + get => (string)ViewState["WorkPostId"]; + set => ViewState["WorkPostId"] = value; + } + public string PlanDate + { + get => (string)ViewState["PlanDate"]; + set => ViewState["PlanDate"] = value; + } + + public string Quantity + { + get => (string)ViewState["Quantity"]; + set => ViewState["Quantity"] = value; + } + + public string Num + { + get => (string)ViewState["Num"]; + set => ViewState["Num"] = value; + } + + #endregion + + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.btnClose.OnClientClick = ActiveWindow.GetHideReference(); + this.ProjectId = Request.Params["projectId"]; + this.UnitId = Request.Params["unitId"]; + this.UnitWorkId = Request.Params["unitWorkId"]; + this.WorkPostId = Request.Params["workPostId"]; + this.PlanDate = Request.Params["planDate"]; + this.Quantity = Request.Params["quantity"]; + this.Num = Request.Params["num"]; + if (!string.IsNullOrEmpty(ProjectId)) + { + var project = BLL.ProjectService.GetProjectByProjectId(ProjectId); //项目 + if (project != null) + { + this.lProject.Text = project.ProjectName; + } + } + + if (!string.IsNullOrEmpty(UnitId)) + { + var unit = BLL.UnitService.GetUnitByUnitId(UnitId); //单位 + if (unit != null) + { + this.lUnit.Text = unit.UnitName; + } + } + + if (!string.IsNullOrEmpty(UnitWorkId)) + { + var unitWork = BLL.UnitWorkService.GetUnitWorkByUnitWorkId(UnitWorkId); //单位工程(装置) + if (unitWork != null) + { + this.lUnitWork.Text = unitWork.UnitWorkName; + } + } + + if (!string.IsNullOrEmpty(WorkPostId)) + { + var workPost = BLL.WorkPostService.GetWorkPostById(WorkPostId); //岗位 + if (workPost != null) + { + this.lWorkPost.Text = workPost.WorkPostName; + } + } + + if (!string.IsNullOrEmpty(PlanDate)) + { + this.lPlanDate.Text = PlanDate; + } + + if (!string.IsNullOrEmpty(Quantity)) + { + this.lQuantity.Text = Quantity; + } + + if (!string.IsNullOrEmpty(Num)) + { + this.lNumber.Text = Num; + } + } + } + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/JDGL/SGManPower/SGWarningDetails.aspx.designer.cs b/SGGL/FineUIPro.Web/JDGL/SGManPower/SGWarningDetails.aspx.designer.cs new file mode 100644 index 00000000..65812cdb --- /dev/null +++ b/SGGL/FineUIPro.Web/JDGL/SGManPower/SGWarningDetails.aspx.designer.cs @@ -0,0 +1,134 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.JDGL.SGManPower +{ + + + public partial class SGWarningDetails + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// lProject 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lProject; + + /// + /// lUnit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lUnit; + + /// + /// lUnitWork 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lUnitWork; + + /// + /// lWorkPost 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lWorkPost; + + /// + /// lPlanDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lPlanDate; + + /// + /// lQuantity 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lQuantity; + + /// + /// lNumber 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lNumber; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnClose 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnClose; + } +} diff --git a/SGGL/WebAPI/Controllers/JDGL/SGManPowerController.cs b/SGGL/WebAPI/Controllers/JDGL/SGManPowerController.cs index bdbbb4b2..9b3f88b1 100644 --- a/SGGL/WebAPI/Controllers/JDGL/SGManPowerController.cs +++ b/SGGL/WebAPI/Controllers/JDGL/SGManPowerController.cs @@ -11,13 +11,13 @@ namespace WebAPI.Controllers.JDGL /// 人力预警 ///
/// - [HttpPost] - public Model.ResponeData ManPowerWarning() + public Model.ResponeData getManPowerWarning(string userId) { var responeData = new Model.ResponeData(); try { - responeData = SGManPowerService.CheckAndSendPersonWarning(); + var list = SGManPowerService.CheckAndSendPersonWarning(userId); + responeData.data = list; } catch (Exception ex) {