1
wtt
2026-04-10 fae58e2951ccf415ad8e8098ca49f5611e410dd3
WebAPI/Controllers/SBGL/Sb_EquipReportController.cs
@@ -524,6 +524,65 @@
        }
        #endregion
        #region  设备每日运行状态分析(做单情况)
        /// <summary>
        /// 返回设备点检任务
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("Sb_EquipDotCheckTaskReport/Sb_EquipDailyRunStateList")]
        [HttpGet]
        public object Sb_EquipDailyRunStateList(string sWhere,string user)
        {
            try
            {
                Dictionary<object, object> dic = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<object, object>>(sWhere);
                string HBeginDate = dic["HBeginDate"].ToString();
                string HEndDate = dic["HEndDate"].ToString();
                List<object> columnNameList = new List<object>();
                ds = oCN.RunProcReturn("exec h_p_Sb_EquipDailyRunStateReport  '" + HBeginDate + "','" + HEndDate + "'", "h_p_Sb_EquipDailyRunStateReport");
                if (ds.Tables[0].Rows.Count != 0 || ds != null)
                {
                    //添加列名
                    foreach (DataColumn col in ds.Tables[0].Columns)
                    {
                        Type dataType = col.DataType;
                        string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                        columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
                    }
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "Sucess!";
                    objJsonResult.data = ds;
                    objJsonResult.list = columnNameList;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无数据";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
    }
}