From cd1c62ccfd8cf9c582686b6aec02d394a9f4528e Mon Sep 17 00:00:00 2001
From: yusijie <ysj@hz-kingdee.com>
Date: 星期日, 29 六月 2025 19:00:15 +0800
Subject: [PATCH] 保存送货单方法外取消事务;生成送货单前校验完善实物回滚;验证采购订单方法添加防死锁;采购订单列表分页查询;物料标准包装模块;

---
 WebAPI/Controllers/POOrderController.cs |   65 +++++++++++++++++++++++++++++++-
 1 files changed, 63 insertions(+), 2 deletions(-)

diff --git a/WebAPI/Controllers/POOrderController.cs b/WebAPI/Controllers/POOrderController.cs
index 6d15889..dc131e7 100644
--- a/WebAPI/Controllers/POOrderController.cs
+++ b/WebAPI/Controllers/POOrderController.cs
@@ -33,7 +33,7 @@
         //閲囪喘璁㈠崟鍒楄〃
         public object GetPOOrderBill([FromBody] JObject msg)
         {
-            string HSupNo = msg["HSupNo"].ToString(); string sqlWhere = msg["sqlWhere"].ToString();
+            string HSupIDs = msg["HSupIDs"].ToString(); string sqlWhere = msg["sqlWhere"].ToString();
             //string msg = "";
             try
             {
@@ -41,7 +41,7 @@
                 string PcWhere = "";
                 SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
                 DataSet ds;
-                string sql = " Where hsupid in (select HSupID from h_v_Gy_UserSupplierList where 鐢ㄦ埛 = ^^" + HSupNo.Trim() + "^^) " + sqlWhere;
+                string sql = " Where hsupid in (" + HSupIDs.Trim() + ")" + sqlWhere;
                 //杞崲鐗规畩瀛楃
                 if (Common.SQLtoChange(sql, ref VsWhere, ref PcWhere) == false)
                 {
@@ -86,6 +86,67 @@
             }
 
         }
+
+        #region
+
+        [Route("GetPOOrderBillList_byPage")]
+        [HttpPost]
+        //閲囪喘璁㈠崟鍒楄〃
+        public object GetPOOrderBillList_byPage([FromBody] JObject msg)
+        {
+            string HSupIDs = msg["HSupIDs"].ToString(); 
+            string sqlWhere = msg["sqlWhere"].ToString();
+            string page = msg["page"].ToString();
+            string size = msg["size"].ToString();
+            string Organization = msg["Organization"].ToString();
+            try
+            {
+                string VsWhere = "";
+                string PcWhere = "";
+                SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
+                DataSet ds;
+                string sql = " Where hsupid in (" + HSupIDs.Trim() + ")" + sqlWhere;
+                //杞崲鐗规畩瀛楃
+                if (Common.SQLtoChange(sql, ref VsWhere, ref PcWhere) == false)
+                {
+                    objjson.code = "0";
+                    objjson.count = 0;
+                    objjson.Message = "杞崲鐗规畩瀛楃澶辫触";
+                    objjson.data = null;
+                    return objjson;
+                }
+
+                sql = "exec h_p_SRM_POOrderBillListByPage " + page + "," + size + ",'" + Organization + "','" + PcWhere + "'";
+
+                ds = oCn.RunProcReturn(sql, "h_p_SRM_POOrderBillListByPage");
+                //娣诲姞鍒楀悕
+                List<object> columnNameList = new List<object>();
+                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鍒楀璞$殑鍒楀悕
+                }
+                objjson.code = "1";
+                objjson.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString());
+                objjson.Message = "鑾峰彇鎴愬姛";
+                objjson.data = ds.Tables[0];
+                objjson.list = columnNameList;
+                return objjson;
+
+            }
+            catch (Exception e)
+            {
+                objjson.code = "0";
+                objjson.count = 0;
+                objjson.Message = "鑾峰彇澶辫触" + e.ToString();
+                objjson.data = null;
+                return objjson;
+            }
+
+        }
+        #endregion
+
         /// <summary>
         /// 閲囪喘璁㈠崟琛ㄥご淇℃伅
         /// </summary>

--
Gitblit v1.9.1