From 175b53e6f0adb40a0d861981f56f120615d55897 Mon Sep 17 00:00:00 2001
From: wtt <1985833171@qq.com>
Date: 星期三, 13 十一月 2024 14:52:31 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 WarM/条码打印/Gy_BarCodeBill_automaticallyByPLC_New.cs |   24 +++++++++++++++++++++++-
 1 files changed, 23 insertions(+), 1 deletions(-)

diff --git "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill_automaticallyByPLC_New.cs" "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill_automaticallyByPLC_New.cs"
index 1ad2c42..6627b0f 100644
--- "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill_automaticallyByPLC_New.cs"
+++ "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill_automaticallyByPLC_New.cs"
@@ -1038,7 +1038,29 @@
             //鎷兼帴鎵瑰彿
             HBarCode_MaxNo = sYear + sPeriod + sDay + LIU;
 
-            return HBarCode_MaxNo;
+            long HBarCode_MaxNo_long = long.Parse(HBarCode_MaxNo);
+
+            while (true)
+            {
+                int HCount_BarCodeBillList = 0;
+                int HCount_SubBarCodeBill = 0;
+                string sql_confirm = "select * from h_v_IF_BarCodeBillList where 鏉$爜缂栧彿 = '" + (ClsPub.isStrNull(grdSub.Rows[0].Cells[HMaterModel2Col].Value) + HBarCode_MaxNo_long.ToString()) + "' and 鏉$爜绫诲瀷 = '鍞竴鏉$爜'" + " and CONVERT(varchar(100),鏉$爜鏃ユ湡, 23) = '" + HDate + "'";
+                ds = oCn.RunProcReturn(sql_confirm, "h_v_IF_BarCodeBillList");
+                HCount_BarCodeBillList = ds.Tables[0].Rows.Count;
+                sql_confirm = "select * from Gy_BarCodeBill_SWELL_SubBarCodeBill Where HBarCode = '" + (ClsPub.isStrNull(grdSub.Rows[0].Cells[HMaterModel2Col].Value) + HBarCode_MaxNo_long.ToString()) + "' and HBarCodeType = '鍞竴鏉$爜'" + " and CONVERT(varchar(100),HMakeDate, 23) = '" + HDate + "'";
+                ds = oCn.RunProcReturn(sql_confirm, "Gy_BarCodeBill_SWELL_SubBarCodeBill");
+                HCount_SubBarCodeBill = ds.Tables[0].Rows.Count;
+                if (HCount_BarCodeBillList + HCount_SubBarCodeBill > 0)
+                {
+                    HBarCode_MaxNo_long += 1;
+                }
+                else
+                {
+                    break;
+                }
+            }
+
+            return HBarCode_MaxNo_long.ToString();
         }
         #endregion
 

--
Gitblit v1.9.1