From 07f7a5d24069fe75bfd350916e151a2ecc644b52 Mon Sep 17 00:00:00 2001
From: chenhaozhe <cgz@hz-kingdee.com>
Date: 星期日, 04 一月 2026 18:24:06 +0800
Subject: [PATCH] 1

---
 WebAPI/Controllers/条码管理/WEBSController.cs |  142 +++++++++++++++++++++++++++++++++++------------
 1 files changed, 106 insertions(+), 36 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 c050db8..b5d5add 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,9 +533,53 @@
                             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
                     {
@@ -13564,7 +13588,7 @@
         #region 妫�楠屽崟 鎵弿婧愬崟 鏍规嵁鍗曟嵁绫诲瀷 婧愬崟绫诲瀷 婧愬崟鍙� 瑙f瀽骞惰繑鍥炴楠岄」鐩�
         [Route("WEBSController/get_CheckBillBarCode_Json_CheckItem")]
         [HttpGet]
-        public Object get_CheckBillBarCode_Json_CheckItem(int HBillType, int HSourceBillType, string HBarCode, string HInterID, string HEntryID, int Mode)
+        public Object get_CheckBillBarCode_Json_CheckItem(int HBillType, int HSourceBillType, string HBarCode, string HInterID, string HEntryID, int Mode,string user)
         {
             try
             {
@@ -13576,7 +13600,8 @@
                     exec h_p_CheckBillBarCode_AnalysisBarcode 
                         @HBillType={HBillType},
                         @HSourceBillType={HSourceBillType},
-                        @HBarCode={HBarCode}
+                        @HBarCode={HBarCode},
+                        @user = '{user}'
                     ", "h_p_CheckBillBarCode_AnalysisBarcode");
 
                     if (ds.Tables[0].Rows.Count == 0)
@@ -13673,5 +13698,50 @@
         }
 
         #endregion
+
+        #region 娣诲悍鏍规嵁灏忚溅鏉$爜鎵惧嚭鐩稿簲鐗╂枡
+        #endregion
+        [Route("WEBSController/GetMaterIDByCarBarCode")]
+        [HttpGet]
+        public object GetMaterIDByCarBarCode(string CarBarCode)
+        {
+            try
+            {
+                ds = oCn.RunProcReturn("select * from GetMaterMesByCarBarCode where 灏忚溅='" + CarBarCode.ToString() + "'" , "GetMaterMesByCarBarCode");
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    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;
+            }
+        }
     }
 }

--
Gitblit v1.9.1