yangle
2025-04-15 9382e8326714a25e04661150d0f11ad47ca0fcac
WebAPI/Controllers/CGGL/YF_PayMentBillController.cs
@@ -8,6 +8,7 @@
using System.Data.SqlClient;
using System.Web.Http;
using WebAPI.Models;
using SyntacticSugar.constant;
namespace WebAPI.Controllers
{
@@ -23,6 +24,62 @@
        private json objJsonResult = new json();
        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>
@@ -345,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";
@@ -903,7 +960,6 @@
        }
        #endregion
        #region 付款单 作废/反作废功能
        [Route("YF_PayMentBill/DropYF_PayMentBill")]
        [HttpGet]
@@ -1050,6 +1106,92 @@
        }
        #endregion
        #region 付款单查询列表
        [Route("YF_PayMentBill/QueryList")]
        [HttpGet]
        public object QueryList(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                string sql = "select * from h_v_YF_PayMentBillQuery where 1 = 1 ";
                if (sWhere == "" || sWhere == null)
                {
                    ds = oCN.RunProcReturn("select * from h_v_YF_PayMentBillQuery  order by hmainid desc", "h_v_YF_PayMentBillQuery");
                }
                else
                {
                    ds = oCN.RunProcReturn(sql + sWhere + " order by hmainid desc", "h_v_YF_PayMentBillQuery");
                }
                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 = CodeConstant.SUCCEED;
                objJsonResult.count = CountConstant.SUCCEED;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                objJsonResult.list = columnNameList;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = CodeConstant.FAIL;
                objJsonResult.count = CountConstant.FAIL;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region 付款单查询子列表
        [Route("YF_PayMentBill/QuerySubList")]
        [HttpGet]
        public object QuerySubList(string hmainid, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                string sql = "select * from h_v_YF_PayMentBillQuerySub where hmainid =  " + hmainid;
                ds = oCN.RunProcReturn(sql + " order by hsubid ASC", "h_v_YF_PayMentBillQuerySub");
                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 = CodeConstant.SUCCEED;
                objJsonResult.count = CountConstant.SUCCEED;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                objJsonResult.list = columnNameList;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = CodeConstant.FAIL;
                objJsonResult.count = CountConstant.FAIL;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region 应付单驳回
        [Route("YF_PayMentBill/RejectCheckFlow_POOrderBill")]
        [HttpGet]