Browse Source

添加KEC品牌解析规则

章政 8 years ago
parent
commit
2873d3744f

+ 194 - 193
UAS-出货标签管理/UAS_出货标签管理.Designer.cs

@@ -119,27 +119,6 @@
             this.sg_code = new UAS_LabelMachine.CustomControl.SearchTextBox();
             this.MessageLog = new UAS_LabelMachine.CustomControl.RichText.RichTextAutoBottom();
             this.LabelInf = new UAS_LabelMachine.CustomControl.DataGridViewWithSerialNum();
-            this.Choose = new System.Windows.Forms.DataGridViewCheckBoxColumn();
-            this.pib_ifpick = new System.Windows.Forms.DataGridViewCheckBoxColumn();
-            this.pib_ifprint = new System.Windows.Forms.DataGridViewCheckBoxColumn();
-            this.pib_id1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_pdno = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_prodcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pr_vendprodcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pr_brand = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_madein = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_lotno = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_datecode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_cusbarcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_cusoutboxcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.DateCode1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_qty = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_barcode = 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.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.ViVoPlate = new System.Windows.Forms.Button();
@@ -173,6 +152,27 @@
             this.OutBoxLabelPrint = new System.Windows.Forms.Button();
             this.OutBoxLabelAutoPrint = new System.Windows.Forms.CheckBox();
             this.OutBoxCombox = new System.Windows.Forms.ComboBox();
+            this.Choose = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+            this.pib_ifpick = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+            this.pib_ifprint = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+            this.pib_id1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_pdno = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_prodcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pr_vendprodcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pr_brand = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_madein = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_lotno = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_datecode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_cusbarcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_cusoutboxcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            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.pd_pocode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pd_custprodcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pd_custprodspec = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_outboxcode1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_outboxcode2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             ((System.ComponentModel.ISupportInitialize)(this.Si_ItemDGV)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.MidSource)).BeginInit();
             this.groupBoxWithBorder1.SuspendLayout();
@@ -1079,7 +1079,7 @@
             this.pib_datecode,
             this.pib_cusbarcode,
             this.pib_cusoutboxcode,
-            this.DateCode1,
+            this.pib_datecode1,
             this.pib_qty,
             this.pib_barcode,
             this.pd_pocode,
@@ -1098,167 +1098,6 @@
             this.LabelInf.CellValueChanged += new System.Windows.Forms.DataGridViewCellEventHandler(this.LabelInf_CellValueChanged);
             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_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_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;
-            // 
-            // 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;
-            // 
-            // 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;
-            // 
-            // pr_brand
-            // 
-            this.pr_brand.DataPropertyName = "pr_brand";
-            this.pr_brand.HeaderText = "品牌";
-            this.pr_brand.Name = "pr_brand";
-            this.pr_brand.Width = 54;
-            // 
-            // pib_madein
-            // 
-            this.pib_madein.DataPropertyName = "pib_madein";
-            this.pib_madein.HeaderText = "产地";
-            this.pib_madein.Name = "pib_madein";
-            this.pib_madein.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_cusbarcode
-            // 
-            this.pib_cusbarcode.DataPropertyName = "pib_cusbarcode";
-            this.pib_cusbarcode.HeaderText = "ViVo条码号";
-            this.pib_cusbarcode.Name = "pib_cusbarcode";
-            this.pib_cusbarcode.Width = 90;
-            // 
-            // pib_cusoutboxcode
-            // 
-            this.pib_cusoutboxcode.DataPropertyName = "pib_cusoutboxcode";
-            this.pib_cusoutboxcode.HeaderText = "ViVo外箱";
-            this.pib_cusoutboxcode.Name = "pib_cusoutboxcode";
-            this.pib_cusoutboxcode.Width = 78;
-            // 
-            // DateCode1
-            // 
-            this.DateCode1.HeaderText = "DateCode1";
-            this.DateCode1.Name = "DateCode1";
-            this.DateCode1.Visible = false;
-            this.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;
-            // 
-            // 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.Width = 78;
-            // 
-            // pd_custprodspec
-            // 
-            this.pd_custprodspec.DataPropertyName = "pd_custprodspec";
-            this.pd_custprodspec.HeaderText = "客户型号";
-            this.pd_custprodspec.Name = "pd_custprodspec";
-            this.pd_custprodspec.Width = 78;
-            // 
-            // 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;
@@ -1666,6 +1505,168 @@
             this.OutBoxCombox.TabIndex = 78;
             this.OutBoxCombox.SelectedIndexChanged += new System.EventHandler(this.OutBoxCombox_SelectedIndexChanged);
             // 
+            // 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_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_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;
+            // 
+            // 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;
+            // 
+            // 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;
+            // 
+            // pr_brand
+            // 
+            this.pr_brand.DataPropertyName = "pr_brand";
+            this.pr_brand.HeaderText = "品牌";
+            this.pr_brand.Name = "pr_brand";
+            this.pr_brand.Width = 54;
+            // 
+            // pib_madein
+            // 
+            this.pib_madein.DataPropertyName = "pib_madein";
+            this.pib_madein.HeaderText = "产地";
+            this.pib_madein.Name = "pib_madein";
+            this.pib_madein.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_cusbarcode
+            // 
+            this.pib_cusbarcode.DataPropertyName = "pib_cusbarcode";
+            this.pib_cusbarcode.HeaderText = "ViVo条码号";
+            this.pib_cusbarcode.Name = "pib_cusbarcode";
+            this.pib_cusbarcode.Width = 90;
+            // 
+            // pib_cusoutboxcode
+            // 
+            this.pib_cusoutboxcode.DataPropertyName = "pib_cusoutboxcode";
+            this.pib_cusoutboxcode.HeaderText = "ViVo外箱";
+            this.pib_cusoutboxcode.Name = "pib_cusoutboxcode";
+            this.pib_cusoutboxcode.Width = 78;
+            // 
+            // pib_datecode1
+            // 
+            this.pib_datecode1.DataPropertyName = "pib_datecode1";
+            this.pib_datecode1.HeaderText = "DateCode1";
+            this.pib_datecode1.Name = "pib_datecode1";
+            this.pib_datecode1.Visible = false;
+            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;
+            // 
+            // 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.Width = 78;
+            // 
+            // pd_custprodspec
+            // 
+            this.pd_custprodspec.DataPropertyName = "pd_custprodspec";
+            this.pd_custprodspec.HeaderText = "客户型号";
+            this.pd_custprodspec.Name = "pd_custprodspec";
+            this.pd_custprodspec.Width = 78;
+            // 
+            // 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);
@@ -1853,6 +1854,15 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn23;
         private System.Windows.Forms.BindingSource MidSource;
         private System.Windows.Forms.Button ChooseAll;
+        private CustomControl.GroupBoxWithBorder.GroupBoxWithBorder groupBoxWithBorder1;
+        private System.Windows.Forms.Label label7;
+        private System.Windows.Forms.Label label12;
+        private CustomControl.EnterTextBox SingleBoxEnd;
+        private CustomControl.EnterTextBox SingleBoxBegin;
+        private System.Windows.Forms.Label label16;
+        private System.Windows.Forms.Label label18;
+        private CustomControl.EnterTextBox MidBoxEnd;
+        private CustomControl.EnterTextBox MidBoxBegin;
         private System.Windows.Forms.DataGridViewCheckBoxColumn Choose;
         private System.Windows.Forms.DataGridViewCheckBoxColumn pib_ifpick;
         private System.Windows.Forms.DataGridViewCheckBoxColumn pib_ifprint;
@@ -1866,7 +1876,7 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_datecode;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_cusbarcode;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_cusoutboxcode;
-        private System.Windows.Forms.DataGridViewTextBoxColumn DateCode1;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pib_datecode1;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_qty;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_barcode;
         private System.Windows.Forms.DataGridViewTextBoxColumn pd_pocode;
@@ -1874,14 +1884,5 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn pd_custprodspec;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_outboxcode1;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_outboxcode2;
-        private CustomControl.GroupBoxWithBorder.GroupBoxWithBorder groupBoxWithBorder1;
-        private System.Windows.Forms.Label label7;
-        private System.Windows.Forms.Label label12;
-        private CustomControl.EnterTextBox SingleBoxEnd;
-        private CustomControl.EnterTextBox SingleBoxBegin;
-        private System.Windows.Forms.Label label16;
-        private System.Windows.Forms.Label label18;
-        private CustomControl.EnterTextBox MidBoxEnd;
-        private CustomControl.EnterTextBox MidBoxBegin;
     }
 }

+ 16 - 16
UAS-出货标签管理/UAS_出货标签管理.cs

@@ -204,7 +204,7 @@ namespace UAS_LabelMachine
             //怡海能达添加的特殊字段
             if (DataHelper.DBConnectionString.Contains("sz.hi-mantech.com") || DataHelper.DBConnectionString.Contains("192.168.1.200"))
             {
-                DateCode1.Visible = true;
+                pib_datecode1.Visible = true;
                 SingleLabelAutoPrint.Checked = true;
                 MidLabelAutoPrint.Checked = true;
             }
@@ -667,8 +667,8 @@ namespace UAS_LabelMachine
                     }
                     else if (SingleDoc.Variables.FreeVariables.Item(j + 1).Name == "DateCode1")
                     {
-                        if (LabelInf.Rows[CurrentRowIndex].Cells["DateCode1"].Value != null)
-                            SingleDoc.Variables.FreeVariables.Item(j + 1).Value = LabelInf.Rows[CurrentRowIndex].Cells["DateCode1"].Value.ToString();
+                        if (LabelInf.Rows[CurrentRowIndex].Cells["pib_datecode1"].Value != null)
+                            SingleDoc.Variables.FreeVariables.Item(j + 1).Value = LabelInf.Rows[CurrentRowIndex].Cells["pib_datecode1"].Value.ToString();
                     }
                 }
             }
@@ -1196,8 +1196,8 @@ namespace UAS_LabelMachine
                             {
                                 if (SingleDoc.Variables.FreeVariables.Item(j + 1).Name.ToLower().Contains("datecode1"))
                                 {
-                                    if (LabelInf.Rows[i].Cells["DateCode1"].Value != null)
-                                        SingleDoc.Variables.FreeVariables.Item(j + 1).Value = LabelInf.Rows[i].Cells["DateCode1"].Value.ToString();
+                                    if (LabelInf.Rows[i].Cells["pib_datecode1"].Value != null)
+                                        SingleDoc.Variables.FreeVariables.Item(j + 1).Value = LabelInf.Rows[i].Cells["pib_datecode1"].Value.ToString();
                                 }
                                 else if (SingleDoc.Variables.FreeVariables.Item(j + 1).Name.ToLower().Contains("lotno"))
                                 {
@@ -1645,8 +1645,8 @@ namespace UAS_LabelMachine
                                 DataRow[] dr = MidBoxCacheData.Select("pib_outboxcode1='" + pib_outboxcode1 + "'");
                                 if (MidDoc.Variables.FreeVariables.Item(j + 1).Name.ToLower().Contains("datecode1"))
                                 {
-                                    if (LabelInf.Rows[rowindex].Cells["DateCode1"].Value != null)
-                                        MidDoc.Variables.FreeVariables.Item(j + 1).Value = LabelInf.Rows[rowindex].Cells["DateCode1"].Value.ToString();
+                                    if (LabelInf.Rows[rowindex].Cells["pib_datecode1"].Value != null)
+                                        MidDoc.Variables.FreeVariables.Item(j + 1).Value = LabelInf.Rows[rowindex].Cells["pib_datecode1"].Value.ToString();
                                 }
                                 else if (MidDoc.Variables.FreeVariables.Item(j + 1).Name.ToLower().Contains("lotno"))
                                 {
@@ -1709,8 +1709,8 @@ namespace UAS_LabelMachine
                             {
                                 if (MidDoc.Variables.FreeVariables.Item(j + 1).Name.ToLower().Contains("datecode1"))
                                 {
-                                    if (LabelInf.Rows[rowindex].Cells["DateCode1"].Value != null)
-                                        MidDoc.Variables.FreeVariables.Item(j + 1).Value = LabelInf.Rows[rowindex].Cells["DateCode1"].Value.ToString();
+                                    if (LabelInf.Rows[rowindex].Cells["pib_datecode1"].Value != null)
+                                        MidDoc.Variables.FreeVariables.Item(j + 1).Value = LabelInf.Rows[rowindex].Cells["pib_datecode1"].Value.ToString();
                                 }
                                 else if (MidDoc.Variables.FreeVariables.Item(j + 1).Name.ToLower().Contains("lotno"))
                                 {
@@ -1807,9 +1807,9 @@ namespace UAS_LabelMachine
                     }
                     else if (MidDoc.Variables.FreeVariables.Item(j + 1).Name == "DateCode1")
                     {
-                        if (LabelInf.Rows[rowindex].Cells["DateCode1"].Value != null)
+                        if (LabelInf.Rows[rowindex].Cells["pib_datecode1"].Value != null)
                         {
-                            MidDoc.Variables.FreeVariables.Item(j + 1).Value = LabelInf.Rows[rowindex].Cells["DateCode1"].Value.ToString();
+                            MidDoc.Variables.FreeVariables.Item(j + 1).Value = LabelInf.Rows[rowindex].Cells["pib_datecode1"].Value.ToString();
                         }
                     }
                 }
@@ -1885,9 +1885,9 @@ namespace UAS_LabelMachine
                         }
                         else if (OutBoxDoc.Variables.FreeVariables.Item(j + 1).Name == "DateCode1")
                         {
-                            if (LabelInf.Rows[rowindex].Cells["DateCode1"].Value != null)
+                            if (LabelInf.Rows[rowindex].Cells["pib_datecode1"].Value != null)
                             {
-                                OutBoxDoc.Variables.FreeVariables.Item(j + 1).Value = LabelInf.Rows[rowindex].Cells["DateCode1"].Value.ToString();
+                                OutBoxDoc.Variables.FreeVariables.Item(j + 1).Value = LabelInf.Rows[rowindex].Cells["pib_datecode1"].Value.ToString();
                             }
                         }
                     }
@@ -2004,7 +2004,7 @@ namespace UAS_LabelMachine
             else
             {
                 sql.Clear();
-                sql.Append("select pd_custprodcode,pd_custprodspec,pd_pocode,pib_madein,pib_id,pib_pdid,pib_piid,pib_pdno,pib_prodcode,pr_brand,pr_vendprodcode,");
+                sql.Append("select pd_custprodcode,pd_custprodspec,pd_pocode,pib_madein,pib_id,pib_datecode1,pib_pdid,pib_piid,pib_pdno,pib_prodcode,pr_brand,pr_vendprodcode,");
                 sql.Append("pib_lotno,pib_datecode,pib_qty,pib_barcode,pib_outboxcode1,pib_outboxcode2,nvl(pib_ifpick,0)pib_ifpick,nvl(pib_ifprint,0)pib_ifprint");
                 sql.Append(",sa_pocode from prodiobarcode 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 ");
@@ -2216,9 +2216,9 @@ namespace UAS_LabelMachine
                     GregorianCalendar gc = new GregorianCalendar();
                     int weekOfYear = gc.GetWeekOfYear(dt, CalendarWeekRule.FirstDay, DayOfWeek.Monday);
                     if (weekOfYear < 10)
-                        LabelInf.Rows[e.RowIndex].Cells["DateCode1"].Value = dt.Year.ToString().Substring(2, 2) + "0" + weekOfYear;
+                        LabelInf.Rows[e.RowIndex].Cells["pib_datecode1"].Value = dt.Year.ToString().Substring(2, 2) + "0" + weekOfYear;
                     else
-                        LabelInf.Rows[e.RowIndex].Cells["DateCode1"].Value = dt.Year.ToString().Substring(2, 2) + weekOfYear;
+                        LabelInf.Rows[e.RowIndex].Cells["pib_datecode1"].Value = dt.Year.ToString().Substring(2, 2) + weekOfYear;
                 }
                 catch (Exception) { }
             }

+ 1 - 1
UAS-出货标签管理/UAS_出货标签管理.resx

@@ -153,7 +153,7 @@
   <metadata name="pib_cusoutboxcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
-  <metadata name="DateCode1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+  <metadata name="pib_datecode1.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">

BIN
UAS-出货标签管理/tool/Analysis.dll


+ 46 - 0
UAS-特殊解析规则/Analysis.cs

@@ -59,10 +59,56 @@ namespace UAS_特殊解析规则
                         ReturnData = Year + Month + Day;
                     }
                     break;
+                case "KEC":
+                    if (item.ToUpper() == "LOTNO" || item.ToUpper() == "DATECODE")
+                    {
+                        string Year = Data.Substring(0, 1);
+                        string Week = Data.Substring(1, 2);
+                        DateTime DateBegin = DateTime.Now;
+                        GetDaysOfWeeks(int.Parse("201"+Year), int.Parse(Week), out DateBegin);
+                        ReturnData = DateBegin.ToString("yyyyMMdd");
+                    }
+                    break;
                 default:
                     break;
             }
             return ReturnData;
         }
+
+        public static bool GetDaysOfWeeks(int year, int index, out DateTime first)
+        {
+            first = DateTime.MinValue;
+            if (year < 1700 || year > 9999)
+            {
+                //"年份超限"
+                return false;
+            }
+            if (index < 1 || index > 53)
+            {
+                //"周数错误"
+                return false;
+            }
+            DateTime startDay = new DateTime(year, 1, 1);  //该年第一天
+            DateTime endDay = new DateTime(year + 1, 1, 1).AddMilliseconds(-1);
+            int dayOfWeek = 0;
+            if (Convert.ToInt32(startDay.DayOfWeek.ToString("d")) > 0)
+                dayOfWeek = Convert.ToInt32(startDay.DayOfWeek.ToString("d"));  //该年第一天为星期几
+            if (dayOfWeek == 7) { dayOfWeek = 0; }
+            if (index == 1)
+            {
+                first = startDay;
+            }
+            else
+            {
+                first = startDay.AddDays((7 - dayOfWeek) + (index - 2) * 7); //index周的起始日期
+               
+            }
+            if (first > endDay)  //startDayOfWeeks不在该年范围内
+            {
+                //"输入周数大于本年最大周数";
+                return false;
+            }
+            return true;
+        }
     }
 }