yangle
2024-03-25 4c0a6c3fb14956c52d273b8118d43c5fcc3b6712
设备负荷分析表
1个文件已修改
44 ■■■■■ 已修改文件
WebAPI/Controllers/SBGL/Sb_EquipMaintainBillController.cs 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/SBGL/Sb_EquipMaintainBillController.cs
@@ -140,6 +140,50 @@
        #endregion
        #region 设备负荷分析表
        [Route("Sb_EquipMaintainReport/Sb_EquipmentLoadReportList")]
        [HttpGet]
        public object Sb_EquipmentLoadReportList(string HDeptID, string HWorkCenterID, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                if (HDeptID == "0" || HDeptID.Equals("")|| HWorkCenterID == "0" || HWorkCenterID.Equals(""))
                {
                    ds = oCN.RunProcReturn("exec h_p_Sb_EquipmentLoadReportListt '0','0'", "h_p_Sb_EquipmentLoadReportListt");
                }
                else
                {
                    ds = oCN.RunProcReturn("exec h_p_Sb_EquipmentLoadReportListt '" + HDeptID + "','" + HWorkCenterID + "'", "h_p_Sb_EquipmentLoadReportListt");
                }
                //添加列名
                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;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region sql语句