black-goat-me
2023-05-19 752a904c8c3bee0c56bd9c4129ffa868cd7a3917
WebAPI/Controllers/MateOutController.cs
@@ -1334,6 +1334,7 @@
            public string HBillNo;
            public string HProductName;
            public string HProductModel;
            //public string RandomSearch;
        }
        //白坯发布汇总报表
@@ -1341,7 +1342,6 @@
        [HttpGet]
        public object MaterOutSumReport_Cloth(string sWhere)
        {
            int i = 0;
            try
            {
                //反序列化传递的值
@@ -1350,9 +1350,20 @@
                ds = oCN.RunProcReturn($"exec h_p_Kf_MaterOutSumReport_Cloth '{com.HBeginDate}','{com.HEndDate}'" +
                    $",'{com.HMaterNumber}','{com.HBillNo}','{com.HProductName}','{com.HProductModel}'", "h_p_Kf_MaterOutSumReport_Cloth");
                //获取列名
                List<object> columnNameList = new List<object>();
                //添加列名
                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.list = columnNameList;
                objJsonResult.data = ds.Tables[0];
                return objJsonResult;
            }
@@ -1381,9 +1392,20 @@
                ds = oCN.RunProcReturn($"exec h_p_Kf_MaterOutEntryReport_Cloth '{com.HBeginDate}','{com.HEndDate}'" +
                    $",'{com.HMaterNumber}','{com.HBillNo}','{com.HProductName}','{com.HProductModel}'", "h_p_Kf_MaterOutEntryReport_Cloth");
                //获取列名
                List<object> columnNameList = new List<object>();
                //添加列名
                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.list = columnNameList;
                objJsonResult.data = ds.Tables[0];
                return objJsonResult;
            }