wtt
2024-12-10 871bc633a7daf1893acc98a84c64c93c9a30aaff
WebAPI/Controllers/CGGL/YF_PayMentBillController.cs
@@ -25,6 +25,62 @@
        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
        DataSet ds;
        #region 付款单分页列表
        [Route("YF_PayMentBill/page")]
        [HttpGet]
        public object YF_PayMentBillPage(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_YF_PayMentBillList_New " + page + "," + size + ",''", "h_p_YF_PayMentBillList_New");
                }
                else
                {
                    ds = oCN.RunProcReturn("exec h_p_YF_PayMentBillList_New " + page + "," + size + ",'" + sWhere + "'", "h_p_YF_PayMentBillList_New");
                }
                //添加列名
                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>
        /// 返回项目阶段列表
@@ -346,7 +402,7 @@
        {
            try
            {
                ds = oCN.RunProcReturn("select * from h_v_YF_PayMentBillList where hmainid=" + HInterID, "h_v_YF_PayMentBillList");
                ds = oCN.RunProcReturn("select * from h_v_YF_PayMentBillEdit where hmainid=" + HInterID, "h_v_YF_PayMentBillList");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
@@ -1108,7 +1164,7 @@
                
                string sql = "select * from h_v_YF_PayMentBillQuerySub where hmainid =  " + hmainid;
                ds = oCN.RunProcReturn(sql + " order by hsubid desc", "h_v_YF_PayMentBillQuerySub");
                ds = oCN.RunProcReturn(sql + " order by hsubid ASC", "h_v_YF_PayMentBillQuerySub");
                foreach (DataColumn col in ds.Tables[0].Columns)