1
yusijie
2025-04-07 175c63b06390015e40148dbd8b6065ebff737898
WebAPI/Controllers/Ó¦ÊÕ¹ÜÀí/YS_ReceiveReportController.cs
@@ -115,6 +115,53 @@
        }
        #endregion
        #region å®¢æˆ·åº”收账款明细分析报表(显示物料)
        /// <summary>
        /// å®¢æˆ·åº”收账款明细分析报表(显示物料)
        /// </summary>
        /// <returns></returns>
        [Route("YS_ReceiveReportController/GetYS_CusShouldIncomeMaterEntryReport_Json")]
        [HttpGet]
        public object GetYS_CusShouldIncomeMaterEntryReport_Json(string sWhere, string user)
        {
            try
            {
                if (!DBUtility.ClsPub.Security_Log("YS_CusShouldIncomeMaterEntryReport", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无查看权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                ds = oCn.RunProcReturn("exec h_p_YS_CusShouldIncomeMaterEntryReport " + sWhere, "h_p_YS_CusShouldIncomeMaterEntryReport");
                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 = "0";
                objJsonResult.count = 1;
                objJsonResult.Message = "成功!";
                objJsonResult.data = ds.Tables[0];
                objJsonResult.list = columnNameList;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "查询报表信息失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion