From 2fa71a673f27b62038ceba4da0413dd7bc0f3497 Mon Sep 17 00:00:00 2001
From: chenhaozhe <cgz@hz-kingdee.com>
Date: 星期四, 16 十月 2025 13:20:03 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 WebAPI/Controllers/Sc_MouldRepairInBillListController.cs |  202 +++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 188 insertions(+), 14 deletions(-)

diff --git a/WebAPI/Controllers/Sc_MouldRepairInBillListController.cs b/WebAPI/Controllers/Sc_MouldRepairInBillListController.cs
index f0da787..f77ca59 100644
--- a/WebAPI/Controllers/Sc_MouldRepairInBillListController.cs
+++ b/WebAPI/Controllers/Sc_MouldRepairInBillListController.cs
@@ -932,6 +932,95 @@
         #endregion
 
 
+        #region 鍣ㄥ叿瀵垮懡鑰楃敤鍒嗘瀽鎶ヨ〃
+
+        /// <summary>
+        /// 鍣ㄥ叿瀵垮懡鑰楃敤鍒嗘瀽鎶ヨ〃
+        /// </summary>
+        /// <returns></returns>
+        [Route("Sc_MouldRepairInBillList/Get_Sc_MouldLifeUsePicReport_list")]
+        [HttpGet]
+        public object Get_Sc_MouldLifeUsePicReport_list(string sWhere)
+        {
+            try
+            {
+
+                Dictionary<object, object> dic = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<object, object>>(sWhere);
+
+                string HBeginDate = dic["HBeginDate"].ToString();//寮�濮嬫棩鏈�
+                string HEndDate = dic["HEndDate"].ToString();//缁撴潫鏃ユ湡
+                string HMouldNo = dic["HMouldNo"].ToString();//妯″叿缂栫爜
+                string HName = dic["HName"].ToString();//妯″叿鍚嶇О
+
+                ds = oCN.RunProcReturn("exec h_P_Sc_MouldLifeUsePicReport '" + HBeginDate + "'," + HEndDate + ",'" + HMouldNo + "','" + HName + "'", "h_P_Sc_MouldLifeUsePicReport");
+                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鍒楀璞$殑鍒楀悕
+                }
+                objJsonResult.code = "0";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "鎴愬姛锛�";
+                objJsonResult.data = ds.Tables[0];
+                objJsonResult.list = columnNameList;
+                return objJsonResult;
+                //}
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "杩斿洖鎶ヨ〃淇℃伅澶辫触锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+
+        #endregion
+
+        #region 鑾峰彇妯″叿瀵垮懡 
+        [Route("Sc_MouldRepairInBillList/Get_HMouldLifeUsePic")]
+        [HttpGet]
+        public object Get_HMouldLifeUsePic(string HItemID)
+        {
+            try
+            {
+                List<object> columnNameList = new List<object>();
+
+                ds = oCN.RunProcReturn("select * from h_v_Gy_MouldFile_Life where HInterID="+ HItemID, "h_v_Gy_MouldFile_Life");
+
+
+                //娣诲姞鍒楀悕
+                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 = 1;
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.data = ds.Tables[0];
+                objJsonResult.list = columnNameList;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+
+
         /// <summary>
         /// 妯″叿缁翠慨楠屾敹鍗曞垪琛�
         /// </summary>
@@ -2194,6 +2283,65 @@
         }
         #endregion
 
+        #region 鏍峰搧閿�鍞嚭搴撳崟鍒楄〃-鍒嗛〉
+        /// <summary>
+        /// 閿�鍞嚭搴撳崟鍒楄〃
+        /// </summary>
+        /// <returns></returns>
+        [Route("Kf_SellOutBill/GetSellOutBillList_byPage_YP")]
+        [HttpGet]
+        public object GetSellOutBillList_byPage_YP(string sWhere, string user, string Organization, int page, int size)
+        {
+            try
+            {
+                List<object> columnNameList = new List<object>();  //瀹氫箟澹版槑鍙橀噺 锛屾妸閫氳繃 new List<object>()鍒涘缓鐨� 瀹炰緥锛岃祴鍊肩粰鍙橀噺
+                //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
+                if (!DBUtility.ClsPub.Security_Log("Kf_SellOutBill_YP_Query", 1, false, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "娌℃湁鏌ヨ鏉冮檺!";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                sWhere = sWhere.Replace("'", "''");
+
+                if (sWhere == null || sWhere.Equals(""))
+                {
+                    ds = oCN.RunProcReturn("exec h_p_IF_SellOutBillList " + page + "," + size + ",'" + Organization + "'," + "''", "h_p_IF_SellOutBillList");
+                }
+                else
+                {
+                    ds = oCN.RunProcReturn("exec h_p_IF_SellOutBillList " + page + "," + size + ",'" + Organization + "','" + sWhere + "'", "h_p_IF_SellOutBillList");
+                }
+
+                //娣诲姞鍒楀悕
+                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 ex)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + ex.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
         /// <summary>
         ///閿�鍞嚭搴撳崟鍒犻櫎鍔熻兘
         /// </summary>
@@ -2594,7 +2742,7 @@
 
                 if (sWhere == null || sWhere.Equals(""))
                 {
-                    ds = oCN.RunProcReturn("select * from h_v_Kf_OtherOutBillList where 1=1 order by hmainid desc", "h_v_Kf_OtherOutBillList");
+                    ds = oCN.RunProcReturn("select * from h_v_Kf_OtherOutBillList where 1=1 order by 鍒跺崟鏃ユ湡 desc", "h_v_Kf_OtherOutBillList");
                 }
                 else
                 {
@@ -4045,7 +4193,7 @@
 
                 if (sWhere == null || sWhere.Equals(""))
                 {
-                    ds = oCN.RunProcReturn("select * from h_v_Kf_OtherInBillList where 1=1  order by hmainid desc", "h_v_Kf_OtherInBillList");
+                    ds = oCN.RunProcReturn("select * from h_v_Kf_OtherInBillList where 1=1  order by 鍒跺崟鏃ユ湡 desc", "h_v_Kf_OtherInBillList");
                 }
                 else
                 {
@@ -6812,7 +6960,7 @@
 
                     //oItem.HInterID =0;
                     //oItem.HBillNo = "";
-                    oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));//  --鏃ユ湡
+                    //oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));//  --鏃ユ湡
                     oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
                     oItem.HPeriod = DBUtility.ClsPub.isLong(DateTime.Now.Month);
                     //oItem.HMakeDate = "";
@@ -8616,7 +8764,7 @@
         }
         #endregion
 
-        #region 鍣ㄥ叿鐐规璁″垝鍗� 鍏抽棴/鍙嶅叧闂�
+        #region 鍣ㄥ叿鐐规璁板綍鍗� 鍏抽棴/鍙嶅叧闂�
         /// <summary>
         /// </summary>
         /// <param name="HInterID">鍗曟嵁ID</param>
@@ -13178,8 +13326,8 @@
                     return objJsonResult;
                 }
 
-                sWhere = sWhere.Replace("'", "''");
-                if (sWhere == null || sWhere.Equals(""))
+                sWhere = sWhere?.Replace("'", "''") ?? "";
+                if (string.IsNullOrEmpty(sWhere))
                 {
                     ds = oCn.RunProcReturn("exec h_p_Sc_MouldLifeChangeBillList_Query " + page + "," + size + ",''", "h_p_Sc_MouldLifeChangeBillList_Query");
                 }
@@ -13188,19 +13336,45 @@
                     ds = oCn.RunProcReturn("exec h_p_Sc_MouldLifeChangeBillList_Query " + page + "," + size + ",'" + sWhere + "'", "h_p_Sc_MouldLifeChangeBillList_Query");
                 }
 
-                //娣诲姞鍒楀悕
-                foreach (DataColumn col in ds.Tables[0].Columns)
+                // 娣诲姞绌哄�兼鏌�
+                if (ds == null || ds.Tables.Count == 0)
                 {
-                    Type dataType = col.DataType;
-                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
-                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+                    objJsonResult.code = CodeConstant.SUCCEED;
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏌ヨ鎴愬姛锛屼絾鏃犳暟鎹紒";
+                    objJsonResult.list = columnNameList;
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                // 妫�鏌ョ涓�涓〃
+                if (ds.Tables[0] != null)
+                {
+                    //娣诲姞鍒楀悕
+                    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));
+                    }
+                }
+
+                // 妫�鏌ョ浜屼釜琛ㄥ拰琛屾暟鎹�
+                int totalCount = 0;
+                if (ds.Tables.Count > 1 && ds.Tables[1] != null && ds.Tables[1].Rows.Count > 0)
+                {
+                    var countRow = ds.Tables[1].Rows[0]["count"];
+                    if (countRow != null && countRow != DBNull.Value)
+                    {
+                        totalCount = int.Parse(countRow.ToString());
+                    }
                 }
 
                 objJsonResult.code = CodeConstant.SUCCEED;
-                objJsonResult.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString());
-                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.count = totalCount;
+                objJsonResult.Message = "Success锛�";
                 objJsonResult.list = columnNameList;
-                objJsonResult.data = ds.Tables[0];
+                objJsonResult.data = ds.Tables[0] ?? new DataTable(); // 纭繚涓嶄负null
                 return objJsonResult;
             }
             catch (Exception e)

--
Gitblit v1.9.1