From 2be8e94cdbbadcdb7b8fcf99ef49e1a93ccb2eaf Mon Sep 17 00:00:00 2001
From: wtt <1985833171@qq.com>
Date: 星期三, 31 十二月 2025 16:41:59 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 WarM/条码打印/Gy_CusBarCodeBill_KaiBei_HuaSan.cs |   28 +++++++++++---
 WebAPI/Controllers/条码管理/WEBSController.cs    |   92 +++++++++++++++++++++++++++++-----------------
 2 files changed, 80 insertions(+), 40 deletions(-)

diff --git "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_CusBarCodeBill_KaiBei_HuaSan.cs" "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_CusBarCodeBill_KaiBei_HuaSan.cs"
index 2ad2937..80d82dc 100644
--- "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_CusBarCodeBill_KaiBei_HuaSan.cs"
+++ "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_CusBarCodeBill_KaiBei_HuaSan.cs"
@@ -71,7 +71,7 @@
         public const Int16 HCusModelCol = 49;
         //
         public  string ModName = "85";
-        public  string ModCaption = "鏂板崕涓夊鎴锋爣绛剧敓鎴�";
+        public  string ModCaption = "鏂板崕涓夈�佷笢鏂归�氫俊銆佺粺鍚堛�佺传鍏夊崕鏅哄鎴锋爣绛剧敓鎴�";
         public const string ModRightName = "Gy_CusBarCodeBill_KaiBei_HuaSan";
 
         public DBUtility.ClsPub.Enum_BillStatus BillStatus;
@@ -714,6 +714,14 @@
                             {
                                 HBarCodeType = "涓滄柟閫氫俊鍐呯鐮�";
                             }
+                            else if (cmbHCusName.Text.Contains("缁熷悎"))
+                            {
+                                HBarCodeType = "缁熷悎鍐呯鐮�";
+                            }
+                            else if (cmbHCusName.Text.Contains("绱厜鍗庢櫤"))
+                            {
+                                HBarCodeType = "绱厜鍗庢櫤鍐呯鐮�";
+                            }
                             else
                             {
                                 HBarCodeType = "鏂板崕涓夊唴绠辩爜";
@@ -799,7 +807,7 @@
                             //鏉$爜鍓嶇紑 = 2浣嶅浐瀹氱爜锛�'09'锛� + CPN瀹㈡埛缂栫爜锛堣鏍煎瀷鍙凤級+ 2浣嶉鐣欑爜锛堝浐瀹�'01'锛�+ 5浣嶅勾骞存湀鏃ユ棩锛圷YMDD锛� + 3浣�09鐮佹祦姘村彿锛堝浐瀹�'001'锛� + 渚涘簲鍟嗕唬鐮侊紙鍥哄畾'105652'锛�
                             sWTMNumber = "09" + HMaterModel + "01" + sYear + sPeriod + sDay + "001105652";
                         }
-                        //鏂板崕涓�
+                        //鏂板崕涓夈�佺粺鍚堛�佺传鍏夊崕鏅�
                         else
                         {
                             //鏉$爜鍓嶇紑 = 2浣嶅浐瀹氱爜锛�'09'锛� + CPN瀹㈡埛缂栫爜锛堣鏍煎瀷鍙凤級+ 2浣嶉鐣欑爜锛堝浐瀹�'01'锛�+ 5浣嶅勾骞存湀鏃ユ棩锛圷YMDD锛� + 3浣�09鐮佹祦姘村彿锛堝浐瀹�'001'锛� + 渚涘簲鍟嗕唬鐮侊紙鍥哄畾'151091'锛�
@@ -839,6 +847,14 @@
                             if (cmbHCusName.Text.Contains("涓滄柟閫氫俊"))
                             {
                                 HBarCodeType = "涓滄柟閫氫俊澶栫鐮�";
+                            }
+                            else if (cmbHCusName.Text.Contains("缁熷悎"))
+                            {
+                                HBarCodeType = "缁熷悎澶栫鐮�";
+                            }
+                            else if (cmbHCusName.Text.Contains("绱厜鍗庢櫤"))
+                            {
+                                HBarCodeType = "绱厜鍗庢櫤澶栫鐮�";
                             }
                             else
                             {
@@ -926,7 +942,7 @@
         private void Display()
         {
             //鍒锋柊鍐呯鐮佸垪琛�
-            DataSet DSet = oCn.RunProcReturn("select * from h_v_Gy_BarCodeBill_CusList where HInterID=" + HInterID.ToString() + " and (鏉$爜绫诲瀷='鏂板崕涓夊唴绠辩爜' or 鏉$爜绫诲瀷='涓滄柟閫氫俊鍐呯鐮�) order by HItemID", "h_v_Gy_BarCodeBill_CusList", ref DBUtility.ClsPub.sExeReturnInfo);
+            DataSet DSet = oCn.RunProcReturn("select * from h_v_Gy_BarCodeBill_CusList where HInterID=" + HInterID.ToString() + " and (鏉$爜绫诲瀷 in ('鏂板崕涓夊唴绠辩爜','涓滄柟閫氫俊鍐呯鐮�','缁熷悎鍐呯鐮�','绱厜鍗庢櫤鍐呯鐮�') order by HItemID", "h_v_Gy_BarCodeBill_CusList", ref DBUtility.ClsPub.sExeReturnInfo);
             //鐢熸垚棣栬鏍囬
             if (DSet == null)
             {
@@ -937,7 +953,7 @@
             grdSub.DataSource = DSet.Tables[0].DefaultView;
 
             //鍒锋柊澶栫鐮佸垪琛�
-            DataSet DWSet = oCn.RunProcReturn("select * from h_v_Gy_BarCodeBill_CusList where HInterID=" + HInterID.ToString() + " and (鏉$爜绫诲瀷='鏂板崕涓夊绠辩爜' or 鏉$爜绫诲瀷='涓滄柟閫氫俊澶栫鐮�) order by HItemID", "h_v_Gy_BarCodeBill_CusList", ref DBUtility.ClsPub.sExeReturnInfo);
+            DataSet DWSet = oCn.RunProcReturn("select * from h_v_Gy_BarCodeBill_CusList where HInterID=" + HInterID.ToString() + " and (鏉$爜绫诲瀷 in ('鏂板崕涓夊绠辩爜','涓滄柟閫氫俊澶栫鐮�','缁熷悎澶栫鐮�','绱厜鍗庢櫤澶栫鐮�') order by HItemID", "h_v_Gy_BarCodeBill_CusList", ref DBUtility.ClsPub.sExeReturnInfo);
             //鐢熸垚棣栬鏍囬
             if (DWSet == null)
             {
@@ -1693,7 +1709,7 @@
         {
             try
             {
-                oCn.RunProc("update Gy_BarCodeBill_Cus set HPrintQty=isnull(HPrintQty,0)+1 where HBarCodeType in ('鏂板崕涓夊唴绠辩爜','涓滄柟閫氫俊鍐呯鐮�') and HInterID=" + HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
+                oCn.RunProc("update Gy_BarCodeBill_Cus set HPrintQty=isnull(HPrintQty,0)+1 where HBarCodeType in ('鏂板崕涓夊唴绠辩爜','涓滄柟閫氫俊鍐呯鐮�','缁熷悎鍐呯鐮�','绱厜鍗庢櫤鍐呯鐮�') and HInterID=" + HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
             }
             catch (Exception e)
             {
@@ -1808,7 +1824,7 @@
         {
             try
             {
-                oCn.RunProc("update Gy_BarCodeBill_Cus set HPrintQty=isnull(HPrintQty,0)+1 where HBarCodeType in ('鏂板崕涓夊绠辩爜','涓滄柟閫氫俊澶栫鐮�') and HInterID=" + HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
+                oCn.RunProc("update Gy_BarCodeBill_Cus set HPrintQty=isnull(HPrintQty,0)+1 where HBarCodeType in ('鏂板崕涓夊绠辩爜','涓滄柟閫氫俊澶栫鐮�','缁熷悎澶栫鐮�','绱厜鍗庢櫤澶栫鐮�') and HInterID=" + HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
             }
             catch (Exception e)
             {
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 dc1871e..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,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