duhe
2024-09-09 be28a6a14688557cd12b3fdb97b117cd4cb52fde
WebAPI/Controllers/CGGL/Cg_PayableBillController.cs
@@ -1474,5 +1474,56 @@
        }
        #endregion
        #region 应付单列表 查询供应商付款计划表
        /// <summary>
        /// 返回应收单列表
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("Cg_PayableBill/SupplierPayPlanList")]
        [HttpGet]
        public object SupplierPayPlanList(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("select * from h_v_Gy_SupplierPayPlanList order by 单据号 desc", "h_v_Gy_SupplierPayPlanList");
                }
                else
                {
                    string sql1 = "select * from h_v_Gy_SupplierPayPlanList where 1 = 1 ";
                    string sql = sql1 + sWhere + " order by 单据号 desc";
                    ds = oCN.RunProcReturn(sql, "h_v_Gy_SupplierPayPlanList");
                }
                //添加列名
                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.Tables[0];
                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
    }
}