From f02c7cbe27d7da079f057b464e2b179f1dc17b08 Mon Sep 17 00:00:00 2001
From: yxj <yxj@hz-kingdee.com>
Date: 星期二, 18 三月 2025 09:26:16 +0800
Subject: [PATCH] 新增提料运算(根据欠料单进行计算)调用方法

---
 WebAPI/Controllers/XSGL/Xs_SeOrderBillController.cs |  295 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 294 insertions(+), 1 deletions(-)

diff --git a/WebAPI/Controllers/XSGL/Xs_SeOrderBillController.cs b/WebAPI/Controllers/XSGL/Xs_SeOrderBillController.cs
index b8b96a0..af3a3a0 100644
--- a/WebAPI/Controllers/XSGL/Xs_SeOrderBillController.cs
+++ b/WebAPI/Controllers/XSGL/Xs_SeOrderBillController.cs
@@ -9,6 +9,7 @@
 using System.Data.SqlClient;
 using System.Web.Http;
 using WebAPI.Models;
+using SyntacticSugar.constant;
 
 namespace WebAPI.Controllers
 {
@@ -1163,6 +1164,58 @@
 
 
 
+        #region 閿�鍞鍗� 鍒嗛〉鏌ヨ
+        [Route("Xs_SeOrderBill/list_ByPage")]
+        [HttpGet]
+        public object list_ByPage(string sWhere, string user, string Organization, int page, int size)
+        {
+            try
+            {
+                List<object> columnNameList = new List<object>();
+                //缂栬緫鏉冮檺
+                if (!DBUtility.ClsPub.Security_Log_second("Xs_SeOrderBillQuery", 1, false, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                if (sWhere == null || sWhere.Equals(""))
+                {
+                    ds = oCN.RunProcReturn("exec h_p_Xs_SeOrderBillList_Query " + page + "," + size + ",'" + Organization + "'," + "'',1", "h_p_Xs_SeOrderBillList_Query");
+                }
+                else
+                {
+                    ds = oCN.RunProcReturn("exec h_p_Xs_SeOrderBillList_Query " + page + "," + size + ",'" + Organization + "','" + sWhere + "',1", "h_p_Xs_SeOrderBillList_Query");
+                }
+
+                //娣诲姞鍒楀悕
+                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));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+                }
+
+                objJsonResult.code = "1";
+                objJsonResult.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString());
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.list = columnNameList;
+                objJsonResult.data = ds.Tables[0];
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
         #region 閿�鍞鍗曚繚瀛� 鏂板/缂栬緫
         [Route("Xs_SeOrderBill/SaveXs_SeOrderBill")]
         [HttpPost]
@@ -1398,7 +1451,7 @@
             try
             {
 
-                ds = oCN.RunProcReturn("select * from h_v_IF_SeOrderBillList where hmainid =" + HInterID + " order by hsubid asc", "h_v_IF_SeOrderBillList");
+                ds = oCN.RunProcReturn("select * from h_v_IF_SeOrderBillEdit where hmainid =" + HInterID + " order by hsubid asc", "h_v_IF_SeOrderBillList");
                 if (ds == null || ds.Tables[0].Rows.Count == 0)
                 {
                     objJsonResult.code = "0";
@@ -3315,5 +3368,245 @@
             }
         }
         #endregion
+
+        #region 閿�鍞鍗� 鑾峰彇鎺掑簭鍚庣殑鏁版嵁-鍒嗛〉
+        [Route("Xs_SeOrderBill/sortList__ByPage")]
+        [HttpGet]
+        public object sortList_ByPage(string sWhere, string user, string Organization, int page, int size)
+        {
+            try
+            {
+                List<object> columnNameList = new List<object>();
+                //鍒ゆ柇鏌ヨ鏉冮檺
+                if (!DBUtility.ClsPub.Security_Log("Xs_SeOrderBillQuery", 1, false, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犳潈闄愭煡璇�!";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                if (sWhere == null || sWhere.Equals(""))
+                {
+                    ds = oCN.RunProcReturn("exec h_p_Xs_SeOrderBillList_Query " + page + "," + size + ",'" + Organization + "'," + "'',2", "h_p_Xs_SeOrderBillList_Query");
+                }
+                else
+                {
+                    ds = oCN.RunProcReturn("exec h_p_Xs_SeOrderBillList_Query " + page + "," + size + ",'" + Organization + "','" + sWhere + "',2", "h_p_Xs_SeOrderBillList_Query");
+                }
+
+                //娣诲姞鍒楀悕
+                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));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+                }
+
+                objJsonResult.code = "1";
+                objJsonResult.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString());
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.list = columnNameList;
+                objJsonResult.data = ds.Tables[0];
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region 閿�鍞鍗曚笅鎺ㄦ煡璇㈠垪琛�
+        [Route("Xs_SeOrderBill/PushList")]
+        [HttpGet]
+        public object PushList(string HBillNo, string user)
+        {
+            try
+            {
+                List<object> columnNameList = new List<object>();
+
+                string sql = "select * from h_v_IF_SeOrderBillList where 鍗曟嵁鍙� = '" + HBillNo + "' and 鐘舵�� = '宸插鏍�' and 鏁伴噺 - 鍏宠仈鏁伴噺 > 0";
+
+
+                ds = oCN.RunProcReturn(sql, "h_v_IF_SeOrderBillList");
+
+                if (ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = CodeConstant.FAIL;
+                    objJsonResult.count = CountConstant.FAIL;
+                    objJsonResult.Message = "鎵句笉鍒扮鍚堟潯浠跺崟鎹�!";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+
+                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));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+                }
+
+                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("Xs_SeOrderBill/QueryList")]
+        [HttpGet]
+        public object QueryList(string sWhere, string user)
+        {
+            try
+            {
+                List<object> columnNameList = new List<object>();
+                //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
+
+                if (!DBUtility.ClsPub.Security_Log("Xs_SeOrderBillQuery", 1, false, user))
+                {
+                    objJsonResult.code = CodeConstant.FAIL;
+                    objJsonResult.count = CountConstant.FAIL;
+                    objJsonResult.Message = "鏃犳潈闄愭煡鐪�!";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                string sql = "select * from h_v_Xs_SeOrderBillQuery where 1 = 1 ";
+
+                if (sWhere == "" || sWhere == null)
+                {
+                    ds = oCN.RunProcReturn("select * from h_v_Xs_SeOrderBillQuery  order by hmainid desc", "h_v_Xs_SeOrderBillQuery");
+                }
+                else
+                {
+                    ds = oCN.RunProcReturn(sql + sWhere + " order by hmainid desc", "h_v_Xs_SeOrderBillQuery");
+                }
+
+
+
+                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));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+                }
+
+                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("Xs_SeOrderBill/QuerySubList")]
+        [HttpGet]
+        public object QuerySubList(string hmainid, string user)
+        {
+            try
+            {
+                List<object> columnNameList = new List<object>();
+                //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
+
+                if (!DBUtility.ClsPub.Security_Log("Xs_SeOrderBillQuery", 1, false, user))
+                {
+                    objJsonResult.code = CodeConstant.FAIL;
+                    objJsonResult.count = CountConstant.FAIL;
+                    objJsonResult.Message = "鏃犳潈闄愭煡鐪�!";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                string sql = "select * from h_v_Xs_SeOrderBillQuerySub where hmainid =  " + hmainid;
+
+                ds = oCN.RunProcReturn(sql + " order by hsubid ASC", "h_v_Xs_SeOrderBillQuerySub");
+
+
+                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));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+                }
+
+                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("Xs_SeOrderBill/CheckRight_Money")]
+        [HttpGet]
+        public object CheckRight_Money(string user)
+        {
+            try
+            {
+                //鍒ゆ柇鏌ヨ鏉冮檺
+                if (!DBUtility.ClsPub.Security_Log("Xs_SeOrderBill_Money", 1, false, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犳潈闄愭煡璇�!";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
     }
 }
\ No newline at end of file

--
Gitblit v1.9.1