From fccede330bde11ca57e31946346672a164d391e8 Mon Sep 17 00:00:00 2001
From: 王 垚 <1402714037@qq.com>
Date: 星期六, 26 十一月 2022 14:56:41 +0800
Subject: [PATCH] 11

---
 WebAPI/Controllers/LMESController.cs |   95 ++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 92 insertions(+), 3 deletions(-)

diff --git a/WebAPI/Controllers/LMESController.cs b/WebAPI/Controllers/LMESController.cs
index 01cc9c3..3ada2c2 100644
--- a/WebAPI/Controllers/LMESController.cs
+++ b/WebAPI/Controllers/LMESController.cs
@@ -769,7 +769,7 @@
         /// </summary>
         [Route("LEMS/SaveToSc_PackUnionBillMain")]
         [HttpGet]
-        public object SaveToSc_PackUnionBillMain(string HBillNo, string HRemark,string HProjectNum)
+        public object SaveToSc_PackUnionBillMain(string HBillNo, string HRemark,string HProjectNum,string HBarCode_White)
         {
             DataSet ds;
             DataSet dsHSNum;
@@ -788,7 +788,7 @@
                 }
                 else
                 {
-                    ds = oCN.RunProcReturn("exec h_p_Save_KF_PonderationBillMain_TempToSc_PackUnionBillMain '" + HBillNo + "','" + HRemark + "'," + HSNum + ",'" + HSNum2 + "'", "h_p_Save_KF_PonderationBillMain_TempToSc_PackUnionBillMain");
+                    ds = oCN.RunProcReturn("exec h_p_Save_KF_PonderationBillMain_TempToSc_PackUnionBillMain '" + HBillNo + "','" + HRemark + "'," + HSNum + ",'" + HSNum2 + "','" + HBarCode_White + "'", "h_p_Save_KF_PonderationBillMain_TempToSc_PackUnionBillMain");
                 }
             }
             catch (Exception e)
@@ -1166,7 +1166,7 @@
             try
             {
                 SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
-                oCn.RunProc("Delete from KF_PonderationBillMain_Temp where HInterID = " + sHInterID + " and HSourceBillNo = '" + HSourceBillNo + "'", ref DBUtility.ClsPub.sExeReturnInfo);
+                oCn.RunProc("Delete TOP(1) from KF_PonderationBillMain_Temp where HInterID = " + sHInterID + " and HSourceBillNo = '" + HSourceBillNo + "'", ref DBUtility.ClsPub.sExeReturnInfo);
                 objJsonResult.code = "1";
                 objJsonResult.count = 1;
                 objJsonResult.Message = "鍒犻櫎鎴愬姛锛�";
@@ -1181,7 +1181,96 @@
                 objJsonResult.data = e.ToString();
                 return objJsonResult;
             }
+        }
 
+        //鍒ゆ柇鎬荤殑鍖呰鏁伴噺鏄惁瓒呰繃娴佽浆鍗℃暟閲�
+        [Route("LEMS/h_p_Sc_ProductionLinePackaging_Checkqty")]
+        [HttpGet]
+        public object h_p_Sc_ProductionLinePackaging_Checkqty(long HInterID)
+        {
+            DataSet ds;
+            try
+            {
+                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+                ds = oCN.RunProcReturn("exec h_p_Sc_ProductionLinePackaging_Checkqty " + HInterID, "h_p_Sc_ProductionLinePackaging_Checkqty");
+                if (ClsPub.isInt(ds.Tables[0].Rows[0][0]) == 0)
+                {
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";//杩斿洖鍓╀綑鏁伴噺
+                    objJsonResult.data = Pub_Class.ClsPub.isInt(ds.Tables[0].Rows[0]["HBackRemark"]);
+                    return objJsonResult;
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = Convert.ToString(ds.Tables[0].Rows[0]["HBackRemark"]);
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "寮傚父锛�";
+                objJsonResult.data = e.ToString();
+                return objJsonResult;
+            }
+        }
+
+        /// <summary>
+        /// 缂撳瓨琛ㄥ寘瑁呭崟璁板綍
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("LEMS/PackUnionCacheList")]
+        [HttpGet]
+        public object PackUnionCacheList(string sWhere)
+        {
+            DataSet ds;
+            try
+            {
+                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+                if (sWhere == null || sWhere.Equals(""))
+                {
+                    ds = oCN.RunProcReturn("select top 5000 * from h_v_PackUnionBillCacheList order by 鎵爜鏃堕棿 desc", "h_v_PackUnionBillCacheList");
+                }
+                else
+                {
+                    string sql1 = "select * from h_v_PackUnionBillCacheList where 1 = 1 ";
+                    string sql = sql1 + sWhere;
+                    string sql2 = " order by 鎵爜鏃堕棿 desc";
+                    sql += sql2;
+                    ds = oCN.RunProcReturn(sql, "h_v_PackUnionBillCacheList");
+                }
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犳暟鎹紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "Sucess锛�";
+                    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;
+            }
         }
 
         //

--
Gitblit v1.9.1