wtt
2024-12-09 d4d3b8ce7bd27dff96194e3511444ce1765d3ad3
WebAPI/Controllers/CGGL/Cg_PayableBillController.cs
@@ -25,6 +25,63 @@
        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
        DataSet ds;
        #region 应付单分页列表
        [Route("Cg_PayableBill/page")]
        [HttpGet]
        public object Cg_PayableBillPage(string sWhere, string user, int page, int size)
        {
            DataSet ds;
            json res = new json();
            try
            {
                List<object> columnNameList = new List<object>();
                //判断权限
                //if (!DBUtility.ClsPub.Security_Log("Kf_POStockInBillList", 1, false, user))
                //{
                //    objJsonResult.code = CodeConstant.FAIL;
                //    objJsonResult.count = CountConstant.FAIL;
                //    objJsonResult.Message = "您没有该模块权限,请与管理员联系!";
                //    objJsonResult.data = null;
                //    return objJsonResult;
                //}
                sWhere = sWhere.Replace("'", "''");
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("exec h_p_Cg_PayableBillList " + page + "," + size + ",''", "h_p_Cg_PayableBillList");
                }
                else
                {
                    ds = oCN.RunProcReturn("exec h_p_Cg_PayableBillList " + page + "," + size + ",'" + sWhere + "'", "h_p_Cg_PayableBillList");
                }
                //添加列名
                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列对象的列名
                }
                res.code = CodeConstant.SUCCEED;
                res.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString());
                res.Message = "Sucess!";
                res.list = columnNameList;
                res.data = ds.Tables[0];
                return res;
            }
            catch (Exception e)
            {
                res.code = CodeConstant.FAIL;
                res.count = CountConstant.FAIL;
                res.Message = "Exception!" + e.ToString();
                res.data = null;
                return res;
            }
        }
        #endregion
        #region 应付单列表 查询
        /// <summary>
        /// 返回应收单列表
@@ -1627,7 +1684,7 @@
                //}
                string sql = "select * from h_v_Cg_PayableBillQuerySub where hmainid =  " + hmainid;
                ds = oCN.RunProcReturn(sql + " order by hsubid desc", "h_v_Cg_PayableBillQuerySub");
                ds = oCN.RunProcReturn(sql + " order by hsubid ASC", "h_v_Cg_PayableBillQuerySub");
                foreach (DataColumn col in ds.Tables[0].Columns)