From fa8f01640eab5b5dfa66f91daa28112c44877b61 Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期二, 28 五月 2024 12:52:03 +0800
Subject: [PATCH] 销售出库:维护页面删除按钮报错问题解决

---
 WebAPI/Controllers/Sc_MouldRepairInBillListController.cs |  109 ++++++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 93 insertions(+), 16 deletions(-)

diff --git a/WebAPI/Controllers/Sc_MouldRepairInBillListController.cs b/WebAPI/Controllers/Sc_MouldRepairInBillListController.cs
index 495f0a8..e2a26d0 100644
--- a/WebAPI/Controllers/Sc_MouldRepairInBillListController.cs
+++ b/WebAPI/Controllers/Sc_MouldRepairInBillListController.cs
@@ -1682,6 +1682,43 @@
         }
         #endregion
 
+        #region 鐩存帴璋冩嫧鍗�  鏍规嵁涓诲唴鐮佷笌瀛愬唴鐮佽幏鍙栬皟鎷ㄧ敵璇峰崟鏁版嵁
+        [Route("Kf_MoveStockBill/loadKf_MoveStockBillMain_Push")]
+        [HttpGet]
+        public object loadKf_MoveStockBillMain_Push(long HInterID, long HSubID)
+        {
+            try
+            {
+
+                ds = oCN.RunProcReturn("select * from h_v_IF_MoveStockRequestBillList_Litee where hmainid =" + HInterID + " and hsubid = " + HSubID, "h_v_IF_MoveStockRequestBillList_Litee");
+                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;
+            }
+        }
+        #endregion
+
         #endregion
 
 
@@ -1780,7 +1817,7 @@
                 if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                 {
                     objJsonResult.code = "0";
-                    objJsonResult.count = 1;
+                    objJsonResult.count = 0;
                     objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:鍒犻櫎鍓嶅垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴";
                     objJsonResult.data = null;
                     return objJsonResult;
@@ -1789,7 +1826,7 @@
                 if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                 {
                     objJsonResult.code = "0";
-                    objJsonResult.count = 1;
+                    objJsonResult.count = 0;
                     objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                     objJsonResult.data = null;
                     return objJsonResult;
@@ -1799,17 +1836,17 @@
 
                 oCN.BeginTran();
                 //閿�鍞嚭搴撳垹闄ゅ洖濉攢鍞鍗曞叧鑱旀暟閲�
-                //oCN.RunProc("exec h_p_Xs_UpDateRelation_SeOrderToSellOut_Delete " + HInterID);
+                oCN.RunProc("exec h_p_Xs_UpDateRelation_SeOrderToSellOut_Delete " + HInterID);
 
                 //閿�鍞嚭搴撳垹闄ゅ洖濉敹璐ч�氱煡鍗曞叧鑱旀暟閲�
-                //oCN.RunProc("exec h_p_Xs_UpDateRelation_SeOutStockToPOStockIn_Del " + HInterID);
+                oCN.RunProc("exec h_p_Xs_UpDateRelation_SeOutStockToPOStockIn_Delete " + HInterID);
 
 
-                //oCN.RunProc("Delete From Kf_ICStockBillMain where HInterID = " + HInterID);
-                //oCN.RunProc("Delete From Kf_ICStockBillSub where HInterID = " + HInterID);
+                oCN.RunProc("Delete From Kf_ICStockBillMain where HInterID = " + HInterID);
+                oCN.RunProc("Delete From Kf_ICStockBillSub where HInterID = " + HInterID);
 
-                string sql = "exec h_p_WMS_ICStockBillAndWMS_Delete " + BillOld.omodel.HInterID + ",'" + BillOld.omodel.HBillNo + "','1205'";
-                oCn.RunProc(sql);
+                //string sql = "exec h_p_WMS_ICStockBillAndWMS_Delete " + BillOld.omodel.HInterID + ",'" + BillOld.omodel.HBillNo + "','1205'";
+                //oCn.RunProc(sql);
 
                 //鍒犻櫎鍚庢帶鍒�==================================================================================      
                 string sql2 = "exec h_p_Kf_SellOutBill_AfterDelCtrl " + BillOld.omodel.HInterID + ",'" + BillOld.omodel.HBillNo + "','" + user + "'";
@@ -1818,7 +1855,7 @@
                 {
                     s = "鍒犻櫎鍚庡垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴";
                     objJsonResult.code = "0";
-                    objJsonResult.count = 1;
+                    objJsonResult.count = 0;
                     objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:" + s;
                     objJsonResult.data = null;
                     oCN.RollBack();
@@ -1828,7 +1865,7 @@
                 {
                     s = ds.Tables[0].Rows[0]["HRemark"].ToString();
                     objJsonResult.code = "0";
-                    objJsonResult.count = 1;
+                    objJsonResult.count = 0;
                     objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:" + s;
                     objJsonResult.data = null;
                     oCN.RollBack();
@@ -5761,7 +5798,7 @@
             {
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                 //鑾峰彇鐐规椤圭洰缂栬緫鏁版嵁
-                ds = oCN.RunProcReturn("select HDotCheckItem, HDotCheckPart , HClaim, a.HRemark,a.HManagerID,e.HNumber HManagerCode,e.HName HManagerName from Sc_MouldDotCheckBillSub a left join Gy_Employee e on a.HManagerID=e.HItemID where 1=1 " + sqlWhere, "Sc_MouldDotCheckBillSub");
+                ds = oCN.RunProcReturn("select * from h_v_Sc_MouldDotCheckBill_Edit where 1=1 " + sqlWhere, "h_v_Sc_MouldDotCheckBill_Edit");
                 //鑾峰彇閰嶄欢椤圭洰缂栬緫鏁版嵁
                 ds1 = oCN.RunProcReturn(@"select b.HMaterID,  mt.Hnumber HMaterNumber ,mt.HName HMaterName, b.HUnitID
                     ,u2.hnumber HUnitNumber,u2.HName HUnitName,b.HQty,b.HQtyMust,b.HRemark 
@@ -5774,7 +5811,7 @@
                 objJsonResult.code = "0";
                 objJsonResult.count = 1;
                 objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
-                objJsonResult.data = null;
+                objJsonResult.data = ds.Tables[0];
                 objJsonResult.list = list;
 
             }
@@ -6096,8 +6133,7 @@
             {
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                 //鑾峰彇鐐规椤圭洰缂栬緫鏁版嵁
-                ds = oCN.RunProcReturn(@"select a.HDotCheckItemID,HDotCheckItem, HDotCheckPart , HClaim, a.HRemark,a.HManagerID,e.HNumber HManagerCode,e.HName HManagerName from Sc_MouldDotCheckPlanBillSub a 
-                  left join Gy_Employee e on a.HManagerID=e.HItemID
+                ds = oCN.RunProcReturn(@"select * from h_v_Sc_MouldDotCheckPlanBill_Edit
                         where 1=1 " + sqlWhere, "Sc_MouldDotCheckPlanBillSub");
                 ////鑾峰彇閰嶄欢椤圭洰缂栬緫鏁版嵁
                 //ds1 = oCN.RunProcReturn(@"select b.HMaterID,  mt.Hnumber HMaterNumber ,mt.HName HMaterName, b.HUnitID
@@ -6110,7 +6146,7 @@
                 objJsonResult.code = "0";
                 objJsonResult.count = 1;
                 objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
-                objJsonResult.data = null;
+                objJsonResult.data = ds.Tables[0];
                 objJsonResult.list = list;
             }
             catch (Exception e)
@@ -6208,7 +6244,48 @@
 
         #endregion
 
-
+        #region 鏍规嵁鍣ㄥ叿鏉$爜鏌ユ壘鍣ㄥ叿妗f淇℃伅PDA
+        [Route("QJ_PDA_MouldDotCheckBill/txtHBarCode_KeyDown")]
+        [HttpGet]
+        public object txtHBarCode_KeyDown(string HBarCode)
+        {
+            try
+            {
+                if (HBarCode == null || HBarCode.Equals(""))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏉″舰鐮佷笉鑳戒负绌猴紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                //寰楀埌淇℃伅
+                ds = oCN.RunProcReturn("select top 1 * from Gy_MouldFileMain  where HNumber= '" + HBarCode + "'", "Gy_MouldFileMain");
+                //鍐欏叆淇℃伅
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏈煡璇㈠埌鍣ㄥ叿淇℃伅锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                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;
+            }
+        }
+        #endregion
 
         #region 妯″叿鎶ュ簾鍏ュ簱鍗�
 

--
Gitblit v1.9.1