From 5e1c0b5871c0964f38a16ff8b38941f83af8bbac Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期五, 31 五月 2024 15:08:58 +0800
Subject: [PATCH] 出站单删除子件条码优化 故障登记单查询 设备

---
 WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs    |    9 +++++++++
 WebAPI/Controllers/SBGL/Sb_EquipDotCheckBillController.cs |   43 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 52 insertions(+), 0 deletions(-)

diff --git a/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs b/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs
index 4adefb6..43a78b6 100644
--- a/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs
+++ b/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs
@@ -2358,8 +2358,17 @@
 
                     oCn.BeginTran();
 
+                    ds = oCn.RunProcReturn($"select * from Sc_AssemblyBillMain  where HMainSourceInterID={oBill.omodel.HProcExchInterID} and HMainSourceEntryID={oBill.omodel.HProcExchEntryID} and HBarCode_P='{HBardcode}'", "Sc_AssemblyBillMain");
+
+                    if (ds.Tables[0].Rows.Count > 0)
+                    {
+                        oCn.RunProc($"delete from Sc_AssemblyBillMain  where HMainSourceInterID={oBill.omodel.HProcExchInterID} and HMainSourceEntryID={oBill.omodel.HProcExchEntryID} and HBarCode_P='{HBardcode}'");
+                        oCn.RunProc($"delete from Sc_AssemblyBillMain  where HInterID={ds.Tables[0].Rows[0]["HInterID"].ToString()} and HBarCode_P='{HBardcode}'");
+                    }
+
                     oCn.RunProc("delete from Sc_StationOutBillSub_SN where HInterID=" + HInterID + " and HBarCode='" + HBardcode + "'");
                     oCn.RunProc("update  Sc_StationOutBillMain set HQty-=1 where HInterID=" + HInterID);
+                  
 
                     oCn.Commit();
 
diff --git a/WebAPI/Controllers/SBGL/Sb_EquipDotCheckBillController.cs b/WebAPI/Controllers/SBGL/Sb_EquipDotCheckBillController.cs
index b5fb9f7..c8043de 100644
--- a/WebAPI/Controllers/SBGL/Sb_EquipDotCheckBillController.cs
+++ b/WebAPI/Controllers/SBGL/Sb_EquipDotCheckBillController.cs
@@ -457,6 +457,49 @@
         }
         #endregion
 
+        #region 鏍规嵁璁惧鏉$爜鏌ユ壘璁惧妗f淇℃伅PDA  鏌ヨ鏉$爜妗f鍒楄〃
+        [Route("Sb_PDA_EquipDotCheckBill/txtHBarCode_KeyDown_List")]
+        [HttpGet]
+        public object txtHBarCode_KeyDown_List(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 h_v_Gy_EquipFileMainList  where 璁惧浠g爜= '" + HBarCode + "'", "h_v_Gy_EquipFileMainList");
+                //鍐欏叆淇℃伅
+                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 璁惧鐐规璁板綍鎻愪氦PDA
 
         [Route("Sb_PDA_EquipDotCheckBill/SaveGetEquipDotCheckBillList")]

--
Gitblit v1.9.1