yusijie
2024-11-29 89873b7d156f21e7aa71b3f004a11ced2e7a7d4e
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
{
@@ -284,6 +285,31 @@
                {
                    bResult = false;
                }
                //自动审核设置
                if (refSav == "Add")
                {
                    objJsonResult.HInterID = oBill.omodel.HInterID.ToString(); //返回主ID
                    //系统参数  自动审核
                    string sReturn = "";
                    if (oSystemParameter.ShowBill(ref sReturn) == true)
                    {
                        if (oSystemParameter.omodel.YF_PayMentBill_AutoCheck == "Y") //系统参数  自动审核
                        {
                            objJsonResult.Verify = "Y";
                        }
                        else
                        {
                            objJsonResult.Verify = "N";
                        }
                    }
                }
                else if (refSav == "Update")
                {
                    objJsonResult.HInterID = oBill.omodel.HInterID.ToString(); //返回主ID
                    objJsonResult.Verify = "N";
                }
                if (bResult)
                {
                    objJsonResult.code = "0";
@@ -447,7 +473,13 @@
                string sReturn = "";
                oCN.BeginTran();
                ds = oCN.RunProcReturn("select * from h_v_YF_PayMentBillList where hmainid=" + HInterID, "h_v_YF_PayMentBillList");
                string hSourceBillType = ds.Tables[0].Rows[0]["源单类型"].ToString();
                if (hSourceBillType == "1114")
                {
                    //收款单 删除回填 应付单关联数量
                    oCN.RunProc("exec h_p_Cg_UpDateRelation_PayableToPayMent_Del " + HInterID);
                }
                oCN.RunProc("delete from YF_PayMentBillMain where HInterID = " + HInterID);
                oCN.RunProc("delete from YF_PayMentBillSub where HInterID= " + HInterID);
@@ -872,7 +904,6 @@
        }
        #endregion
        #region 付款单 作废/反作废功能
        [Route("YF_PayMentBill/DropYF_PayMentBill")]
        [HttpGet]
@@ -1019,6 +1050,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 desc", "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]