From f866c19fbfe7b6f60a12a63681ea1a076d510e2d Mon Sep 17 00:00:00 2001
From: yxj <yxj@hz-kingdee.com>
Date: 星期一, 17 十一月 2025 14:33:51 +0800
Subject: [PATCH] 凯贝华勤客户条码规则升级变更,新华三外箱条码流水号获取方式变更

---
 WarM/条码打印/Gy_CusBarCodeBill_KaiBei.cs        |    7 ++++++-
 WarM/条码打印/Gy_CusBarCodeBill_KaiBei_HuaSan.cs |   34 ++++++++++++++++++++++++----------
 2 files changed, 30 insertions(+), 11 deletions(-)

diff --git "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_CusBarCodeBill_KaiBei.cs" "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_CusBarCodeBill_KaiBei.cs"
index 1f5897b..cbd21d2 100644
--- "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_CusBarCodeBill_KaiBei.cs"
+++ "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_CusBarCodeBill_KaiBei.cs"
@@ -752,10 +752,15 @@
                                 LSH2 = "0" + LSH2;
                             }
 
-                            if (HBarCodeType == "閿愭嵎鏍囩" || HBarCodeType == "鍗庡嫟鏍囩" || HBarCodeType == "鑻变笟杈炬爣绛�")
+                            if (HBarCodeType == "閿愭嵎鏍囩" || HBarCodeType == "鑻变笟杈炬爣绛�")
                             {
                                 TM = sTMNumber + LSH2;
                             }
+                            else if (HBarCodeType == "鍗庡嫟鏍囩")
+                            {
+                                //鏉$爜缂栧彿 = 瀹㈡埛鏂欏彿+2浣嶅浐瀹氣��00鈥�+骞村懆+ 娴佹按鍙凤紙4浣嶏級
+                                TM = sHCusModelName + "00" + sYearWeek + LSH2;
+                            }
                             else
                             //瓒呰仛鍙樺唴鏍囩
                             {
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