Browse Source

添加DC合并条件

章政 6 years ago
parent
commit
bbf01507f7

+ 30 - 0
UAS-出货标签管理(吉利通)/CustomerRule.Designer.cs

@@ -53,6 +53,8 @@
             this.CustProdAndSpec = new System.Windows.Forms.RadioButton();
             this.BarcodeAndSpec = new System.Windows.Forms.RadioButton();
             this.groupBox1 = new System.Windows.Forms.GroupBox();
+            this.cu_print_middc = new System.Windows.Forms.CheckBox();
+            this.cu_print_outdc = new System.Windows.Forms.CheckBox();
             ((System.ComponentModel.ISupportInitialize)(this.cu_print_papercount)).BeginInit();
             this.groupBox1.SuspendLayout();
             this.SuspendLayout();
@@ -318,11 +320,37 @@
             this.groupBox1.TabIndex = 62;
             this.groupBox1.TabStop = false;
             // 
+            // cu_print_middc
+            // 
+            this.cu_print_middc.AutoSize = true;
+            this.cu_print_middc.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.cu_print_middc.Location = new System.Drawing.Point(866, 376);
+            this.cu_print_middc.Name = "cu_print_middc";
+            this.cu_print_middc.Size = new System.Drawing.Size(84, 25);
+            this.cu_print_middc.TabIndex = 63;
+            this.cu_print_middc.Tag = "DateCode";
+            this.cu_print_middc.Text = "合并DC";
+            this.cu_print_middc.UseVisualStyleBackColor = true;
+            // 
+            // cu_print_outdc
+            // 
+            this.cu_print_outdc.AutoSize = true;
+            this.cu_print_outdc.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.cu_print_outdc.Location = new System.Drawing.Point(866, 472);
+            this.cu_print_outdc.Name = "cu_print_outdc";
+            this.cu_print_outdc.Size = new System.Drawing.Size(84, 25);
+            this.cu_print_outdc.TabIndex = 64;
+            this.cu_print_outdc.Tag = "DateCode";
+            this.cu_print_outdc.Text = "合并DC";
+            this.cu_print_outdc.UseVisualStyleBackColor = true;
+            // 
             // CustomerRule
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(1082, 634);
+            this.Controls.Add(this.cu_print_outdc);
+            this.Controls.Add(this.cu_print_middc);
             this.Controls.Add(this.groupBox1);
             this.Controls.Add(this.label5);
             this.Controls.Add(this.Equal);
@@ -382,5 +410,7 @@
         private System.Windows.Forms.RadioButton CustProdAndSpec;
         private System.Windows.Forms.RadioButton BarcodeAndSpec;
         private System.Windows.Forms.GroupBox groupBox1;
+        private System.Windows.Forms.CheckBox cu_print_middc;
+        private System.Windows.Forms.CheckBox cu_print_outdc;
     }
 }

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

@@ -50,7 +50,7 @@ namespace UAS_LabelMachine
             {
                 CUCODE = e.Node.Tag.ToString();
                 sql.Clear();
-                sql.Append("select cu_print_midlotno,cu_print_midspec,cu_print_midpo,cu_print_midprod,nvl(cu_print_custprodmatchmodel,'Equal')cu_print_custprodmatchmodel,cu_print_outlotno,cu_print_outspec,cu_print_outpo");
+                sql.Append("select cu_print_midlotno,cu_print_midspec,cu_print_recheck,cu_print_midpo,cu_print_midprod,nvl(cu_print_custprodmatchmodel,'Equal')cu_print_custprodmatchmodel,cu_print_outlotno,cu_print_outspec,cu_print_outpo");
                 sql.Append(",cu_print_outprod,cu_print_checkonly,nvl(cu_print_papercount,0)cu_print_papercount,cu_print_regexpression from customer where cu_code='" + e.Node.Tag + "'");
                 dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
                 if (dt.Rows.Count > 0)
@@ -67,6 +67,17 @@ namespace UAS_LabelMachine
                         default:
                             break;
                     }
+                    switch (dt.Rows[0]["cu_print_recheck"].ToString())
+                    {
+                        case "BR":
+                            BarcodeAndSpec.Checked = true;
+                            break;
+                        case "CP":
+                            CustProdAndSpec.Checked = true;
+                            break;
+                        default:
+                            break;
+                    }
                 }
             }
         }
@@ -78,6 +89,8 @@ namespace UAS_LabelMachine
             sql.Append("cu_print_midspec='" + (cu_print_midspec.Checked ? -1 : 0) + "',");
             sql.Append("cu_print_midpo='" + (cu_print_midpo.Checked ? -1 : 0) + "',");
             sql.Append("cu_print_midprod='" + (cu_print_midprod.Checked ? -1 : 0) + "',");
+            sql.Append("cu_print_middc='" + (cu_print_middc.Checked ? -1 : 0) + "',");
+            sql.Append("cu_print_outdc='" + (cu_print_outdc.Checked ? -1 : 0) + "',");
             sql.Append("cu_print_outlotno='" + (cu_print_outlotno.Checked ? -1 : 0) + "',");
             sql.Append("cu_print_outspec='" + (cu_print_outspec.Checked ? -1 : 0) + "',");
             sql.Append("cu_print_outpo='" + (cu_print_outpo.Checked ? -1 : 0) + "',");

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

@@ -156,6 +156,7 @@
             this.LeastPrintNum = new System.Windows.Forms.NumericUpDown();
             this.OnlyPrint = new System.Windows.Forms.CheckBox();
             this.groupBoxWithBorder2 = new UAS_LabelMachine.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
+            this.cu_print_middc = new System.Windows.Forms.CheckBox();
             this.cu_print_midprod = new System.Windows.Forms.CheckBox();
             this.cu_print_midpo = new System.Windows.Forms.CheckBox();
             this.cu_print_midspec = new System.Windows.Forms.CheckBox();
@@ -177,6 +178,7 @@
             this.label9 = new System.Windows.Forms.Label();
             this.cu_print_papercount = new System.Windows.Forms.NumericUpDown();
             this.groupBoxWithBorder3 = new UAS_LabelMachine.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
+            this.cu_print_outdc = new System.Windows.Forms.CheckBox();
             this.cu_print_outprod = new System.Windows.Forms.CheckBox();
             this.cu_print_outpo = new System.Windows.Forms.CheckBox();
             this.cu_print_outspec = new System.Windows.Forms.CheckBox();
@@ -1599,7 +1601,7 @@
             // 
             this.label2.AutoSize = true;
             this.label2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label2.Location = new System.Drawing.Point(162, 122);
+            this.label2.Location = new System.Drawing.Point(26, 173);
             this.label2.Name = "label2";
             this.label2.Size = new System.Drawing.Size(32, 17);
             this.label2.TabIndex = 94;
@@ -1609,7 +1611,7 @@
             // 
             this.label1.AutoSize = true;
             this.label1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label1.Location = new System.Drawing.Point(250, 122);
+            this.label1.Location = new System.Drawing.Point(114, 173);
             this.label1.Name = "label1";
             this.label1.Size = new System.Drawing.Size(20, 17);
             this.label1.TabIndex = 93;
@@ -1618,7 +1620,7 @@
             // LeastPrintNum
             // 
             this.LeastPrintNum.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.LeastPrintNum.Location = new System.Drawing.Point(201, 119);
+            this.LeastPrintNum.Location = new System.Drawing.Point(65, 170);
             this.LeastPrintNum.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.LeastPrintNum.Name = "LeastPrintNum";
             this.LeastPrintNum.Size = new System.Drawing.Size(44, 23);
@@ -1638,20 +1640,33 @@
             // 
             // groupBoxWithBorder2
             // 
+            this.groupBoxWithBorder2.Controls.Add(this.cu_print_middc);
             this.groupBoxWithBorder2.Controls.Add(this.cu_print_midprod);
             this.groupBoxWithBorder2.Controls.Add(this.cu_print_midpo);
             this.groupBoxWithBorder2.Controls.Add(this.cu_print_midspec);
             this.groupBoxWithBorder2.Controls.Add(this.cu_print_midlotno);
             this.groupBoxWithBorder2.Font = new System.Drawing.Font("微软雅黑", 9F);
-            this.groupBoxWithBorder2.Location = new System.Drawing.Point(172, 143);
+            this.groupBoxWithBorder2.Location = new System.Drawing.Point(172, 126);
             this.groupBoxWithBorder2.Margin = new System.Windows.Forms.Padding(2);
             this.groupBoxWithBorder2.Name = "groupBoxWithBorder2";
             this.groupBoxWithBorder2.Padding = new System.Windows.Forms.Padding(2);
-            this.groupBoxWithBorder2.Size = new System.Drawing.Size(101, 121);
+            this.groupBoxWithBorder2.Size = new System.Drawing.Size(101, 138);
             this.groupBoxWithBorder2.TabIndex = 81;
             this.groupBoxWithBorder2.TabStop = false;
             this.groupBoxWithBorder2.Text = "合并条件";
             // 
+            // cu_print_middc
+            // 
+            this.cu_print_middc.AutoSize = true;
+            this.cu_print_middc.Font = new System.Drawing.Font("微软雅黑", 9F);
+            this.cu_print_middc.Location = new System.Drawing.Point(13, 115);
+            this.cu_print_middc.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.cu_print_middc.Name = "cu_print_middc";
+            this.cu_print_middc.Size = new System.Drawing.Size(68, 21);
+            this.cu_print_middc.TabIndex = 97;
+            this.cu_print_middc.Text = "合并DC";
+            this.cu_print_middc.UseVisualStyleBackColor = true;
+            // 
             // cu_print_midprod
             // 
             this.cu_print_midprod.AutoSize = true;
@@ -1889,20 +1904,33 @@
             // 
             // groupBoxWithBorder3
             // 
+            this.groupBoxWithBorder3.Controls.Add(this.cu_print_outdc);
             this.groupBoxWithBorder3.Controls.Add(this.cu_print_outprod);
             this.groupBoxWithBorder3.Controls.Add(this.cu_print_outpo);
             this.groupBoxWithBorder3.Controls.Add(this.cu_print_outspec);
             this.groupBoxWithBorder3.Controls.Add(this.cu_print_outlotno);
             this.groupBoxWithBorder3.Font = new System.Drawing.Font("微软雅黑", 9F);
-            this.groupBoxWithBorder3.Location = new System.Drawing.Point(172, 143);
+            this.groupBoxWithBorder3.Location = new System.Drawing.Point(172, 126);
             this.groupBoxWithBorder3.Margin = new System.Windows.Forms.Padding(2);
             this.groupBoxWithBorder3.Name = "groupBoxWithBorder3";
             this.groupBoxWithBorder3.Padding = new System.Windows.Forms.Padding(2);
-            this.groupBoxWithBorder3.Size = new System.Drawing.Size(101, 121);
+            this.groupBoxWithBorder3.Size = new System.Drawing.Size(101, 138);
             this.groupBoxWithBorder3.TabIndex = 96;
             this.groupBoxWithBorder3.TabStop = false;
             this.groupBoxWithBorder3.Text = "合并条件";
             // 
+            // cu_print_outdc
+            // 
+            this.cu_print_outdc.AutoSize = true;
+            this.cu_print_outdc.Font = new System.Drawing.Font("微软雅黑", 9F);
+            this.cu_print_outdc.Location = new System.Drawing.Point(13, 115);
+            this.cu_print_outdc.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.cu_print_outdc.Name = "cu_print_outdc";
+            this.cu_print_outdc.Size = new System.Drawing.Size(68, 21);
+            this.cu_print_outdc.TabIndex = 96;
+            this.cu_print_outdc.Text = "合并DC";
+            this.cu_print_outdc.UseVisualStyleBackColor = true;
+            // 
             // cu_print_outprod
             // 
             this.cu_print_outprod.AutoSize = true;
@@ -2102,12 +2130,12 @@
             // 
             // pib_pdno
             // 
-            this.pib_pdno.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.pib_pdno.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader;
             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;
+            this.pib_pdno.Width = 78;
             // 
             // pib_prodcode
             // 
@@ -2298,19 +2326,19 @@
             // 
             // pib_outboxcode1
             // 
-            this.pib_outboxcode1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.pib_outboxcode1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader;
             this.pib_outboxcode1.DataPropertyName = "pib_outboxcode1";
             this.pib_outboxcode1.HeaderText = "中盒号";
             this.pib_outboxcode1.Name = "pib_outboxcode1";
-            this.pib_outboxcode1.Width = 90;
+            this.pib_outboxcode1.Width = 66;
             // 
             // pib_outboxcode2
             // 
-            this.pib_outboxcode2.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.pib_outboxcode2.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader;
             this.pib_outboxcode2.DataPropertyName = "pib_outboxcode2";
             this.pib_outboxcode2.HeaderText = "外箱号";
             this.pib_outboxcode2.Name = "pib_outboxcode2";
-            this.pib_outboxcode2.Width = 90;
+            this.pib_outboxcode2.Width = 66;
             // 
             // UAS_出货标签打印
             // 
@@ -2558,6 +2586,8 @@
         private System.Windows.Forms.LinkLabel LastPage;
         private System.Windows.Forms.Label PageNum;
         private CustomControl.SerialPortWithTag PLC1;
+        private System.Windows.Forms.CheckBox cu_print_outdc;
+        private System.Windows.Forms.CheckBox cu_print_middc;
         private System.Windows.Forms.DataGridViewCheckBoxColumn Choose;
         private System.Windows.Forms.DataGridViewTextBoxColumn pd_id;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_id1;

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

@@ -497,6 +497,15 @@ namespace UAS_LabelMachine
                         outboxcode1 = outboxcode1 + 1;
                     }
                 }
+                else if (cu_print_middc.Checked)
+                {
+                    if (LabelInf.Rows[CurrentRowIndex - 1].Cells["pib_datecode"].Value.ToString() != LabelInf.Rows[CurrentRowIndex].Cells["pib_datecode"].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);
@@ -544,6 +553,14 @@ namespace UAS_LabelMachine
                         LabelInfDataTable.Rows[CurrentRowIndex]["pib_custoutboxcode"] = OutBoxBarCode;
                     }
                 }
+                else if (cu_print_outdc.Checked)
+                {
+                    if (LabelInf.Rows[CurrentRowIndex - 1].Cells["pib_datecode"].Value.ToString() != LabelInf.Rows[CurrentRowIndex].Cells["pib_datecode"].Value.ToString())
+                    {
+                        LogicHandler.GetBarCode(PI_ID, pd_id, 1, out MidBoxBarCode);
+                        LabelInfDataTable.Rows[CurrentRowIndex]["pib_custoutboxcode"] = OutBoxBarCode;
+                    }
+                }
                 if (OutBoxBarCode == "")
                 {
                     LogicHandler.GetBarCode(PI_ID, pd_id, 1, out OutBoxBarCode);
@@ -774,7 +791,7 @@ namespace UAS_LabelMachine
                     }
                     //获取客户自定义设置
                     sql.Clear();
-                    sql.Append("select cu_print_midlotno,nvl(cu_print_custprodmatchmodel,'Equal')cu_print_custprodmatchmodel,cu_print_midspec,cu_print_midpo,cu_print_midprod,cu_print_outlotno,cu_print_outspec,cu_print_outpo");
+                    sql.Append("select cu_print_middc,cu_print_outdc,cu_print_midlotno,nvl(cu_print_custprodmatchmodel,'Equal')cu_print_custprodmatchmodel,cu_print_midspec,cu_print_midpo,cu_print_midprod,cu_print_outlotno,cu_print_outspec,cu_print_outpo");
                     sql.Append(",cu_print_outprod,cu_print_checkonly,nvl(cu_print_papercount,0)cu_print_papercount,cu_print_regexpression,cu_print_recheck from customer where cu_code='" + pi_cardcode.Text + "'");
                     dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
                     if (dt.Rows.Count > 0)