Эх сурвалжийг харах

修改正则匹配规则,自动匹配行

章政 6 жил өмнө
parent
commit
57b23ca35f

+ 1 - 1
UAS-出货标签管理(吉利通)/PublicMethod/DataHelper.cs

@@ -1095,7 +1095,7 @@ namespace UAS_LabelMachine
         /// </summary>
         /// <param name="ProcedureName"></param>
         /// <param name="param"></param>
-        public void CallProcedure(string ProcedureName, params string[] param)
+        public void CallProcedure(string ProcedureName,ref  string[] param)
         {
             command = new OracleCommand(ProcedureName);
             command.Connection = connection;

+ 8 - 0
UAS-出货标签管理(吉利通)/PublicMethod/LogicHandler.cs

@@ -37,6 +37,14 @@ namespace UAS_LabelMachine.PublicMethod
             adh.UpdateByCondition("prodiobarcode", "pib_ifpick=-1,pib_modify=-1", "pib_id=" + iPibID);
         }
 
+        public static void GetBarCode(string iPIID, string iPDID, int BarCodeNum, out string oBarCode)
+        {
+            oBarCode = "";
+            string[] param = new string[] { iPIID, iPDID, BarCodeNum.ToString(), "", "", "", "", "", "", oBarCode };
+            dh.CallProcedure("GETCUSTBARCODERULE", ref param);
+            oBarCode = param[9];
+        }
+
         /// <summary>
         /// 获取十六进制字节数组
         /// </summary>

+ 283 - 242
UAS-出货标签管理(吉利通)/UAS_出货标签管理.Designer.cs

@@ -132,33 +132,6 @@
             this.BackCheck = new UAS_LabelMachine.CustomControl.EnterTextBox();
             this.MessageLog = new UAS_LabelMachine.CustomControl.RichText.RichTextAutoBottom();
             this.LabelInf = new UAS_LabelMachine.CustomControl.DataGridViewWithSerialNum();
-            this.Choose = new System.Windows.Forms.DataGridViewCheckBoxColumn();
-            this.pib_id1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.rownum = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_pdno = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_prodcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_ifmodify = new System.Windows.Forms.DataGridViewCheckBoxColumn();
-            this.pib_ifupload = new System.Windows.Forms.DataGridViewCheckBoxColumn();
-            this.pr_vendprodcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_brand = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_madein = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pr_zxbzs = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pr_unit = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_lotno = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_datecode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_ifpick = new System.Windows.Forms.DataGridViewCheckBoxColumn();
-            this.pib_ifprint = new System.Windows.Forms.DataGridViewCheckBoxColumn();
-            this.pib_ifrecheck = new System.Windows.Forms.DataGridViewCheckBoxColumn();
-            this.pib_datecode1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_qty = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_barcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_custbarcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pd_pocode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pd_custprodcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pd_custprodspec = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pr_spec = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_outboxcode1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_outboxcode2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pi_inoutno = new UAS_LabelMachine.CustomControl.EnterTextBox();
             this.SingleLabel = new UAS_LabelMachine.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
             this.groupBoxWithBorder4 = new UAS_LabelMachine.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
@@ -220,6 +193,37 @@
             this.BackendCheck = new UAS_LabelMachine.CustomControl.SerialPortWithTag();
             this.FrontendCheck = new UAS_LabelMachine.CustomControl.SerialPortWithTag();
             this.PLC1 = new UAS_LabelMachine.CustomControl.SerialPortWithTag();
+            this.Choose = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+            this.pd_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_id1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.rownum = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_pdno = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_prodcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_ifmodify = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+            this.pib_ifupload = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+            this.pr_vendprodcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_brand = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_madein = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pr_orispeccode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pr_zxbzs = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pr_unit = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_lotno = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_datecode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_ifpick = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+            this.pib_ifprint = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+            this.pib_ifrecheck = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+            this.pib_datecode1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_qty = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_barcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_custbarcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_custmidboxcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_custoutboxcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pd_pocode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pd_custprodcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pd_custprodspec = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pr_spec = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_outboxcode1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_outboxcode2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.CollectionProcess.SuspendLayout();
             this.groupBox2.SuspendLayout();
             this.groupBox1.SuspendLayout();
@@ -1286,7 +1290,6 @@
             this.BackCheck.Str1 = null;
             this.BackCheck.Str2 = null;
             this.BackCheck.TabIndex = 54;
-            this.BackCheck.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Input_KeyDown);
             // 
             // MessageLog
             // 
@@ -1306,6 +1309,7 @@
             this.LabelInf.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
             this.LabelInf.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
             this.Choose,
+            this.pd_id,
             this.pib_id1,
             this.rownum,
             this.pib_pdno,
@@ -1315,6 +1319,7 @@
             this.pr_vendprodcode,
             this.pib_brand,
             this.pib_madein,
+            this.pr_orispeccode,
             this.pr_zxbzs,
             this.pr_unit,
             this.pib_lotno,
@@ -1326,6 +1331,8 @@
             this.pib_qty,
             this.pib_barcode,
             this.pib_custbarcode,
+            this.pib_custmidboxcode,
+            this.pib_custoutboxcode,
             this.pd_pocode,
             this.pd_custprodcode,
             this.pd_custprodspec,
@@ -1341,219 +1348,6 @@
             this.LabelInf.CellPainting += new System.Windows.Forms.DataGridViewCellPaintingEventHandler(this.LabelInf_CellPainting);
             this.LabelInf.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.LabelInf_DataError);
             // 
-            // Choose
-            // 
-            this.Choose.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            this.Choose.HeaderText = "勾选";
-            this.Choose.Name = "Choose";
-            this.Choose.Resizable = System.Windows.Forms.DataGridViewTriState.True;
-            this.Choose.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
-            this.Choose.Width = 55;
-            // 
-            // pib_id1
-            // 
-            this.pib_id1.DataPropertyName = "pib_id";
-            this.pib_id1.HeaderText = "pib_id";
-            this.pib_id1.Name = "pib_id1";
-            this.pib_id1.Visible = false;
-            this.pib_id1.Width = 66;
-            // 
-            // rownum
-            // 
-            this.rownum.DataPropertyName = "rownum";
-            this.rownum.HeaderText = "行号";
-            this.rownum.Name = "rownum";
-            this.rownum.Width = 54;
-            // 
-            // pib_pdno
-            // 
-            this.pib_pdno.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            this.pib_pdno.DataPropertyName = "pib_pdno";
-            this.pib_pdno.HeaderText = "明细序号";
-            this.pib_pdno.Name = "pib_pdno";
-            this.pib_pdno.ReadOnly = true;
-            this.pib_pdno.Width = 96;
-            // 
-            // pib_prodcode
-            // 
-            this.pib_prodcode.DataPropertyName = "pib_prodcode";
-            this.pib_prodcode.HeaderText = "物料编号";
-            this.pib_prodcode.Name = "pib_prodcode";
-            this.pib_prodcode.ReadOnly = true;
-            this.pib_prodcode.Width = 78;
-            // 
-            // pib_ifmodify
-            // 
-            this.pib_ifmodify.DataPropertyName = "pib_ifmodify";
-            this.pib_ifmodify.HeaderText = "已修改";
-            this.pib_ifmodify.Name = "pib_ifmodify";
-            this.pib_ifmodify.Resizable = System.Windows.Forms.DataGridViewTriState.True;
-            this.pib_ifmodify.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
-            this.pib_ifmodify.Width = 66;
-            // 
-            // pib_ifupload
-            // 
-            this.pib_ifupload.DataPropertyName = "pib_ifupload";
-            this.pib_ifupload.HeaderText = "已上传";
-            this.pib_ifupload.Name = "pib_ifupload";
-            this.pib_ifupload.Resizable = System.Windows.Forms.DataGridViewTriState.True;
-            this.pib_ifupload.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
-            this.pib_ifupload.Width = 66;
-            // 
-            // pr_vendprodcode
-            // 
-            this.pr_vendprodcode.DataPropertyName = "pr_vendprodcode";
-            this.pr_vendprodcode.HeaderText = "MPN";
-            this.pr_vendprodcode.Name = "pr_vendprodcode";
-            this.pr_vendprodcode.ReadOnly = true;
-            this.pr_vendprodcode.Width = 48;
-            // 
-            // pib_brand
-            // 
-            this.pib_brand.DataPropertyName = "pib_brand";
-            this.pib_brand.HeaderText = "品牌";
-            this.pib_brand.Name = "pib_brand";
-            this.pib_brand.ReadOnly = true;
-            this.pib_brand.Width = 54;
-            // 
-            // pib_madein
-            // 
-            this.pib_madein.DataPropertyName = "pib_madein";
-            this.pib_madein.HeaderText = "产地";
-            this.pib_madein.Name = "pib_madein";
-            this.pib_madein.Visible = false;
-            this.pib_madein.Width = 54;
-            // 
-            // pr_zxbzs
-            // 
-            this.pr_zxbzs.DataPropertyName = "pr_zxbzs";
-            this.pr_zxbzs.HeaderText = "最小包装数";
-            this.pr_zxbzs.Name = "pr_zxbzs";
-            this.pr_zxbzs.Visible = false;
-            this.pr_zxbzs.Width = 90;
-            // 
-            // pr_unit
-            // 
-            this.pr_unit.DataPropertyName = "pr_unit";
-            this.pr_unit.HeaderText = "单位";
-            this.pr_unit.Name = "pr_unit";
-            this.pr_unit.Width = 54;
-            // 
-            // pib_lotno
-            // 
-            this.pib_lotno.DataPropertyName = "pib_lotno";
-            this.pib_lotno.HeaderText = "LotNo";
-            this.pib_lotno.Name = "pib_lotno";
-            this.pib_lotno.Width = 60;
-            // 
-            // pib_datecode
-            // 
-            this.pib_datecode.DataPropertyName = "pib_datecode";
-            this.pib_datecode.HeaderText = "DateCode";
-            this.pib_datecode.Name = "pib_datecode";
-            this.pib_datecode.Width = 78;
-            // 
-            // pib_ifpick
-            // 
-            this.pib_ifpick.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            this.pib_ifpick.DataPropertyName = "pib_ifpick";
-            this.pib_ifpick.HeaderText = "已扫描";
-            this.pib_ifpick.Name = "pib_ifpick";
-            this.pib_ifpick.Width = 60;
-            // 
-            // pib_ifprint
-            // 
-            this.pib_ifprint.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            this.pib_ifprint.DataPropertyName = "pib_ifprint";
-            this.pib_ifprint.HeaderText = "已打标";
-            this.pib_ifprint.Name = "pib_ifprint";
-            this.pib_ifprint.Width = 60;
-            // 
-            // pib_ifrecheck
-            // 
-            this.pib_ifrecheck.DataPropertyName = "pib_ifrecheck";
-            this.pib_ifrecheck.HeaderText = "已复核";
-            this.pib_ifrecheck.Name = "pib_ifrecheck";
-            this.pib_ifrecheck.Width = 47;
-            // 
-            // pib_datecode1
-            // 
-            this.pib_datecode1.DataPropertyName = "pib_datecode1";
-            this.pib_datecode1.HeaderText = "DateCode1";
-            this.pib_datecode1.Name = "pib_datecode1";
-            this.pib_datecode1.Width = 84;
-            // 
-            // pib_qty
-            // 
-            this.pib_qty.DataPropertyName = "pib_qty";
-            this.pib_qty.HeaderText = "数量";
-            this.pib_qty.Name = "pib_qty";
-            this.pib_qty.ReadOnly = true;
-            this.pib_qty.Width = 54;
-            // 
-            // pib_barcode
-            // 
-            this.pib_barcode.DataPropertyName = "pib_barcode";
-            this.pib_barcode.HeaderText = "唯一条码";
-            this.pib_barcode.Name = "pib_barcode";
-            this.pib_barcode.ReadOnly = true;
-            this.pib_barcode.Width = 78;
-            // 
-            // pib_custbarcode
-            // 
-            this.pib_custbarcode.DataPropertyName = "pib_custbarcode";
-            this.pib_custbarcode.HeaderText = "客户条码";
-            this.pib_custbarcode.Name = "pib_custbarcode";
-            this.pib_custbarcode.ReadOnly = true;
-            this.pib_custbarcode.Width = 78;
-            // 
-            // pd_pocode
-            // 
-            this.pd_pocode.DataPropertyName = "pd_pocode";
-            this.pd_pocode.HeaderText = "客户PO";
-            this.pd_pocode.Name = "pd_pocode";
-            this.pd_pocode.ReadOnly = true;
-            this.pd_pocode.Width = 66;
-            // 
-            // pd_custprodcode
-            // 
-            this.pd_custprodcode.DataPropertyName = "pd_custprodcode";
-            this.pd_custprodcode.HeaderText = "客户料号";
-            this.pd_custprodcode.Name = "pd_custprodcode";
-            this.pd_custprodcode.ReadOnly = true;
-            this.pd_custprodcode.Width = 78;
-            // 
-            // pd_custprodspec
-            // 
-            this.pd_custprodspec.DataPropertyName = "pd_custprodspec";
-            this.pd_custprodspec.HeaderText = "客户型号";
-            this.pd_custprodspec.Name = "pd_custprodspec";
-            this.pd_custprodspec.ReadOnly = true;
-            this.pd_custprodspec.Width = 78;
-            // 
-            // pr_spec
-            // 
-            this.pr_spec.DataPropertyName = "pr_spec";
-            this.pr_spec.HeaderText = "规格";
-            this.pr_spec.Name = "pr_spec";
-            this.pr_spec.Width = 54;
-            // 
-            // pib_outboxcode1
-            // 
-            this.pib_outboxcode1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            this.pib_outboxcode1.DataPropertyName = "pib_outboxcode1";
-            this.pib_outboxcode1.HeaderText = "中盒号";
-            this.pib_outboxcode1.Name = "pib_outboxcode1";
-            this.pib_outboxcode1.Width = 90;
-            // 
-            // pib_outboxcode2
-            // 
-            this.pib_outboxcode2.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            this.pib_outboxcode2.DataPropertyName = "pib_outboxcode2";
-            this.pib_outboxcode2.HeaderText = "外箱号";
-            this.pib_outboxcode2.Name = "pib_outboxcode2";
-            this.pib_outboxcode2.Width = 90;
-            // 
             // pi_inoutno
             // 
             this.pi_inoutno.ID = null;
@@ -2273,6 +2067,249 @@
             // 
             this.PLC1.Tag = "PLC1";
             // 
+            // Choose
+            // 
+            this.Choose.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.Choose.HeaderText = "勾选";
+            this.Choose.Name = "Choose";
+            this.Choose.Resizable = System.Windows.Forms.DataGridViewTriState.True;
+            this.Choose.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
+            this.Choose.Width = 55;
+            // 
+            // pd_id
+            // 
+            this.pd_id.DataPropertyName = "pd_id";
+            this.pd_id.HeaderText = "pd_id";
+            this.pd_id.Name = "pd_id";
+            this.pd_id.Visible = false;
+            this.pd_id.Width = 60;
+            // 
+            // pib_id1
+            // 
+            this.pib_id1.DataPropertyName = "pib_id";
+            this.pib_id1.HeaderText = "pib_id";
+            this.pib_id1.Name = "pib_id1";
+            this.pib_id1.Visible = false;
+            this.pib_id1.Width = 66;
+            // 
+            // rownum
+            // 
+            this.rownum.DataPropertyName = "rownum";
+            this.rownum.HeaderText = "行号";
+            this.rownum.Name = "rownum";
+            this.rownum.Width = 54;
+            // 
+            // pib_pdno
+            // 
+            this.pib_pdno.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.pib_pdno.DataPropertyName = "pib_pdno";
+            this.pib_pdno.HeaderText = "明细序号";
+            this.pib_pdno.Name = "pib_pdno";
+            this.pib_pdno.ReadOnly = true;
+            this.pib_pdno.Width = 96;
+            // 
+            // pib_prodcode
+            // 
+            this.pib_prodcode.DataPropertyName = "pib_prodcode";
+            this.pib_prodcode.HeaderText = "物料编号";
+            this.pib_prodcode.Name = "pib_prodcode";
+            this.pib_prodcode.ReadOnly = true;
+            this.pib_prodcode.Width = 78;
+            // 
+            // pib_ifmodify
+            // 
+            this.pib_ifmodify.DataPropertyName = "pib_ifmodify";
+            this.pib_ifmodify.HeaderText = "已修改";
+            this.pib_ifmodify.Name = "pib_ifmodify";
+            this.pib_ifmodify.Resizable = System.Windows.Forms.DataGridViewTriState.True;
+            this.pib_ifmodify.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
+            this.pib_ifmodify.Width = 66;
+            // 
+            // pib_ifupload
+            // 
+            this.pib_ifupload.DataPropertyName = "pib_ifupload";
+            this.pib_ifupload.HeaderText = "已上传";
+            this.pib_ifupload.Name = "pib_ifupload";
+            this.pib_ifupload.Resizable = System.Windows.Forms.DataGridViewTriState.True;
+            this.pib_ifupload.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
+            this.pib_ifupload.Width = 66;
+            // 
+            // pr_vendprodcode
+            // 
+            this.pr_vendprodcode.DataPropertyName = "pr_vendprodcode";
+            this.pr_vendprodcode.HeaderText = "MPN";
+            this.pr_vendprodcode.Name = "pr_vendprodcode";
+            this.pr_vendprodcode.ReadOnly = true;
+            this.pr_vendprodcode.Visible = false;
+            this.pr_vendprodcode.Width = 48;
+            // 
+            // pib_brand
+            // 
+            this.pib_brand.DataPropertyName = "pib_brand";
+            this.pib_brand.HeaderText = "品牌";
+            this.pib_brand.Name = "pib_brand";
+            this.pib_brand.ReadOnly = true;
+            this.pib_brand.Width = 54;
+            // 
+            // pib_madein
+            // 
+            this.pib_madein.DataPropertyName = "pib_madein";
+            this.pib_madein.HeaderText = "产地";
+            this.pib_madein.Name = "pib_madein";
+            this.pib_madein.Visible = false;
+            this.pib_madein.Width = 54;
+            // 
+            // pr_orispeccode
+            // 
+            this.pr_orispeccode.DataPropertyName = "pr_orispeccode";
+            this.pr_orispeccode.HeaderText = "原厂型号";
+            this.pr_orispeccode.Name = "pr_orispeccode";
+            this.pr_orispeccode.Width = 78;
+            // 
+            // pr_zxbzs
+            // 
+            this.pr_zxbzs.DataPropertyName = "pr_zxbzs";
+            this.pr_zxbzs.HeaderText = "最小包装数";
+            this.pr_zxbzs.Name = "pr_zxbzs";
+            this.pr_zxbzs.Visible = false;
+            this.pr_zxbzs.Width = 90;
+            // 
+            // pr_unit
+            // 
+            this.pr_unit.DataPropertyName = "pr_unit";
+            this.pr_unit.HeaderText = "单位";
+            this.pr_unit.Name = "pr_unit";
+            this.pr_unit.Width = 54;
+            // 
+            // pib_lotno
+            // 
+            this.pib_lotno.DataPropertyName = "pib_lotno";
+            this.pib_lotno.HeaderText = "LotNo";
+            this.pib_lotno.Name = "pib_lotno";
+            this.pib_lotno.Width = 60;
+            // 
+            // pib_datecode
+            // 
+            this.pib_datecode.DataPropertyName = "pib_datecode";
+            this.pib_datecode.HeaderText = "DateCode";
+            this.pib_datecode.Name = "pib_datecode";
+            this.pib_datecode.Width = 78;
+            // 
+            // pib_ifpick
+            // 
+            this.pib_ifpick.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.pib_ifpick.DataPropertyName = "pib_ifpick";
+            this.pib_ifpick.HeaderText = "已扫描";
+            this.pib_ifpick.Name = "pib_ifpick";
+            this.pib_ifpick.Width = 60;
+            // 
+            // pib_ifprint
+            // 
+            this.pib_ifprint.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.pib_ifprint.DataPropertyName = "pib_ifprint";
+            this.pib_ifprint.HeaderText = "已打标";
+            this.pib_ifprint.Name = "pib_ifprint";
+            this.pib_ifprint.Width = 60;
+            // 
+            // pib_ifrecheck
+            // 
+            this.pib_ifrecheck.DataPropertyName = "pib_ifrecheck";
+            this.pib_ifrecheck.HeaderText = "已复核";
+            this.pib_ifrecheck.Name = "pib_ifrecheck";
+            this.pib_ifrecheck.Width = 47;
+            // 
+            // pib_datecode1
+            // 
+            this.pib_datecode1.DataPropertyName = "pib_datecode1";
+            this.pib_datecode1.HeaderText = "DateCode1";
+            this.pib_datecode1.Name = "pib_datecode1";
+            this.pib_datecode1.Width = 84;
+            // 
+            // pib_qty
+            // 
+            this.pib_qty.DataPropertyName = "pib_qty";
+            this.pib_qty.HeaderText = "数量";
+            this.pib_qty.Name = "pib_qty";
+            this.pib_qty.ReadOnly = true;
+            this.pib_qty.Width = 54;
+            // 
+            // pib_barcode
+            // 
+            this.pib_barcode.DataPropertyName = "pib_barcode";
+            this.pib_barcode.HeaderText = "唯一条码";
+            this.pib_barcode.Name = "pib_barcode";
+            this.pib_barcode.ReadOnly = true;
+            this.pib_barcode.Width = 78;
+            // 
+            // pib_custbarcode
+            // 
+            this.pib_custbarcode.DataPropertyName = "pib_custbarcode";
+            this.pib_custbarcode.HeaderText = "客户条码";
+            this.pib_custbarcode.Name = "pib_custbarcode";
+            this.pib_custbarcode.ReadOnly = true;
+            this.pib_custbarcode.Width = 78;
+            // 
+            // pib_custmidboxcode
+            // 
+            this.pib_custmidboxcode.DataPropertyName = "pib_custmidboxcode";
+            this.pib_custmidboxcode.HeaderText = "中盒条码";
+            this.pib_custmidboxcode.Name = "pib_custmidboxcode";
+            this.pib_custmidboxcode.Width = 78;
+            // 
+            // pib_custoutboxcode
+            // 
+            this.pib_custoutboxcode.DataPropertyName = "pib_custoutboxcode";
+            this.pib_custoutboxcode.HeaderText = "外箱条码";
+            this.pib_custoutboxcode.Name = "pib_custoutboxcode";
+            this.pib_custoutboxcode.Width = 78;
+            // 
+            // pd_pocode
+            // 
+            this.pd_pocode.DataPropertyName = "pd_pocode";
+            this.pd_pocode.HeaderText = "客户PO";
+            this.pd_pocode.Name = "pd_pocode";
+            this.pd_pocode.ReadOnly = true;
+            this.pd_pocode.Width = 66;
+            // 
+            // pd_custprodcode
+            // 
+            this.pd_custprodcode.DataPropertyName = "pd_custprodcode";
+            this.pd_custprodcode.HeaderText = "客户料号";
+            this.pd_custprodcode.Name = "pd_custprodcode";
+            this.pd_custprodcode.ReadOnly = true;
+            this.pd_custprodcode.Width = 78;
+            // 
+            // pd_custprodspec
+            // 
+            this.pd_custprodspec.DataPropertyName = "pd_custprodspec";
+            this.pd_custprodspec.HeaderText = "客户型号";
+            this.pd_custprodspec.Name = "pd_custprodspec";
+            this.pd_custprodspec.ReadOnly = true;
+            this.pd_custprodspec.Width = 78;
+            // 
+            // pr_spec
+            // 
+            this.pr_spec.DataPropertyName = "pr_spec";
+            this.pr_spec.HeaderText = "规格";
+            this.pr_spec.Name = "pr_spec";
+            this.pr_spec.Width = 54;
+            // 
+            // pib_outboxcode1
+            // 
+            this.pib_outboxcode1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.pib_outboxcode1.DataPropertyName = "pib_outboxcode1";
+            this.pib_outboxcode1.HeaderText = "中盒号";
+            this.pib_outboxcode1.Name = "pib_outboxcode1";
+            this.pib_outboxcode1.Width = 90;
+            // 
+            // pib_outboxcode2
+            // 
+            this.pib_outboxcode2.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.pib_outboxcode2.DataPropertyName = "pib_outboxcode2";
+            this.pib_outboxcode2.HeaderText = "外箱号";
+            this.pib_outboxcode2.Name = "pib_outboxcode2";
+            this.pib_outboxcode2.Width = 90;
+            // 
             // UAS_出货标签打印
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@@ -2518,7 +2555,9 @@
         private System.Windows.Forms.LinkLabel FirstPage;
         private System.Windows.Forms.LinkLabel LastPage;
         private System.Windows.Forms.Label PageNum;
+        private CustomControl.SerialPortWithTag PLC1;
         private System.Windows.Forms.DataGridViewCheckBoxColumn Choose;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pd_id;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_id1;
         private System.Windows.Forms.DataGridViewTextBoxColumn rownum;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_pdno;
@@ -2528,6 +2567,7 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn pr_vendprodcode;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_brand;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_madein;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pr_orispeccode;
         private System.Windows.Forms.DataGridViewTextBoxColumn pr_zxbzs;
         private System.Windows.Forms.DataGridViewTextBoxColumn pr_unit;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_lotno;
@@ -2539,12 +2579,13 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_qty;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_barcode;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_custbarcode;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pib_custmidboxcode;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pib_custoutboxcode;
         private System.Windows.Forms.DataGridViewTextBoxColumn pd_pocode;
         private System.Windows.Forms.DataGridViewTextBoxColumn pd_custprodcode;
         private System.Windows.Forms.DataGridViewTextBoxColumn pd_custprodspec;
         private System.Windows.Forms.DataGridViewTextBoxColumn pr_spec;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_outboxcode1;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_outboxcode2;
-        private CustomControl.SerialPortWithTag PLC1;
     }
 }

+ 94 - 71
UAS-出货标签管理(吉利通)/UAS_出货标签管理.cs

@@ -62,10 +62,6 @@ namespace UAS_LabelMachine
         /// 正则表达式用于项目匹配
         /// </summary>
         Regex reg;
-        /*标识供应商物料编号采集是否通过*/
-        bool CollectVeProdCodePass = true;
-
-        bool CollectQTYPass = true;
 
         bool logout = false;
 
@@ -234,6 +230,22 @@ namespace UAS_LabelMachine
                         }
                         else
                         {
+                            //勾选了单盘自动打印
+                            if (SingleLabelAutoPrint.Checked)
+                            {
+                                if (SingleLabelCombox.SelectedValue != null)
+                                {
+                                    AutoPrintSingleLabel();
+                                }
+                                else
+                                {
+                                    MessageBox.Show("未维护单盘标签");
+                                    return;
+                                }
+                            }
+                            //勾选了中盒自动打印
+                            if (MidLabelAutoPrint.Checked)
+                                AutoPrintMidLabel();
                             LabelInfDataTable.Rows[CurrentRowIndex]["pib_ifpick"] = true;
                             LabelInf.Refresh();
                         }
@@ -285,8 +297,10 @@ namespace UAS_LabelMachine
                 //成功获取到了分隔符号并且匹配的项次相等, 如果不包含分隔符只需要一项
                 if (matchs1.Value.ToString() != "" && ((SplitChar.Contains(Splitor.ToString()) && ItemIndex.Count == dt.Rows.Count) || (!SplitChar.Contains(Splitor.ToString()) && ItemIndex.Count == 1 && arr.Length == 1)))
                 {
+                    string ItemStr = "";
                     for (int j = 0; j < dt.Rows.Count; j++)
                     {
+                        ItemStr += dt.Rows[j]["si_item"].ToString() + ",";
                         string si_expression = dt.Rows[j]["si_expression"].ToString();
                         Regex si_exp;
                         switch (dt.Rows[j]["si_item"].ToString())
@@ -307,9 +321,17 @@ namespace UAS_LabelMachine
                                 break;
                             case "PN":
                                 PN = arr[ItemIndex[j]];
-                                if (LabelInfDataTable.Rows[CurrentRowIndex]["pd_custprodspec"].ToString() != PN)
+                                //自动匹配客户PN
+                                DataTable pndt = BaseUtil.filterDataTable(LabelInfDataTable, "pr_orispeccode='" + PN + "' and pib_ifpick=0 ");
+                                int rownum = 0;
+                                if (pndt.Rows.Count > 0)
+                                {
+                                    rownum = int.Parse(pndt.Rows[0]["rownum"].ToString());
+                                    CurrentRowIndex = rownum - 1;
+                                }
+                                else
                                 {
-                                    ErrorMsg = "客户物料型号不匹配";
+                                    ErrorMsg = "未能匹配到合适的原厂型号";
                                 }
                                 break;
                             case "Order":
@@ -329,10 +351,6 @@ namespace UAS_LabelMachine
                                 {
                                     QTY = arr[ItemIndex[j]];
                                 }
-                                if (LabelInfDataTable.Rows[CurrentRowIndex]["pib_qty"].ToString() != QTY.ToString())
-                                {
-                                    ErrorMsg = "数量不匹配";
-                                }
                                 break;
                             case "OutBox":
                                 OutBox = arr[ItemIndex[j]];
@@ -340,9 +358,16 @@ namespace UAS_LabelMachine
                             default:
                                 break;
                         }
-                      
                         index = index + 1;
                     }
+                    if (ErrorMsg == "" && ItemStr.Contains("QTY") && LabelInfDataTable.Rows[CurrentRowIndex]["pib_qty"].ToString() != QTY.ToString())
+                    {
+                        ErrorMsg = "数量不匹配";
+                    }
+                    if (ErrorMsg == "" && ItemStr.Contains("PO") && LabelInfDataTable.Rows[CurrentRowIndex]["pd_pocode"].ToString() != Order)
+                    {
+                        ErrorMsg = "订单号不匹配";
+                    }
                 }
                 else
                 {
@@ -365,6 +390,11 @@ namespace UAS_LabelMachine
             }
         }
 
+        //外箱条码号
+        string OutBoxBarCode = "";
+        //中盒条码号
+        string MidBoxBarCode = "";
+
         private void BackendCheckFunction(string msg, string pib_id)
         {
             DataTable dtt = LabelInf.DataSource as DataTable;
@@ -392,7 +422,7 @@ namespace UAS_LabelMachine
                             checkItemCount = checkItemCount + 1;
                         }
                     }
-                    if (msgArr[i] == LabelInf.Rows[CurrentRowIndex].Cells["pd_custprodspec"].Value.ToString())
+                    if (msgArr[i] == LabelInf.Rows[CurrentRowIndex].Cells["pr_orispeccode"].Value.ToString())
                     {
                         checkItemCount = checkItemCount + 1;
                     }
@@ -403,7 +433,7 @@ namespace UAS_LabelMachine
                     {
                         checkItemCount = checkItemCount + 1;
                     }
-                    if (msgArr[i] == LabelInf.Rows[CurrentRowIndex].Cells["pd_custprodspec"].Value.ToString())
+                    if (msgArr[i] == LabelInf.Rows[CurrentRowIndex].Cells["pr_orispeccode"].Value.ToString())
                     {
                         checkItemCount = checkItemCount + 1;
                     }
@@ -422,6 +452,7 @@ namespace UAS_LabelMachine
             int outboxcode1 = int.Parse(boxcode == "" ? "1" : boxcode);
             boxcode = adh.getFieldDataByCondition("prodiobarcode", "max(pib_outboxcode2)", "pib_inoutno='" + pi_inoutno.Text + "'").ToString();
             int outboxcode2 = int.Parse(boxcode == "" ? "1" : boxcode);
+            string pd_id = LabelInf.Rows[CurrentRowIndex].Cells["pd_id"].Value.ToString();
             //超过中盒容量中盒号+1
             if (adh.getRowCount("prodiobarcode", "pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode1=" + outboxcode1) >= MidBoxCapacity.Value)
             {
@@ -433,57 +464,95 @@ namespace UAS_LabelMachine
                 if (cu_print_midlotno.Checked)
                 {
                     if (LabelInf.Rows[CurrentRowIndex - 1].Cells["pib_lotno"].Value.ToString() != LabelInf.Rows[CurrentRowIndex].Cells["pib_lotno"].Value.ToString())
+                    {
+                        LogicHandler.GetBarCode(PI_ID, pd_id, 1, out MidBoxBarCode);
+                        LabelInfDataTable.Rows[CurrentRowIndex]["pib_custmidboxcode"] = MidBoxBarCode;
                         outboxcode1 = outboxcode1 + 1;
+                    }
                 }
                 else if (cu_print_midpo.Checked)
                 {
                     if (LabelInf.Rows[CurrentRowIndex - 1].Cells["pd_pocode"].Value.ToString() != LabelInf.Rows[CurrentRowIndex].Cells["pd_pocode"].Value.ToString())
+                    {
+                        LogicHandler.GetBarCode(PI_ID, pd_id, 1, out MidBoxBarCode);
+                        LabelInfDataTable.Rows[CurrentRowIndex]["pib_custmidboxcode"] = MidBoxBarCode;
                         outboxcode1 = outboxcode1 + 1;
+                    }
                 }
                 else if (cu_print_midprod.Checked)
                 {
-                    if (LabelInf.Rows[CurrentRowIndex - 1].Cells["pd_custprodcode"].Value.ToString() != LabelInf.Rows[CurrentRowIndex].Cells["pd_custprodcode"].Value.ToString())
+                    if (LabelInf.Rows[CurrentRowIndex - 1].Cells["pr_orispeccode"].Value.ToString() != LabelInf.Rows[CurrentRowIndex].Cells["pd_custprodcode"].Value.ToString())
+                    {
+                        LogicHandler.GetBarCode(PI_ID, pd_id, 1, out MidBoxBarCode);
+                        LabelInfDataTable.Rows[CurrentRowIndex]["pib_custmidboxcode"] = MidBoxBarCode;
                         outboxcode1 = outboxcode1 + 1;
+                    }
                 }
                 else if (cu_print_midspec.Checked)
                 {
                     if (LabelInf.Rows[CurrentRowIndex - 1].Cells["pd_custprodspec"].Value.ToString() != LabelInf.Rows[CurrentRowIndex].Cells["pd_custprodspec"].Value.ToString())
+                    {
+                        LogicHandler.GetBarCode(PI_ID, pd_id, 1, out MidBoxBarCode);
+                        LabelInfDataTable.Rows[CurrentRowIndex]["pib_custmidboxcode"] = MidBoxBarCode;
                         outboxcode1 = outboxcode1 + 1;
+                    }
+                }
+                if (MidBoxBarCode == "")
+                {
+                    LogicHandler.GetBarCode(PI_ID, pd_id, 1, out MidBoxBarCode);
                 }
+                LabelInfDataTable.Rows[CurrentRowIndex]["pib_custmidboxcode"] = MidBoxBarCode;
             }
             if (adh.getRowCount("prodiobarcode", "pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode2=" + outboxcode2) >= OutBoxCapacity.Value)
             {
                 outboxcode2 = outboxcode2 + 1;
+                LogicHandler.GetBarCode(PI_ID, pd_id, 1, out OutBoxBarCode);
+                LabelInfDataTable.Rows[CurrentRowIndex]["pib_custoutboxcode"] = OutBoxBarCode;
             }
             else if (CurrentRowIndex - 1 >= 0)
             {
-                //if (LabelInf.Rows[CurrentRowIndex - 1].Cells["pib_outboxcode1"].Value.ToString() != outboxcode1.ToString())
-                //    outboxcode2 = outboxcode2 + 1;
                 //或者不符合合并条件中盒号+1
                 if (cu_print_outlotno.Checked)
                 {
                     if (LabelInf.Rows[CurrentRowIndex - 1].Cells["pib_lotno"].Value.ToString() != LabelInf.Rows[CurrentRowIndex].Cells["pib_lotno"].Value.ToString())
-                        outboxcode2 = outboxcode2 + 1;
+                    {
+                        LogicHandler.GetBarCode(PI_ID, pd_id, 1, out OutBoxBarCode);
+                        LabelInfDataTable.Rows[CurrentRowIndex]["pib_custoutboxcode"] = OutBoxBarCode;
+                    }
                 }
                 else if (cu_print_outpo.Checked)
                 {
                     if (LabelInf.Rows[CurrentRowIndex - 1].Cells["pd_pocode"].Value.ToString() != LabelInf.Rows[CurrentRowIndex].Cells["pd_pocode"].Value.ToString())
-                        outboxcode2 = outboxcode2 + 1;
+                    {
+                        LogicHandler.GetBarCode(PI_ID, pd_id, 1, out OutBoxBarCode);
+                        LabelInfDataTable.Rows[CurrentRowIndex]["pib_custoutboxcode"] = OutBoxBarCode;
+                    }
                 }
                 else if (cu_print_outprod.Checked)
                 {
-                    if (LabelInf.Rows[CurrentRowIndex - 1].Cells["pd_custprodcode"].Value.ToString() != LabelInf.Rows[CurrentRowIndex].Cells["pd_custprodcode"].Value.ToString())
-                        outboxcode2 = outboxcode2 + 1;
+                    if (LabelInf.Rows[CurrentRowIndex - 1].Cells["pr_orispeccode"].Value.ToString() != LabelInf.Rows[CurrentRowIndex].Cells["pd_custprodcode"].Value.ToString())
+                    {
+                        LogicHandler.GetBarCode(PI_ID, pd_id, 1, out OutBoxBarCode);
+                        LabelInfDataTable.Rows[CurrentRowIndex]["pib_custoutboxcode"] = OutBoxBarCode;
+                    }
                 }
                 else if (cu_print_outspec.Checked)
                 {
                     if (LabelInf.Rows[CurrentRowIndex - 1].Cells["pd_custprodspec"].Value.ToString() != LabelInf.Rows[CurrentRowIndex].Cells["pd_custprodspec"].Value.ToString())
-                        outboxcode2 = outboxcode2 + 1;
+                    {
+                        LogicHandler.GetBarCode(PI_ID, pd_id, 1, out OutBoxBarCode);
+                        LabelInfDataTable.Rows[CurrentRowIndex]["pib_custoutboxcode"] = OutBoxBarCode;
+                    }
+                }
+                if (OutBoxBarCode == "")
+                {
+                    LogicHandler.GetBarCode(PI_ID, pd_id, 1, out OutBoxBarCode);
                 }
+                LabelInfDataTable.Rows[CurrentRowIndex]["pib_custoutboxcode"] = OutBoxBarCode;
             }
             LabelInfDataTable.Rows[CurrentRowIndex]["pib_outboxcode1"] = outboxcode1;
             LabelInfDataTable.Rows[CurrentRowIndex]["pib_outboxcode2"] = outboxcode2;
-            adh.ExecuteSql("update prodiobarcode set pib_outboxcode2=" + outboxcode2 + ",pib_outboxcode1=" + outboxcode1 + ",pib_lotno='" + LotNo + "',pib_datecode='" + DateCode + "',pib_ifpick=-1 where pib_id=" + pib_id, "update");
+            adh.ExecuteSql("update prodiobarcode set pib_outboxcode2=" + outboxcode2 + ",pib_outboxcode1=" + outboxcode1 + ",pib_custoutboxcode='" + OutBoxBarCode + "',pib_custmidboxcode='" + MidBoxBarCode + "',pib_lotno='" + LotNo + "',pib_datecode='" + DateCode + "',pib_ifpick=-1 where pib_id=" + pib_id, "update");
             LabelInf.Refresh();
             if (CurrentRowIndex + 1 < LabelInf.Rows.Count)
                 CurrentRowIndex = CurrentRowIndex + 1;
@@ -540,52 +609,6 @@ namespace UAS_LabelMachine
             }
         }
 
-        //输入框Enter事件
-        private void Input_KeyDown(object sender, KeyEventArgs e)
-        {
-            if (e.KeyCode == Keys.Enter)
-            {
-                if (BackCheck.Text == "")
-                {
-                    MessageBox.Show("采集的数据不能为空");
-                    return;
-                }
-                CollectInputData();
-            }
-        }
-
-        /// <summary>
-        /// 采集数据
-        /// </summary>
-        private void CollectInputData()
-        {
-            //数据校验均已通过则勾选上已采集
-            if (CollectVeProdCodePass && CollectQTYPass)
-            {
-                //如果按盒号采集,所有的此盒的均更新为
-                LabelInfDataTable.Rows[CurrentRowIndex]["pib_ifpick"] = true;
-                LogicHandler.UpdateRowPicked(LabelInf.Rows[CurrentRowIndex].Cells["pib_id"].Value);
-                //勾选了单盘自动打印
-                if (SingleLabelAutoPrint.Checked)
-                {
-                    if (SingleLabelCombox.SelectedValue != null)
-                    {
-                        AutoPrintSingleLabel();
-                    }
-                    else
-                    {
-                        MessageBox.Show("未维护单盘标签");
-                        return;
-                    }
-                }
-                //勾选了中盒自动打印
-                if (MidLabelAutoPrint.Checked)
-                    AutoPrintMidLabel();
-            }
-            RefreshProcessData();
-            MessageLog.AppendText(">>扫描到数据" + BackCheck.Text + "\n", Color.Blue);
-        }
-
         private void AutoPrintSingleLabel()
         {
             //用标签本身的变量作为最外层的循环条件去匹配;
@@ -747,7 +770,7 @@ namespace UAS_LabelMachine
                     if (dh.GetConfig("AutoBarcode", "ProdInOut!Sale").ToString() != "")
                     {
                         string[] param = new string[] { PI_ID, "", "" };
-                        dh.CallProcedure("GetCustBarcode", param);
+                        dh.CallProcedure("GetCustBarcode", ref param);
                     }
                     //获取客户自定义设置
                     sql.Clear();
@@ -1312,7 +1335,7 @@ namespace UAS_LabelMachine
             {
                 //嵌套查询重置RowNum
                 sql.Clear();
-                sql.Append("select t.*,rownum from (select pd_custprodcode,pib_indate,pi_date,pib_inoutno,pd_custprodspec,nvl(pib_ifrecheck,0)pib_ifrecheck,nvl(pib_ifupload,0)pib_ifupload,nvl(pib_ifmodify,0)pib_ifmodify,pd_pocode,pib_madein,pib_custbarcode,pib_custoutboxcode,");
+                sql.Append("select t.*,rownum from (select pib_custoutboxcode,pib_custmidboxcode,pr_orispeccode,pd_id,pd_custprodcode,pib_indate,pi_date,pib_inoutno,pd_custprodspec,nvl(pib_ifrecheck,0)pib_ifrecheck,nvl(pib_ifupload,0)pib_ifupload,nvl(pib_ifmodify,0)pib_ifmodify,pd_pocode,pib_madein,pib_custbarcode,");
                 sql.Append("pib_id,pib_pdid,pib_piid,pib_pdno,pib_prodcode,nvl(nvl(pd_brand,pib_brand),pr_brand)pib_brand, pr_vendprodcode,pib_lotno,pib_datecode,pib_qty,pr_spec,pi_title,pr_zxbzs,pr_unit,pib_barcode,pib_outboxcode1,");
                 sql.Append("pib_outboxcode2,nvl(pib_ifpick,0)pib_ifpick,nvl(pib_ifprint,0)pib_ifprint from prodiobarcode left join prodinout on pib_piid=pi_id left join prodiodetail on pib_piid=pd_piid and pd_pdno=pib_pdno and ");
                 sql.Append("pd_prodcode=pib_prodcode left join product on pr_code=pib_prodcode left join sale on sa_code=pib_ordercode where pib_piid='" + PI_ID + "' order by to_number(pib_id))t");
@@ -1355,7 +1378,7 @@ namespace UAS_LabelMachine
                 back_sg_separator.Text = dt.Rows[0]["splitfront"].ToString();
             }
             //获取所有的匹配脚本
-            ScanGroup = (DataTable)dh.ExecuteSql("select distinct sg_brand,sg_id,sg_name,sg_script from prodiobarcode left join scangroup on pib_brand=sg_brand where pib_inoutno='" + pi_inoutno.Text + "' and sg_id is not null and nvl(sg_autolabel,0)<>0", "select");
+            ScanGroup = (DataTable)dh.ExecuteSql("select distinct sg_brand,sg_id,sg_name,sg_script from prodiobarcode left join scangroup on pib_brand=sg_brand where pib_inoutno='" + pi_inoutno.Text + "' and sg_id is not null and nvl(sg_autolabel,0)=0", "select");
             //绑定数据之后往下找到未采集的数据显示在当前采集的栏目
             for (int i = 0; i < LabelInf.RowCount; i++)
             {

+ 12 - 0
UAS-出货标签管理(吉利通)/UAS_出货标签管理.resx

@@ -123,6 +123,9 @@
   <metadata name="RefreshDBConnect.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     <value>17, 17</value>
   </metadata>
+  <metadata name="pd_id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
   <metadata name="rownum.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
@@ -135,6 +138,9 @@
   <metadata name="pib_madein.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
+  <metadata name="pr_orispeccode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
   <metadata name="pr_zxbzs.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
@@ -150,6 +156,12 @@
   <metadata name="pib_custbarcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
+  <metadata name="pib_custmidboxcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="pib_custoutboxcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
   <metadata name="pd_custprodcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>

+ 2 - 2
UAS-出货标签管理(吉利通)/采集策略_NEW.cs

@@ -68,13 +68,13 @@ namespace UAS_LabelMachine
             if (e.Node.Level == 1)
             {
                 SGID = e.Node.Tag.ToString();
-                dt = (DataTable)dh.ExecuteSql("select sg_name,sg_script,sg_step,sg_autolabel from scangroup where sg_id=" + SGID, "select");
+                dt = (DataTable)dh.ExecuteSql("select sg_name,sg_script,sg_step,nvl(sg_autolabel,0)sg_autolabel from scangroup where sg_id=" + SGID, "select");
                 if (dt.Rows.Count > 0)
                 {
                     sg_name.Text = dt.Rows[0]["sg_name"].ToString();
                     sg_script.Text = dt.Rows[0]["sg_script"].ToString();
                     sg_step.Text = dt.Rows[0]["sg_step"].ToString();
-                    sg_autolabel.Checked = dt.Rows[0]["sg_name"].ToString() == "0" ? false : true;
+                    sg_autolabel.Checked = dt.Rows[0]["sg_autolabel"].ToString() == "0" ? false : true;
                 }
                 dt = (DataTable)dh.ExecuteSql("select si_item,si_expression,si_remark,si_name,si_enable from scanitem where si_sgid=" + SGID + "order by si_id", "select");
                 if (dt.Rows.Count > 0)