From 92993b722fd262c7b8179abe64c4ba5ccc07c6f2 Mon Sep 17 00:00:00 2001
From: yxj <yxj@hz-kingdee.com>
Date: 星期六, 11 十月 2025 08:06:40 +0800
Subject: [PATCH] PDA生产组托扫描托条码调用方法修改,新增用户模块权限判断控制方法

---
 WarM/条码打印/Gy_BarCodeBill_automaticallyByPLC_New.cs |   32 ++++++++++++++++++++++++++++----
 1 files changed, 28 insertions(+), 4 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..daf7c8f 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"
@@ -846,6 +846,7 @@
                         HWhID = ClsPub.isLong(grdSub.Rows[i].Cells[HWhID2Col].Value);
                         HSPID = ClsPub.isLong(grdSub.Rows[i].Cells[HSPID2Col].Value);
                         HRemark = ClsPub.isStrNull(grdSub.Rows[i].Cells[HRemark2Col].Value);
+                        HRemark = "PLC鑷姩鐢熸垚";
                         HMaterName = ClsPub.isStrNull(grdSub.Rows[i].Cells[HMaterName2Col].Value);
                         HMaterModel = ClsPub.isStrNull(grdSub.Rows[i].Cells[HMaterModel2Col].Value);
                         HPinfan = ClsPub.isStrNull(grdSub.Rows[i].Cells[HPinfan2Col].Value);
@@ -952,14 +953,14 @@
                 string LIU = "";
                 int LEN = 4;
                 DataSet ds;
-                string sql = "select * from h_v_IF_BarCodeBillList Where HMaterID = " + grdMain.Rows[0].Cells[HMaterIDCol].Value + " and HSTOCKORGID = " + HOrgID + " and CONVERT(varchar(100),鏉$爜鏃ユ湡, 23) = '" + HDate + "' order by 鎵瑰彿 desc";
+                string sql = "select * from h_v_IF_BarCodeBillList Where HMaterID = " + grdMain.Rows[0].Cells[HMaterIDCol].Value + " and HSTOCKORGID = " + HOrgID + " and CONVERT(varchar(100),鏉$爜鏃ユ湡, 23) = '" + HDate + "' and 澶囨敞 = 'PLC鑷姩鐢熸垚' order by 鎵瑰彿 desc";
                 ds = oCn.RunProcReturn(sql, "h_v_IF_BarCodeBillList");
                 if (ds != null)
                 {
                     long count = 0;
                     if (ds.Tables[0].Rows.Count > 0)
                     {
-                        count = ClsPub.isLong(ds.Tables[0].Rows[0]["鎵瑰彿"].ToString().Replace(sYear + sPeriod + sDay, ""));
+                        count = ClsPub.isLong(ds.Tables[0].Rows[0]["鎵瑰彿"].ToString().Replace(sYear + sPeriod + sDay+" ", ""));
                     }
                     LIU += count + 1;
                     while (LIU.Length < LEN)  //濡傛灉娴佹按鍙峰皬浜�6浣嶆暟鍓嶉潰琛�0
@@ -973,7 +974,7 @@
                 }
 
                 //鎷兼帴鎵瑰彿
-                HBatchNo = sYear + sPeriod + sDay + LIU;
+                HBatchNo = sYear + sPeriod + sDay+" " + LIU;
             }
 
 
@@ -1038,7 +1039,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
 
@@ -2221,6 +2244,7 @@
                 {
                     sMoney = ClsPub.isDoule(grdMain.Rows[sRow].Cells[HQtyCol].Value) / ClsPub.isDoule(grdMain.Rows[sRow].Cells[HMinQtyCol].Value);
                 }
+                sMoney = Math.Round(sMoney, 10);    // 淇濈暀10浣嶅皬鏁拌繘琛屽洓鑸嶄簲鍏�
                 sMoney = Math.Ceiling(sMoney);
                 grdMain.Rows[sRow].Cells[HBQtyCol].Value = sMoney;
             }

--
Gitblit v1.9.1