diff --git a/APT.MicroApi/APT.SC.WebApi/Controllers/Api/BIController/BIKanBanController.cs b/APT.MicroApi/APT.SC.WebApi/Controllers/Api/BIController/BIKanBanController.cs index 85ef04f..c320862 100644 --- a/APT.MicroApi/APT.SC.WebApi/Controllers/Api/BIController/BIKanBanController.cs +++ b/APT.MicroApi/APT.SC.WebApi/Controllers/Api/BIController/BIKanBanController.cs @@ -986,6 +986,58 @@ namespace APT.SC.WebApi.Controllers.Api.BI return result; } + /// + /// 获取子页 危险作业清单 + /// + /// + [HttpPost, Route("JobManage")] + public JsonActionResult> JobManage([FromBody] KeywordFilter filter) + { + JsonActionResult> result = new JsonActionResult>(); + var list = new List (); + DataTable tableList = new DataTable(); + string strConn = OPTenantDBConnService.GetConnByORGID(filter.OrgId.Value);//获取数据库链接 + using (SqlConnection connection = new SqlConnection(strConn)) + { + try + { + connection.Open(); + //当日危险作业清单 + string sql = "select * from vhome_jobTodayList"; + SqlCommand com = new SqlCommand(sql, connection); + SqlDataAdapter data = new SqlDataAdapter(com); + data.Fill(tableList); + if (tableList != null && tableList.Rows.Count > 0) + { + foreach (DataRow item in tableList.Rows) + { + JobManage job = new JobManage(); + job.companyName = item["companyName"] != null ? item["companyName"].ToString() : null; + job.startDate = item["JOB_DATE"] != null ? item["JOB_DATE"].ToString() : null; + job.endDate = item["JOB_END_DATE"] != null ? item["JOB_END_DATE"].ToString() : null; + job.jobName = item["stepName"] != null ? item["stepName"].ToString() : null; + job.areaName = item["areaName"] != null ? item["areaName"].ToString() : null; + job.place = item["JOB_LOCATION"] != null ? item["JOB_LOCATION"].ToString() : null; + job.users = item["userNames"] != null ? item["userNames"].ToString() : null; + job.monitor = item["monitorName"] != null ? item["monitorName"].ToString() : null; + job.approveUsers = item["approveNames"] != null ? item["approveNames"].ToString() : null; + list.Add(job); + } + } + connection.Close(); + } + catch (Exception ex) + { + if (!string.IsNullOrEmpty(ex.StackTrace)) + throw new Exception("错误日志:[StackTrace]" + ex.StackTrace); + else + throw new Exception("【" + HttpContext.Request.Path + "】错误日志:[Message]" + ex.Message); + } + } + result.Data = list; + return result; + + } } /// @@ -1073,4 +1125,43 @@ namespace APT.SC.WebApi.Controllers.Api.BI /// public int? qty { get; set; } } + public class JobManage + { + /// + /// 公司名称 + /// + public string companyName { get; set; } + /// + /// 开始时间 + /// + public string startDate { get; set; } + /// + /// 结束时间 + /// + public string endDate { get; set; } + /// + /// 作业名称 + /// + public string jobName { get; set; } + /// + /// 作业区域 + /// + public string areaName { get; set; } + /// + /// 作业地点 + /// + public string place { get; set; } + /// + /// 作业人员 + /// + public string users { get; set; } + /// + /// 监护人 + /// + public string monitor { get; set; } + /// + /// 审批领导 + /// + public string approveUsers { get; set; } + } }