From 6ef126d9a9271afae02ee36469b1512e144bc555 Mon Sep 17 00:00:00 2001
From: wtt <1985833171@qq.com>
Date: 星期一, 17 十一月 2025 15:57:51 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 WarM/条码打印/Gy_CusBarCodeBill_KaiBei_HuaSan.cs |   34 ++++++++++++++++++++++++----------
 1 files changed, 24 insertions(+), 10 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 9092c8c..494d047 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"
@@ -710,7 +710,14 @@
 
                             HEntryID = j + 1;
                             HBarCode = TM.ToUpper();
-                            HBarCodeType = "鏂板崕涓夊唴绠辩爜";
+                            if (cmbHCusName.Text.Contains("涓滄柟閫氫俊"))
+                            {
+                                HBarCodeType = "涓滄柟閫氫俊鍐呯鐮�";
+                            }
+                            else
+                            {
+                                HBarCodeType = "鏂板崕涓夊唴绠辩爜";
+                            }
                             HMaterID = ClsPub.isLong(grdMain.Rows[j].Cells[HMaterIDCol].Value);
                             HBatchNo = sYear4 + sPeriod2 + sDay;
                             HUnitID = ClsPub.isLong(grdMain.Rows[j].Cells[HUnitIDCol].Value);
@@ -787,8 +794,8 @@
                         HInnerBillNo = ClsPub.isStrNull(grdMain.Rows[j].Cells[HInnerBillNoCol].Value);  //閿�鍞鍗曞彿
 
                         //鑾峰彇鏈�澶ф祦姘村彿
-                        //鏉$爜鍓嶇紑 = 渚涘簲鍟嗕唬鐮� + 閿�鍞鍗曞彿
-                        sWTMNumber = "151091" + HInnerBillNo;
+                        //鏉$爜鍓嶇紑 = 2浣嶅浐瀹氱爜锛�'09'锛� + CPN瀹㈡埛缂栫爜锛堣鏍煎瀷鍙凤級+ 2浣嶉鐣欑爜锛堝浐瀹�'01'锛�+ 5浣嶅勾骞存湀鏃ユ棩锛圷YMDD锛� + 3浣�09鐮佹祦姘村彿锛堝浐瀹�'001'锛� + 渚涘簲鍟嗕唬鐮侊紙鍥哄畾'151091'锛�
+                        sWTMNumber = "09" + HMaterModel + "01" + sYear + sPeriod + sDay + "001151091";
                         Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sWTMNumber + "'", "h_p_WMS_GetMaxNo");    //鑾峰彇鏈�澶ф祦姘村彿
                         LWSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
 
@@ -816,11 +823,18 @@
                             }
 
                             //鏉$爜缂栧彿 = 2浣嶅浐瀹氱爜锛�'09'锛� + CPN瀹㈡埛缂栫爜锛堣鏍煎瀷鍙凤級+ 2浣嶉鐣欑爜锛堝浐瀹�'01'锛�+ 5浣嶅勾骞存湀鏃ユ棩锛圷YMDD锛� + 3浣�09鐮佹祦姘村彿锛堝浐瀹�'001'锛� + 渚涘簲鍟嗕唬鐮侊紙鍥哄畾'151091'锛�+ 3浣嶆祦姘村彿
-                            TM = "09" + HMaterModel + "01" + sYear + sPeriod + sDay + "001151091" + LSH2;
+                            TM = sWTMNumber + LSH2;
 
                             HEntryID = j + 1;
                             HBarCode = TM.ToUpper();
-                            HBarCodeType = "鏂板崕涓夊绠辩爜";
+                            if (cmbHCusName.Text.Contains("涓滄柟閫氫俊"))
+                            {
+                                HBarCodeType = "涓滄柟閫氫俊澶栫鐮�";
+                            }
+                            else
+                            {
+                                HBarCodeType = "鏂板崕涓夊绠辩爜";
+                            }
                             HMaterID = ClsPub.isLong(grdMain.Rows[j].Cells[HMaterIDCol].Value);
                             HBatchNo = sYear4 + sPeriod2 + sDay;
                             HUnitID = ClsPub.isLong(grdMain.Rows[j].Cells[HUnitIDCol].Value);
@@ -903,7 +917,7 @@
         private void Display()
         {
             //鍒锋柊鍐呯鐮佸垪琛�
-            DataSet DSet = oCn.RunProcReturn("select * from h_v_Gy_BarCodeBill_CusList where HInterID=" + HInterID.ToString() + " and 鏉$爜绫诲瀷='鏂板崕涓夊唴绠辩爜' 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 (鏉$爜绫诲瀷='鏂板崕涓夊唴绠辩爜' or 鏉$爜绫诲瀷='涓滄柟閫氫俊鍐呯鐮�) order by HItemID", "h_v_Gy_BarCodeBill_CusList", ref DBUtility.ClsPub.sExeReturnInfo);
             //鐢熸垚棣栬鏍囬
             if (DSet == null)
             {
@@ -914,7 +928,7 @@
             grdSub.DataSource = DSet.Tables[0].DefaultView;
 
             //鍒锋柊澶栫鐮佸垪琛�
-            DataSet DWSet = oCn.RunProcReturn("select * from h_v_Gy_BarCodeBill_CusList where HInterID=" + HInterID.ToString() + " and 鏉$爜绫诲瀷='鏂板崕涓夊绠辩爜' 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 (鏉$爜绫诲瀷='鏂板崕涓夊绠辩爜' or 鏉$爜绫诲瀷='涓滄柟閫氫俊澶栫鐮�) order by HItemID", "h_v_Gy_BarCodeBill_CusList", ref DBUtility.ClsPub.sExeReturnInfo);
             //鐢熸垚棣栬鏍囬
             if (DWSet == null)
             {
@@ -1049,7 +1063,7 @@
             grdMain.Columns[HEXPPERIODCol].Visible = false;
             grdMain.Columns[HLSHCol].Visible = false;
             grdMain.Columns[HBaNoCol].Visible = false;
-            grdMain.Columns[HCusModelNameCol].Visible = false;
+            //grdMain.Columns[HCusModelNameCol].Visible = false;
             grdMain.Columns[HCusModelCol].Visible = false;
             grdMain.Columns[HBatchNoCol].Visible = false;
             grdMain.Columns[HCode1Col].Visible = false;
@@ -1670,7 +1684,7 @@
         {
             try
             {
-                oCn.RunProc("update Gy_BarCodeBill_Cus set HPrintQty=isnull(HPrintQty,0)+1 where HBarCodeType='鏂板崕涓夊唴绠辩爜' 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)
             {
@@ -1785,7 +1799,7 @@
         {
             try
             {
-                oCn.RunProc("update Gy_BarCodeBill_Cus set HPrintQty=isnull(HPrintQty,0)+1 where HBarCodeType='鏂板崕涓夊绠辩爜' 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)
             {

--
Gitblit v1.9.1