From b30895a8aed7935e3076d1c8698e6f1facbf4a4d Mon Sep 17 00:00:00 2001
From: yxj <yxj@hz-kingdee.com>
Date: 星期三, 31 十二月 2025 10:57:27 +0800
Subject: [PATCH] 扫描仓位条码调用方法修改

---
 WebAPI/Controllers/条码管理/WEBSController.cs |   92 +++++++++++++++++++++++++++++-----------------
 1 files changed, 58 insertions(+), 34 deletions(-)

diff --git "a/WebAPI/Controllers/\346\235\241\347\240\201\347\256\241\347\220\206/WEBSController.cs" "b/WebAPI/Controllers/\346\235\241\347\240\201\347\256\241\347\220\206/WEBSController.cs"
index 167b234..7a936ab 100644
--- "a/WebAPI/Controllers/\346\235\241\347\240\201\347\256\241\347\220\206/WEBSController.cs"
+++ "b/WebAPI/Controllers/\346\235\241\347\240\201\347\256\241\347\220\206/WEBSController.cs"
@@ -505,42 +505,22 @@
         {
             try
             {
-                Int64 sHSPID = 0;
-                Int64 sHWhID = 0;
-                if (HBarCode.Contains(";"))
+                //鏉$爜鏍煎紡='HSP'+浠撳簱鍐呯爜+';'+浠撲綅鍐呯爜
+                if (HBarCode.Contains("HSP") && HBarCode.Contains(";"))
                 {
-                    string[] sArray = HBarCode.Replace("HSP", "").Split(';');
-                    sHSPID = DBUtility.ClsPub.isLong(sArray[1]);
-                    sHWhID = DBUtility.ClsPub.isLong(sArray[0]);
-                }
+                    Int64 sHSPID = 0;
+                    Int64 sHWhID = 0;
+                    if (HBarCode.Contains(";"))
+                    {
+                        string[] sArray = HBarCode.Replace("HSP", "").Split(';');
+                        sHSPID = DBUtility.ClsPub.isLong(sArray[1]);
+                        sHWhID = DBUtility.ClsPub.isLong(sArray[0]);
+                    }
 
-                if (HWhID == 0)
-                {
-                    ds = oCn.RunProcReturn("select HItemID,HNumber,HName,HWHID,HWhNumber,HWhName from h_v_IF_StockPlace where HStopflag=0 and HItemID=" + sHSPID.ToString() + " and HWHID=" + sHWhID.ToString() + " and HUSEORGID = " + HStockOrgID.ToString(), "h_v_IF_StockPlace");
-                    if (ds == null || ds.Tables[0].Rows.Count == 0)
+                    if (HWhID == 0)
                     {
-                        objJsonResult.code = "0";
-                        objJsonResult.count = 0;
-                        objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛岃纭鎵�鎵粨浣嶆潯鐮佹槸鍚﹀睘浜庤缁勭粐锛屼笖涓洪潪绂佺敤鐘舵�侊紒";
-                        objJsonResult.data = null;
-                        return objJsonResult;
-                    }
-                    else
-                    {
-                        objJsonResult.code = "0";
-                        objJsonResult.count = 1;
-                        objJsonResult.Message = "鎴愬姛锛�";
-                        objJsonResult.data = ds.Tables[0];
-                        return objJsonResult;
-                    }
-                }
-                else
-                {
-                    ds = oCn.RunProcReturn("select HItemID,HNumber,HName,HWHID,HWhNumber,HWhName from h_v_IF_StockPlace where HStopflag=0 and HItemID=" + sHSPID.ToString() + " and HWHID=" + HWhID.ToString() + " and HUSEORGID = " + HStockOrgID.ToString(), "h_v_IF_StockPlace");
-                    if (ds == null || ds.Tables[0].Rows.Count == 0)
-                    {
-                        DataSet ds2 = oCn.RunProcReturn("select HItemID,HNumber,HName,HWHID,HWhNumber,HWhName from h_v_IF_StockPlace where HStopflag=0 and HItemID=" + sHSPID.ToString() + " and HWHID=" + sHWhID.ToString() + " and HUSEORGID = " + HStockOrgID.ToString(), "h_v_IF_StockPlace");
-                        if (ds2 == null || ds2.Tables[0].Rows.Count == 0)
+                        ds = oCn.RunProcReturn("select HItemID,HNumber,HName,HWHID,HWhNumber,HWhName from h_v_IF_StockPlace where HStopflag=0 and HItemID=" + sHSPID.ToString() + " and HWHID=" + sHWhID.ToString() + " and HUSEORGID = " + HStockOrgID.ToString(), "h_v_IF_StockPlace");
+                        if (ds == null || ds.Tables[0].Rows.Count == 0)
                         {
                             objJsonResult.code = "0";
                             objJsonResult.count = 0;
@@ -553,12 +533,56 @@
                             objJsonResult.code = "0";
                             objJsonResult.count = 1;
                             objJsonResult.Message = "鎴愬姛锛�";
-                            objJsonResult.data = ds2.Tables[0];
+                            objJsonResult.data = ds.Tables[0];
                             return objJsonResult;
                         }
                     }
                     else
                     {
+                        ds = oCn.RunProcReturn("select HItemID,HNumber,HName,HWHID,HWhNumber,HWhName from h_v_IF_StockPlace where HStopflag=0 and HItemID=" + sHSPID.ToString() + " and HWHID=" + HWhID.ToString() + " and HUSEORGID = " + HStockOrgID.ToString(), "h_v_IF_StockPlace");
+                        if (ds == null || ds.Tables[0].Rows.Count == 0)
+                        {
+                            DataSet ds2 = oCn.RunProcReturn("select HItemID,HNumber,HName,HWHID,HWhNumber,HWhName from h_v_IF_StockPlace where HStopflag=0 and HItemID=" + sHSPID.ToString() + " and HWHID=" + sHWhID.ToString() + " and HUSEORGID = " + HStockOrgID.ToString(), "h_v_IF_StockPlace");
+                            if (ds2 == null || ds2.Tables[0].Rows.Count == 0)
+                            {
+                                objJsonResult.code = "0";
+                                objJsonResult.count = 0;
+                                objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛岃纭鎵�鎵粨浣嶆潯鐮佹槸鍚﹀睘浜庤缁勭粐锛屼笖涓洪潪绂佺敤鐘舵�侊紒";
+                                objJsonResult.data = null;
+                                return objJsonResult;
+                            }
+                            else
+                            {
+                                objJsonResult.code = "0";
+                                objJsonResult.count = 1;
+                                objJsonResult.Message = "鎴愬姛锛�";
+                                objJsonResult.data = ds2.Tables[0];
+                                return objJsonResult;
+                            }
+                        }
+                        else
+                        {
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 1;
+                            objJsonResult.Message = "鎴愬姛锛�";
+                            objJsonResult.data = ds.Tables[0];
+                            return objJsonResult;
+                        }
+                    }
+                }
+                else
+                {
+                    ds = oCn.RunProcReturn("select HItemID,HNumber,HName,HWHID,HWhNumber,HWhName from h_v_IF_StockPlace where HStopflag=0 and HBarCode='" + HBarCode + "' and HUSEORGID = " + HStockOrgID.ToString(), "h_v_IF_StockPlace");
+                    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 = "0";
                         objJsonResult.count = 1;
                         objJsonResult.Message = "鎴愬姛锛�";

--
Gitblit v1.9.1