浏览代码

实力修改提交

callm 5 年之前
父节点
当前提交
7662e5c5a8

+ 1 - 1
UAS-出货标签管理(泽天)/PublicMethod/DataHelper.cs

@@ -958,7 +958,7 @@ namespace UAS_LabelMachine
             {
                 command.Parameters.Add(new OracleParameter(names[0][i - 1].ToString(), OracleDbType.Varchar2, names[i], ParameterDirection.Input));
             }
-            int rowsnum=(command.ExecuteNonQuery());
+            int rowsnum = (command.ExecuteNonQuery());
             command.Dispose();
             return rowsnum;
         }

+ 9 - 9
UAS-出货标签管理(泽天)/UAS_出货标签管理.cs

@@ -115,14 +115,14 @@ namespace UAS_LabelMachine
             Text = Text + "-" + Master;
         }
 
-        protected override void WndProc(ref Message m)
-        {
-            //拦截双击标题栏、移动窗体的系统消息
-            if (m.Msg != 0xA3)
-            {
-                base.WndProc(ref m);
-            }
-        }
+        //protected override void WndProc(ref Message m)
+        //{
+        //    //拦截双击标题栏、移动窗体的系统消息
+        //    if (m.Msg != 0xA3)
+        //    {
+        //        base.WndProc(ref m);
+        //    }
+        //}
 
         delegate void BindDataSource(DataGridView dgv, DataTable dt);//定义委托
 
@@ -871,7 +871,7 @@ namespace UAS_LabelMachine
                     }
                 }
                 //如果有选中行
-                if (SelectRowIndex >= 0)
+                if (SelectRowIndex >= 0 && LabelInf.Rows.Count > SelectRowIndex)
                 {
                     MidOutBoxCode.Clear();
                     MidOutBoxCodeIndex.Clear();

+ 38 - 10
UAS-出货标签管理(贸易版)/DateCodeSetAndPrint.Designer.cs

@@ -36,11 +36,13 @@
             this.loadingCircle2 = new UAS_LabelMachine.CustomControl.SetLoading.LoadingCircle();
             this.End = new UAS_LabelMachine.CustomControl.EnterTextBox();
             this.label2 = new System.Windows.Forms.Label();
+            this.datecode = new UAS_LabelMachine.CustomControl.EnterTextBox();
+            this.label3 = new System.Windows.Forms.Label();
             this.SuspendLayout();
             // 
             // SetValue
             // 
-            this.SetValue.Location = new System.Drawing.Point(295, 299);
+            this.SetValue.Location = new System.Drawing.Point(293, 319);
             this.SetValue.Margin = new System.Windows.Forms.Padding(4);
             this.SetValue.Name = "SetValue";
             this.SetValue.Size = new System.Drawing.Size(142, 40);
@@ -51,17 +53,17 @@
             // lotno_label
             // 
             this.lotno_label.AutoSize = true;
-            this.lotno_label.Location = new System.Drawing.Point(136, 214);
+            this.lotno_label.Location = new System.Drawing.Point(136, 171);
             this.lotno_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.lotno_label.Name = "lotno_label";
-            this.lotno_label.Size = new System.Drawing.Size(58, 24);
+            this.lotno_label.Size = new System.Drawing.Size(70, 24);
             this.lotno_label.TabIndex = 4;
-            this.lotno_label.Text = "批号";
+            this.lotno_label.Text = "LOTNO";
             // 
             // lotno
             // 
             this.lotno.ID = null;
-            this.lotno.Location = new System.Drawing.Point(268, 206);
+            this.lotno.Location = new System.Drawing.Point(268, 163);
             this.lotno.Margin = new System.Windows.Forms.Padding(4);
             this.lotno.Name = "lotno";
             this.lotno.Size = new System.Drawing.Size(228, 35);
@@ -73,7 +75,7 @@
             // Begin
             // 
             this.Begin.ID = null;
-            this.Begin.Location = new System.Drawing.Point(268, 143);
+            this.Begin.Location = new System.Drawing.Point(268, 100);
             this.Begin.Margin = new System.Windows.Forms.Padding(4);
             this.Begin.Name = "Begin";
             this.Begin.Size = new System.Drawing.Size(86, 35);
@@ -85,7 +87,7 @@
             // label1
             // 
             this.label1.AutoSize = true;
-            this.label1.Location = new System.Drawing.Point(136, 149);
+            this.label1.Location = new System.Drawing.Point(136, 106);
             this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label1.Name = "label1";
             this.label1.Size = new System.Drawing.Size(58, 24);
@@ -97,7 +99,7 @@
             this.loadingCircle2.Active = false;
             this.loadingCircle2.Color = System.Drawing.Color.DarkGray;
             this.loadingCircle2.InnerCircleRadius = 5;
-            this.loadingCircle2.Location = new System.Drawing.Point(410, 137);
+            this.loadingCircle2.Location = new System.Drawing.Point(410, 94);
             this.loadingCircle2.Margin = new System.Windows.Forms.Padding(4);
             this.loadingCircle2.Name = "loadingCircle2";
             this.loadingCircle2.NumberSpoke = 12;
@@ -112,7 +114,7 @@
             // End
             // 
             this.End.ID = null;
-            this.End.Location = new System.Drawing.Point(410, 143);
+            this.End.Location = new System.Drawing.Point(410, 100);
             this.End.Margin = new System.Windows.Forms.Padding(4);
             this.End.Name = "End";
             this.End.Size = new System.Drawing.Size(86, 35);
@@ -124,18 +126,42 @@
             // label2
             // 
             this.label2.AutoSize = true;
-            this.label2.Location = new System.Drawing.Point(371, 148);
+            this.label2.Location = new System.Drawing.Point(371, 105);
             this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label2.Name = "label2";
             this.label2.Size = new System.Drawing.Size(22, 24);
             this.label2.TabIndex = 12;
             this.label2.Text = "-";
             // 
+            // datecode
+            // 
+            this.datecode.ID = null;
+            this.datecode.Location = new System.Drawing.Point(268, 230);
+            this.datecode.Margin = new System.Windows.Forms.Padding(4);
+            this.datecode.Name = "datecode";
+            this.datecode.Size = new System.Drawing.Size(228, 35);
+            this.datecode.Str = null;
+            this.datecode.Str1 = null;
+            this.datecode.Str2 = null;
+            this.datecode.TabIndex = 14;
+            // 
+            // label3
+            // 
+            this.label3.AutoSize = true;
+            this.label3.Location = new System.Drawing.Point(136, 238);
+            this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(34, 24);
+            this.label3.TabIndex = 13;
+            this.label3.Text = "DC";
+            // 
             // DateCodeSetAndPrint
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(730, 397);
+            this.Controls.Add(this.datecode);
+            this.Controls.Add(this.label3);
             this.Controls.Add(this.label2);
             this.Controls.Add(this.End);
             this.Controls.Add(this.Begin);
@@ -162,5 +188,7 @@
         private CustomControl.SetLoading.LoadingCircle loadingCircle2;
         private CustomControl.EnterTextBox End;
         private System.Windows.Forms.Label label2;
+        private CustomControl.EnterTextBox datecode;
+        private System.Windows.Forms.Label label3;
     }
 }

+ 1 - 1
UAS-出货标签管理(贸易版)/PublicMethod/BaseUtil.cs

@@ -923,7 +923,7 @@ namespace UAS_LabelMachine
                 }
                 catch (Exception ex)
                 {
-                  
+                    Console.WriteLine(ex.Message);
                 }
             }
         }

+ 14 - 9
UAS-出货标签管理(贸易版)/PublicMethod/DataHelper.cs

@@ -65,14 +65,17 @@ namespace UAS_LabelMachine
         ////Oracle端口
         //public static readonly string OraclePort = "1521";
 
-        ////华商龙外网地址
-        //private readonly string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=YITOA_DATACENTER;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=218.18.115.198)(PORT=1523)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
-        ////华商龙ERP地址
-        //public static readonly string ERPAddesss = "http://218.18.115.198:8888/ERP/";
-        ////华商龙FTP
-        //public static readonly string FTPAddress = "ftp://218.18.115.198:21|Print|Administrator1@#";
+        //private readonly string ConnectionStrings = "Data Source=192.168.101.88/orcl;User ID=ZJT_T;PassWord=select!#%*(";
+
+        //private readonly string IPConnectionStrings = "Data Source=192.168.101.88/orcl;User ID=ZJT_T;PassWord=select!#%*(";
+        ////海创ERP地址
+        //public static readonly string ERPAddesss = "http://192.168.101.88:8090/ERP/";
+        ////海创FTP
+        //public static readonly string FTPAddress = "ftp://192.168.101.88|vsftpd|vsftpd";
+
+        //public static readonly string InnerFTPAddress = "ftp://192.168.101.88|vsftpd|vsftpd";
         ////Oracle端口
-        //public static readonly string OraclePort = "1523";
+        //public static readonly string OraclePort = "1521";
 
         public static string DBConnectionString;
         static OracleConnection connection = null;
@@ -100,10 +103,12 @@ namespace UAS_LabelMachine
                 }
                 connection.Open();
             }
-            catch (Exception e) {
+            catch (Exception e)
+            {
                 connection = new OracleConnection(IPConnectionStrings);
                 connection.Open();
-                LogManager.DoLog(e.Message); }
+                LogManager.DoLog(e.Message);
+            }
         }
 
         /// <summary>

+ 68 - 38
UAS-出货标签管理(贸易版)/UAS_出货标签管理.Designer.cs

@@ -104,6 +104,8 @@
             this.CustBarCode = new System.Windows.Forms.Button();
             this.cu_code = new UAS_LabelMachine.CustomControl.SearchTextBox();
             this.groupBoxWithBorder1 = new UAS_LabelMachine.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
+            this.Order_Prod = new System.Windows.Forms.RadioButton();
+            this.Order_Detno = new System.Windows.Forms.RadioButton();
             this.label18 = new System.Windows.Forms.Label();
             this.MidBoxEnd = new UAS_LabelMachine.CustomControl.EnterTextBox();
             this.MidBoxBegin = new UAS_LabelMachine.CustomControl.EnterTextBox();
@@ -888,6 +890,8 @@
             // 
             // groupBoxWithBorder1
             // 
+            this.groupBoxWithBorder1.Controls.Add(this.Order_Prod);
+            this.groupBoxWithBorder1.Controls.Add(this.Order_Detno);
             this.groupBoxWithBorder1.Controls.Add(this.label18);
             this.groupBoxWithBorder1.Controls.Add(this.MidBoxEnd);
             this.groupBoxWithBorder1.Controls.Add(this.MidBoxBegin);
@@ -905,11 +909,35 @@
             this.groupBoxWithBorder1.TabStop = false;
             this.groupBoxWithBorder1.Text = " 打印参数设置";
             // 
+            // Order_Prod
+            // 
+            this.Order_Prod.AutoSize = true;
+            this.Order_Prod.Checked = true;
+            this.Order_Prod.Location = new System.Drawing.Point(49, 360);
+            this.Order_Prod.Name = "Order_Prod";
+            this.Order_Prod.Size = new System.Drawing.Size(149, 28);
+            this.Order_Prod.TabIndex = 92;
+            this.Order_Prod.TabStop = true;
+            this.Order_Prod.Text = "订单+料号";
+            this.Order_Prod.UseVisualStyleBackColor = true;
+            this.Order_Prod.Visible = false;
+            // 
+            // Order_Detno
+            // 
+            this.Order_Detno.AutoSize = true;
+            this.Order_Detno.Location = new System.Drawing.Point(49, 417);
+            this.Order_Detno.Name = "Order_Detno";
+            this.Order_Detno.Size = new System.Drawing.Size(149, 28);
+            this.Order_Detno.TabIndex = 91;
+            this.Order_Detno.Text = "订单+序号";
+            this.Order_Detno.UseVisualStyleBackColor = true;
+            this.Order_Detno.Visible = false;
+            // 
             // label18
             // 
             this.label18.AutoSize = true;
             this.label18.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label18.Location = new System.Drawing.Point(139, 277);
+            this.label18.Location = new System.Drawing.Point(140, 278);
             this.label18.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label18.Name = "label18";
             this.label18.Size = new System.Drawing.Size(24, 31);
@@ -944,7 +972,7 @@
             // 
             this.label16.AutoSize = true;
             this.label16.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label16.Location = new System.Drawing.Point(137, 131);
+            this.label16.Location = new System.Drawing.Point(138, 132);
             this.label16.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label16.Name = "label16";
             this.label16.Size = new System.Drawing.Size(24, 31);
@@ -979,7 +1007,7 @@
             // 
             this.label12.AutoSize = true;
             this.label12.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label12.Location = new System.Drawing.Point(21, 223);
+            this.label12.Location = new System.Drawing.Point(22, 224);
             this.label12.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label12.Name = "label12";
             this.label12.Size = new System.Drawing.Size(110, 31);
@@ -990,7 +1018,7 @@
             // 
             this.label7.AutoSize = true;
             this.label7.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label7.Location = new System.Drawing.Point(21, 81);
+            this.label7.Location = new System.Drawing.Point(22, 82);
             this.label7.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label7.Name = "label7";
             this.label7.Size = new System.Drawing.Size(110, 31);
@@ -1044,7 +1072,7 @@
             // 
             this.Capacity.AutoSize = true;
             this.Capacity.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.Capacity.Location = new System.Drawing.Point(119, 137);
+            this.Capacity.Location = new System.Drawing.Point(120, 138);
             this.Capacity.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.Capacity.Name = "Capacity";
             this.Capacity.Size = new System.Drawing.Size(0, 31);
@@ -1054,7 +1082,7 @@
             // 
             this.Process_midboxcode.AutoSize = true;
             this.Process_midboxcode.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.Process_midboxcode.Location = new System.Drawing.Point(119, 225);
+            this.Process_midboxcode.Location = new System.Drawing.Point(120, 226);
             this.Process_midboxcode.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.Process_midboxcode.Name = "Process_midboxcode";
             this.Process_midboxcode.Size = new System.Drawing.Size(28, 31);
@@ -1065,7 +1093,7 @@
             // 
             this.Process_outboxcode.AutoSize = true;
             this.Process_outboxcode.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.Process_outboxcode.Location = new System.Drawing.Point(119, 177);
+            this.Process_outboxcode.Location = new System.Drawing.Point(120, 178);
             this.Process_outboxcode.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.Process_outboxcode.Name = "Process_outboxcode";
             this.Process_outboxcode.Size = new System.Drawing.Size(28, 31);
@@ -1077,7 +1105,7 @@
             this.TotalCount.AutoSize = true;
             this.TotalCount.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.TotalCount.ForeColor = System.Drawing.Color.Blue;
-            this.TotalCount.Location = new System.Drawing.Point(187, 41);
+            this.TotalCount.Location = new System.Drawing.Point(188, 42);
             this.TotalCount.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.TotalCount.Name = "TotalCount";
             this.TotalCount.Size = new System.Drawing.Size(28, 31);
@@ -1088,7 +1116,7 @@
             // 
             this.label17.AutoSize = true;
             this.label17.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label17.Location = new System.Drawing.Point(159, 41);
+            this.label17.Location = new System.Drawing.Point(160, 42);
             this.label17.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label17.Name = "label17";
             this.label17.Size = new System.Drawing.Size(24, 31);
@@ -1100,7 +1128,7 @@
             this.CollectedCount.AutoSize = true;
             this.CollectedCount.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.CollectedCount.ForeColor = System.Drawing.Color.Red;
-            this.CollectedCount.Location = new System.Drawing.Point(123, 41);
+            this.CollectedCount.Location = new System.Drawing.Point(124, 42);
             this.CollectedCount.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.CollectedCount.Name = "CollectedCount";
             this.CollectedCount.Size = new System.Drawing.Size(28, 31);
@@ -1111,7 +1139,7 @@
             // 
             this.label14.AutoSize = true;
             this.label14.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label14.Location = new System.Drawing.Point(19, 177);
+            this.label14.Location = new System.Drawing.Point(20, 178);
             this.label14.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label14.Name = "label14";
             this.label14.Size = new System.Drawing.Size(62, 31);
@@ -1122,7 +1150,7 @@
             // 
             this.label11.AutoSize = true;
             this.label11.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label11.Location = new System.Drawing.Point(19, 223);
+            this.label11.Location = new System.Drawing.Point(20, 224);
             this.label11.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label11.Name = "label11";
             this.label11.Size = new System.Drawing.Size(62, 31);
@@ -1133,7 +1161,7 @@
             // 
             this.label13.AutoSize = true;
             this.label13.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label13.Location = new System.Drawing.Point(19, 97);
+            this.label13.Location = new System.Drawing.Point(20, 98);
             this.label13.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label13.Name = "label13";
             this.label13.Size = new System.Drawing.Size(86, 31);
@@ -1144,7 +1172,7 @@
             // 
             this.Installed.AutoSize = true;
             this.Installed.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.Installed.Location = new System.Drawing.Point(119, 97);
+            this.Installed.Location = new System.Drawing.Point(120, 98);
             this.Installed.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.Installed.Name = "Installed";
             this.Installed.Size = new System.Drawing.Size(0, 31);
@@ -1154,7 +1182,7 @@
             // 
             this.Process.AutoSize = true;
             this.Process.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.Process.Location = new System.Drawing.Point(19, 41);
+            this.Process.Location = new System.Drawing.Point(20, 42);
             this.Process.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.Process.Name = "Process";
             this.Process.Size = new System.Drawing.Size(86, 31);
@@ -1536,7 +1564,7 @@
             // 
             this.LabelSpace.AutoSize = true;
             this.LabelSpace.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.LabelSpace.Location = new System.Drawing.Point(19, 279);
+            this.LabelSpace.Location = new System.Drawing.Point(20, 280);
             this.LabelSpace.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.LabelSpace.Name = "LabelSpace";
             this.LabelSpace.Size = new System.Drawing.Size(142, 35);
@@ -1549,7 +1577,7 @@
             // 
             this.label8.AutoSize = true;
             this.label8.Font = new System.Drawing.Font("微软雅黑", 10F);
-            this.label8.Location = new System.Drawing.Point(11, 41);
+            this.label8.Location = new System.Drawing.Point(12, 42);
             this.label8.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label8.Name = "label8";
             this.label8.Size = new System.Drawing.Size(102, 35);
@@ -1559,7 +1587,7 @@
             // SingleDocRefresh
             // 
             this.SingleDocRefresh.AutoSize = true;
-            this.SingleDocRefresh.Location = new System.Drawing.Point(119, 41);
+            this.SingleDocRefresh.Location = new System.Drawing.Point(120, 42);
             this.SingleDocRefresh.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.SingleDocRefresh.Name = "SingleDocRefresh";
             this.SingleDocRefresh.Size = new System.Drawing.Size(82, 41);
@@ -1582,7 +1610,7 @@
             // 
             this.SingleLabelPrint.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
             this.SingleLabelPrint.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.SingleLabelPrint.Location = new System.Drawing.Point(137, 415);
+            this.SingleLabelPrint.Location = new System.Drawing.Point(160, 417);
             this.SingleLabelPrint.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.SingleLabelPrint.Name = "SingleLabelPrint";
             this.SingleLabelPrint.Size = new System.Drawing.Size(136, 52);
@@ -1595,7 +1623,7 @@
             // 
             this.SingleLabelAutoPrint.AutoSize = true;
             this.SingleLabelAutoPrint.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.SingleLabelAutoPrint.Location = new System.Drawing.Point(21, 223);
+            this.SingleLabelAutoPrint.Location = new System.Drawing.Point(22, 224);
             this.SingleLabelAutoPrint.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.SingleLabelAutoPrint.Name = "SingleLabelAutoPrint";
             this.SingleLabelAutoPrint.Size = new System.Drawing.Size(142, 35);
@@ -1643,7 +1671,7 @@
             // MidLabelPreView
             // 
             this.MidLabelPreView.AutoSize = true;
-            this.MidLabelPreView.Location = new System.Drawing.Point(197, 41);
+            this.MidLabelPreView.Location = new System.Drawing.Point(198, 42);
             this.MidLabelPreView.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.MidLabelPreView.Name = "MidLabelPreView";
             this.MidLabelPreView.Size = new System.Drawing.Size(82, 41);
@@ -1668,7 +1696,7 @@
             // 
             this.label9.AutoSize = true;
             this.label9.Font = new System.Drawing.Font("微软雅黑", 10F);
-            this.label9.Location = new System.Drawing.Point(11, 41);
+            this.label9.Location = new System.Drawing.Point(12, 42);
             this.label9.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label9.Name = "label9";
             this.label9.Size = new System.Drawing.Size(102, 35);
@@ -1678,7 +1706,7 @@
             // MidDocRefresh
             // 
             this.MidDocRefresh.AutoSize = true;
-            this.MidDocRefresh.Location = new System.Drawing.Point(115, 41);
+            this.MidDocRefresh.Location = new System.Drawing.Point(116, 42);
             this.MidDocRefresh.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.MidDocRefresh.Name = "MidDocRefresh";
             this.MidDocRefresh.Size = new System.Drawing.Size(82, 41);
@@ -1704,7 +1732,7 @@
             // 
             this.label5.AutoSize = true;
             this.label5.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label5.Location = new System.Drawing.Point(17, 349);
+            this.label5.Location = new System.Drawing.Point(18, 350);
             this.label5.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label5.Name = "label5";
             this.label5.Size = new System.Drawing.Size(62, 31);
@@ -1715,7 +1743,7 @@
             // 
             this.label4.AutoSize = true;
             this.label4.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label4.Location = new System.Drawing.Point(17, 287);
+            this.label4.Location = new System.Drawing.Point(18, 288);
             this.label4.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label4.Name = "label4";
             this.label4.Size = new System.Drawing.Size(62, 31);
@@ -1736,7 +1764,7 @@
             // 
             this.label15.AutoSize = true;
             this.label15.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label15.Location = new System.Drawing.Point(199, 289);
+            this.label15.Location = new System.Drawing.Point(200, 290);
             this.label15.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label15.Name = "label15";
             this.label15.Size = new System.Drawing.Size(38, 31);
@@ -1769,7 +1797,7 @@
             // 
             this.MidLabelAutoPrint.AutoSize = true;
             this.MidLabelAutoPrint.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.MidLabelAutoPrint.Location = new System.Drawing.Point(11, 213);
+            this.MidLabelAutoPrint.Location = new System.Drawing.Point(12, 214);
             this.MidLabelAutoPrint.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.MidLabelAutoPrint.Name = "MidLabelAutoPrint";
             this.MidLabelAutoPrint.Size = new System.Drawing.Size(142, 35);
@@ -1818,7 +1846,7 @@
             // 
             this.DiffCustOutBoxCode.AutoSize = true;
             this.DiffCustOutBoxCode.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.DiffCustOutBoxCode.Location = new System.Drawing.Point(195, 333);
+            this.DiffCustOutBoxCode.Location = new System.Drawing.Point(196, 334);
             this.DiffCustOutBoxCode.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.DiffCustOutBoxCode.Name = "DiffCustOutBoxCode";
             this.DiffCustOutBoxCode.Size = new System.Drawing.Size(142, 35);
@@ -1847,7 +1875,7 @@
             // 
             this.cu_print_ordercode.AutoSize = true;
             this.cu_print_ordercode.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.cu_print_ordercode.Location = new System.Drawing.Point(13, 135);
+            this.cu_print_ordercode.Location = new System.Drawing.Point(14, 136);
             this.cu_print_ordercode.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.cu_print_ordercode.Name = "cu_print_ordercode";
             this.cu_print_ordercode.Size = new System.Drawing.Size(142, 35);
@@ -1859,7 +1887,7 @@
             // 
             this.cu_print_outpo.AutoSize = true;
             this.cu_print_outpo.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.cu_print_outpo.Location = new System.Drawing.Point(13, 89);
+            this.cu_print_outpo.Location = new System.Drawing.Point(14, 90);
             this.cu_print_outpo.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.cu_print_outpo.Name = "cu_print_outpo";
             this.cu_print_outpo.Size = new System.Drawing.Size(142, 35);
@@ -1871,7 +1899,7 @@
             // 
             this.cu_print_outdc.AutoSize = true;
             this.cu_print_outdc.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.cu_print_outdc.Location = new System.Drawing.Point(13, 231);
+            this.cu_print_outdc.Location = new System.Drawing.Point(14, 232);
             this.cu_print_outdc.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.cu_print_outdc.Name = "cu_print_outdc";
             this.cu_print_outdc.Size = new System.Drawing.Size(80, 35);
@@ -1883,7 +1911,7 @@
             // 
             this.cu_print_outlotno.AutoSize = true;
             this.cu_print_outlotno.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.cu_print_outlotno.Location = new System.Drawing.Point(13, 181);
+            this.cu_print_outlotno.Location = new System.Drawing.Point(14, 182);
             this.cu_print_outlotno.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.cu_print_outlotno.Name = "cu_print_outlotno";
             this.cu_print_outlotno.Size = new System.Drawing.Size(117, 35);
@@ -1895,7 +1923,7 @@
             // 
             this.cu_print_outprod.AutoSize = true;
             this.cu_print_outprod.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.cu_print_outprod.Location = new System.Drawing.Point(13, 39);
+            this.cu_print_outprod.Location = new System.Drawing.Point(14, 40);
             this.cu_print_outprod.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.cu_print_outprod.Name = "cu_print_outprod";
             this.cu_print_outprod.Size = new System.Drawing.Size(142, 35);
@@ -1907,7 +1935,7 @@
             // 
             this.label19.AutoSize = true;
             this.label19.Font = new System.Drawing.Font("微软雅黑", 10F);
-            this.label19.Location = new System.Drawing.Point(7, 43);
+            this.label19.Location = new System.Drawing.Point(8, 44);
             this.label19.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label19.Name = "label19";
             this.label19.Size = new System.Drawing.Size(102, 35);
@@ -1917,7 +1945,7 @@
             // OutDocRefresh
             // 
             this.OutDocRefresh.AutoSize = true;
-            this.OutDocRefresh.Location = new System.Drawing.Point(113, 43);
+            this.OutDocRefresh.Location = new System.Drawing.Point(114, 44);
             this.OutDocRefresh.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.OutDocRefresh.Name = "OutDocRefresh";
             this.OutDocRefresh.Size = new System.Drawing.Size(82, 41);
@@ -1929,7 +1957,7 @@
             // LogingOut
             // 
             this.LogingOut.AutoSize = true;
-            this.LogingOut.Location = new System.Drawing.Point(195, 43);
+            this.LogingOut.Location = new System.Drawing.Point(196, 44);
             this.LogingOut.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.LogingOut.Name = "LogingOut";
             this.LogingOut.Size = new System.Drawing.Size(146, 41);
@@ -1967,7 +1995,7 @@
             // 
             this.label10.AutoSize = true;
             this.label10.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label10.Location = new System.Drawing.Point(187, 285);
+            this.label10.Location = new System.Drawing.Point(188, 286);
             this.label10.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label10.Name = "label10";
             this.label10.Size = new System.Drawing.Size(62, 31);
@@ -1978,7 +2006,7 @@
             // 
             this.label6.AutoSize = true;
             this.label6.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label6.Location = new System.Drawing.Point(185, 225);
+            this.label6.Location = new System.Drawing.Point(186, 226);
             this.label6.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label6.Name = "label6";
             this.label6.Size = new System.Drawing.Size(62, 31);
@@ -2285,5 +2313,7 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_outboxcode1;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_outboxcode2;
         private System.Windows.Forms.LinkLabel MidLabelPreView;
+        private System.Windows.Forms.RadioButton Order_Prod;
+        private System.Windows.Forms.RadioButton Order_Detno;
     }
 }

+ 18 - 6
UAS-出货标签管理(贸易版)/UAS_出货标签管理.cs

@@ -229,6 +229,7 @@ namespace UAS_LabelMachine
 
             CollectionUnit.Text = "盘";
             Point pt = new Point();
+
             //禁止所有列的排序
             foreach (DataGridViewColumn dgv in LabelInf.Columns)
             {
@@ -276,6 +277,7 @@ namespace UAS_LabelMachine
             LogicHandler.CustInit("0");
         }
 
+
         private void Sg_code_DbChange(object sender, EventArgs e)
         {
             DataTable dt = sg_code.ReturnData;
@@ -295,7 +297,7 @@ namespace UAS_LabelMachine
 
         private void GenerateBarCode_Click(object sender, EventArgs e)
         {
-            生成条码 form = new 生成条码(pi_inoutno.Text);
+            生成条码 form = new 生成条码(pi_inoutno.Text, Order_Prod.Checked ? "Prod" : "Detno");
             form.FormClosed += LoadGridData;
             BaseUtil.SetFormCenter(form);
             form.ShowDialog();
@@ -1558,6 +1560,7 @@ namespace UAS_LabelMachine
                 Print.CodeSoft.OutPrint(OutBoxDoc, OutLabelParam, pi_inoutno.Text, pib_id, pib_outboxcode2, cu_print_outprod.Checked, cu_print_outpo.Checked, cu_print_outdc.Checked, cu_print_outlotno.Checked, cu_print_ordercode.Checked);
             else
             {
+
                 if (DiffCustOutBoxCode.Checked)
                 {
                     //执行本地SQL,获取需要更新的DataCode
@@ -1591,9 +1594,18 @@ namespace UAS_LabelMachine
                             {
                                 updateCondition += " and pib_lotno='" + dt.Rows[i]["pib_lotno"].ToString() + "'";
                             }
-                            dh.ExecuteSql("update prodiobarcode set pib_custoutboxcode='" + custoutboxcode + "' where pib_id in(select pib_id from prodiobarcode left join prodinout on pib_inoutno=pi_inoutno left join prodiodetail on pd_piid=pi_id and pib_prodcode=pd_prodcode where pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode2='" + pib_outboxcode2 + "' " + updateCondition + " )", "update");
-                            LogicHandler.SP_OUTCUSTBARCODE(pi_inoutno.Text, "and pib_outboxcode2='" + pib_outboxcode2 + "' " + updateCondition + " ");
-                            dh.UpdateByCondition("RuleMaxNum", "rmn_maxnumber='" + custserialnum + "'", "rmn_nrcode='" + NrCode + "' and rmn_prefix='" + Prefix + "'");
+                            try
+                            {
+                                dh.ExecuteSql("update prodiobarcode set pib_custoutboxcode='" + custoutboxcode + "' where pib_id in(select pib_id from prodiobarcode left join prodinout on pib_inoutno=pi_inoutno left join prodiodetail on pd_piid=pi_id and pib_prodcode=pd_prodcode where pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode2='" + pib_outboxcode2 + "' " + updateCondition + " )", "update");
+                                LogicHandler.SP_OUTCUSTBARCODE(pi_inoutno.Text, "and pib_outboxcode2='" + pib_outboxcode2 + "' " + updateCondition + " ");
+                                dh.UpdateByCondition("RuleMaxNum", "rmn_maxnumber='" + custserialnum + "'", "rmn_nrcode='" + NrCode + "' and rmn_prefix='" + Prefix + "'");
+
+                            }
+                            catch (Exception ex)
+                            {
+                                Console.WriteLine(ex.Message + ex.StackTrace);
+                                throw;
+                            }
                         }
                     }
                 }
@@ -2650,8 +2662,8 @@ namespace UAS_LabelMachine
             Button setvalue = sender as Button;
             string pdno = LabelInf.Rows[rowindex].Cells["pib_pdno"].Value.ToString();
             string pr_brand = LabelInf.Rows[rowindex].Cells["pib_brand"].Value.ToString();
-            //string datecode = setvalue.FindForm().Controls["datecode"].Text;
 
+            string datecode = setvalue.FindForm().Controls["datecode"].Text;
             string lotno = setvalue.FindForm().Controls["lotno"].Text;
             string BeginRow = setvalue.FindForm().Controls["Begin"].Text;
             string EndRow = setvalue.FindForm().Controls["End"].Text;
@@ -2696,7 +2708,7 @@ namespace UAS_LabelMachine
                     return;
                 }
             }
-            dh.BatchInsert("update prodiobarcode set pib_lotno='" + lotno + "' where pib_id=:pib_id", new string[] { "pib_id" }, pib_id.ToArray());
+            dh.BatchInsert("update prodiobarcode set pib_lotno='" + lotno + "',pib_datecode='" + datecode + "' where pib_id=:pib_id", new string[] { "pib_id" }, pib_id.ToArray());
             //同步数据到本地
             sdh.ExecuteSql("delete from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "'", "delete");
             LoadGridData(false);

+ 10 - 1
UAS-出货标签管理(贸易版)/生成条码.cs

@@ -39,12 +39,21 @@ namespace UAS_LabelMachine
         //编码规则编号
         string NrCode = "";
 
+        string DataType = "";
+
         public 生成条码(string PI_INOUTNO)
         {
             InitializeComponent();
             pi_inoutno.Text = PI_INOUTNO;
         }
 
+        public 生成条码(string PI_INOUTNO, string type)
+        {
+            InitializeComponent();
+            pi_inoutno.Text = PI_INOUTNO;
+            DataType = type;
+        }
+
         private void 生成条码_Load(object sender, EventArgs e)
         {
             dh = SystemInf.dh;
@@ -502,7 +511,7 @@ namespace UAS_LabelMachine
                 {
                     case "出货单":
                         string outsql = "";
-                        LogicHandler.GenerateBarCode(pi_id, CustCode, out outsql);
+                        LogicHandler.GenerateBarCode(pi_id, CustCode + "|" + DataType, out outsql);
                         sql.Clear();
                         sql.Append(outsql);
                         break;

+ 51 - 47
UAS_AutoPass/AutoAnalysisXml.Designer.cs

@@ -60,10 +60,10 @@
             // StartWatch
             // 
             this.StartWatch.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.StartWatch.Location = new System.Drawing.Point(193, 320);
-            this.StartWatch.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.StartWatch.Location = new System.Drawing.Point(290, 512);
+            this.StartWatch.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.StartWatch.Name = "StartWatch";
-            this.StartWatch.Size = new System.Drawing.Size(85, 35);
+            this.StartWatch.Size = new System.Drawing.Size(128, 56);
             this.StartWatch.TabIndex = 0;
             this.StartWatch.Text = "开始监控";
             this.StartWatch.UseVisualStyleBackColor = true;
@@ -73,10 +73,10 @@
             // 
             this.StopWatch.Enabled = false;
             this.StopWatch.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.StopWatch.Location = new System.Drawing.Point(332, 320);
-            this.StopWatch.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.StopWatch.Location = new System.Drawing.Point(498, 512);
+            this.StopWatch.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.StopWatch.Name = "StopWatch";
-            this.StopWatch.Size = new System.Drawing.Size(85, 35);
+            this.StopWatch.Size = new System.Drawing.Size(128, 56);
             this.StopWatch.TabIndex = 1;
             this.StopWatch.Text = "停止监控";
             this.StopWatch.UseVisualStyleBackColor = true;
@@ -86,28 +86,29 @@
             // 
             this.label1.AutoSize = true;
             this.label1.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label1.Location = new System.Drawing.Point(36, 174);
+            this.label1.Location = new System.Drawing.Point(54, 278);
+            this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(107, 25);
+            this.label1.Size = new System.Drawing.Size(162, 38);
             this.label1.TabIndex = 2;
             this.label1.Text = "监控文件夹";
             // 
             // FolderPath
             // 
             this.FolderPath.Enabled = false;
-            this.FolderPath.Location = new System.Drawing.Point(149, 174);
-            this.FolderPath.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.FolderPath.Location = new System.Drawing.Point(224, 278);
+            this.FolderPath.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.FolderPath.Name = "FolderPath";
-            this.FolderPath.Size = new System.Drawing.Size(292, 25);
+            this.FolderPath.Size = new System.Drawing.Size(436, 35);
             this.FolderPath.TabIndex = 3;
             // 
             // ChooseFolder
             // 
             this.ChooseFolder.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ChooseFolder.Location = new System.Drawing.Point(461, 174);
-            this.ChooseFolder.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.ChooseFolder.Location = new System.Drawing.Point(692, 278);
+            this.ChooseFolder.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.ChooseFolder.Name = "ChooseFolder";
-            this.ChooseFolder.Size = new System.Drawing.Size(104, 30);
+            this.ChooseFolder.Size = new System.Drawing.Size(156, 48);
             this.ChooseFolder.TabIndex = 6;
             this.ChooseFolder.Text = "选择文件夹";
             this.ChooseFolder.UseVisualStyleBackColor = true;
@@ -115,20 +116,20 @@
             // 
             // OperateResult
             // 
-            this.OperateResult.Location = new System.Drawing.Point(595, 14);
-            this.OperateResult.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.OperateResult.Location = new System.Drawing.Point(892, 22);
+            this.OperateResult.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.OperateResult.Name = "OperateResult";
-            this.OperateResult.Size = new System.Drawing.Size(280, 336);
+            this.OperateResult.Size = new System.Drawing.Size(749, 535);
             this.OperateResult.TabIndex = 7;
             this.OperateResult.Text = "";
             // 
             // Clean
             // 
             this.Clean.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.Clean.Location = new System.Drawing.Point(699, 359);
-            this.Clean.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.Clean.Location = new System.Drawing.Point(1229, 579);
+            this.Clean.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.Clean.Name = "Clean";
-            this.Clean.Size = new System.Drawing.Size(75, 30);
+            this.Clean.Size = new System.Drawing.Size(112, 48);
             this.Clean.TabIndex = 8;
             this.Clean.Text = "清除";
             this.Clean.UseVisualStyleBackColor = true;
@@ -137,10 +138,10 @@
             // ChooseBackUpFolder
             // 
             this.ChooseBackUpFolder.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ChooseBackUpFolder.Location = new System.Drawing.Point(461, 251);
-            this.ChooseBackUpFolder.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.ChooseBackUpFolder.Location = new System.Drawing.Point(692, 402);
+            this.ChooseBackUpFolder.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.ChooseBackUpFolder.Name = "ChooseBackUpFolder";
-            this.ChooseBackUpFolder.Size = new System.Drawing.Size(104, 30);
+            this.ChooseBackUpFolder.Size = new System.Drawing.Size(156, 48);
             this.ChooseBackUpFolder.TabIndex = 11;
             this.ChooseBackUpFolder.Text = "选择文件夹";
             this.ChooseBackUpFolder.UseVisualStyleBackColor = true;
@@ -149,19 +150,20 @@
             // BackUpFolderPath
             // 
             this.BackUpFolderPath.Enabled = false;
-            this.BackUpFolderPath.Location = new System.Drawing.Point(149, 251);
-            this.BackUpFolderPath.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.BackUpFolderPath.Location = new System.Drawing.Point(224, 402);
+            this.BackUpFolderPath.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.BackUpFolderPath.Name = "BackUpFolderPath";
-            this.BackUpFolderPath.Size = new System.Drawing.Size(292, 25);
+            this.BackUpFolderPath.Size = new System.Drawing.Size(436, 35);
             this.BackUpFolderPath.TabIndex = 10;
             // 
             // label2
             // 
             this.label2.AutoSize = true;
             this.label2.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label2.Location = new System.Drawing.Point(36, 251);
+            this.label2.Location = new System.Drawing.Point(54, 402);
+            this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(107, 25);
+            this.label2.Size = new System.Drawing.Size(162, 38);
             this.label2.TabIndex = 9;
             this.label2.Text = "备份文件夹";
             // 
@@ -169,9 +171,10 @@
             // 
             this.MakeCode_lable.AutoSize = true;
             this.MakeCode_lable.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.MakeCode_lable.Location = new System.Drawing.Point(36, 100);
+            this.MakeCode_lable.Location = new System.Drawing.Point(54, 160);
+            this.MakeCode_lable.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.MakeCode_lable.Name = "MakeCode_lable";
-            this.MakeCode_lable.Size = new System.Drawing.Size(69, 25);
+            this.MakeCode_lable.Size = new System.Drawing.Size(104, 38);
             this.MakeCode_lable.TabIndex = 12;
             this.MakeCode_lable.Text = "工单号";
             // 
@@ -179,9 +182,10 @@
             // 
             this.label4.AutoSize = true;
             this.label4.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label4.Location = new System.Drawing.Point(36, 29);
+            this.label4.Location = new System.Drawing.Point(54, 46);
+            this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label4.Name = "label4";
-            this.label4.Size = new System.Drawing.Size(88, 25);
+            this.label4.Size = new System.Drawing.Size(133, 38);
             this.label4.TabIndex = 14;
             this.label4.Text = "账套选择";
             // 
@@ -189,19 +193,19 @@
             // 
             this.Master.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
             this.Master.FormattingEnabled = true;
-            this.Master.Location = new System.Drawing.Point(149, 29);
-            this.Master.Margin = new System.Windows.Forms.Padding(4);
+            this.Master.Location = new System.Drawing.Point(224, 46);
+            this.Master.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
             this.Master.Name = "Master";
-            this.Master.Size = new System.Drawing.Size(292, 23);
+            this.Master.Size = new System.Drawing.Size(436, 32);
             this.Master.TabIndex = 15;
             // 
             // AutoStart
             // 
             this.AutoStart.AutoSize = true;
-            this.AutoStart.Location = new System.Drawing.Point(457, 32);
-            this.AutoStart.Margin = new System.Windows.Forms.Padding(4);
+            this.AutoStart.Location = new System.Drawing.Point(686, 51);
+            this.AutoStart.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
             this.AutoStart.Name = "AutoStart";
-            this.AutoStart.Size = new System.Drawing.Size(119, 19);
+            this.AutoStart.Size = new System.Drawing.Size(186, 28);
             this.AutoStart.TabIndex = 16;
             this.AutoStart.Text = "开机自动启动";
             this.AutoStart.UseVisualStyleBackColor = true;
@@ -209,19 +213,19 @@
             // 
             // ma_code
             // 
-            this.ma_code.Location = new System.Drawing.Point(149, 100);
-            this.ma_code.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.ma_code.Location = new System.Drawing.Point(224, 160);
+            this.ma_code.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.ma_code.Name = "ma_code";
-            this.ma_code.Size = new System.Drawing.Size(292, 25);
+            this.ma_code.Size = new System.Drawing.Size(436, 35);
             this.ma_code.TabIndex = 17;
             // 
             // BatchAnalysus
             // 
             this.BatchAnalysus.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.BatchAnalysus.Location = new System.Drawing.Point(461, 98);
-            this.BatchAnalysus.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.BatchAnalysus.Location = new System.Drawing.Point(692, 157);
+            this.BatchAnalysus.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.BatchAnalysus.Name = "BatchAnalysus";
-            this.BatchAnalysus.Size = new System.Drawing.Size(104, 30);
+            this.BatchAnalysus.Size = new System.Drawing.Size(156, 48);
             this.BatchAnalysus.TabIndex = 18;
             this.BatchAnalysus.Text = "批量解析";
             this.BatchAnalysus.UseVisualStyleBackColor = true;
@@ -234,9 +238,9 @@
             // 
             // AutoAnalysisXml
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(887, 395);
+            this.ClientSize = new System.Drawing.Size(1654, 640);
             this.Controls.Add(this.BatchAnalysus);
             this.Controls.Add(this.ma_code);
             this.Controls.Add(this.AutoStart);
@@ -253,7 +257,7 @@
             this.Controls.Add(this.label1);
             this.Controls.Add(this.StopWatch);
             this.Controls.Add(this.StartWatch);
-            this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.MaximizeBox = false;
             this.Name = "AutoAnalysisXml";
             this.Text = "UAS自动过站解析器";

+ 16 - 3
UAS_AutoPass/AutoAnalysisXml.cs

@@ -283,6 +283,11 @@ namespace UAS_AutoPass
                         break;
                 }
             }
+            if (SN == "")
+            {
+                tipform.startthread("序列号不能为空", "NG");
+                return;
+            }
             if (data.Length > 15)
             {
                 for (int i = 15; i < data.Length; i++)
@@ -322,16 +327,24 @@ namespace UAS_AutoPass
                 Result = "OK";
             }
             string makecode = "";
+            string stepcode = "";
             string oErrMessage = "";
             string oMSID = "";
             if (LogicHandler.CheckStepSNAndMacode(ma_code.Text, isource, SN, iusercode, out makecode, out oMSID, out oErrMessage))
             {
                 //获取序列号ID最大的工单
-                dt = (DataTable)dh.ExecuteSql("select ms_makecode,ms_id from makeserial where ms_sncode='" + SN + "' order by ms_id desc", "select");
+                dt = (DataTable)dh.ExecuteSql("select ms_makecode,ms_id,ms_stepcode from makeserial where ms_sncode='" + SN + "' order by ms_id desc", "select");
                 if (dt.Rows.Count > 0)
                 {
                     ma_code.Text = dt.Rows[0]["ms_makecode"].ToString();
                     makecode = dt.Rows[0]["ms_makecode"].ToString();
+                    stepcode = dt.Rows[0]["ms_stepcode"].ToString();
+                    if (stepcode == istepcode)
+                    {
+                        tipform.startthread("序列号 " + SN + "已执行过" + istepcode, "NG");
+                        OperateResult.AppendText("序列号 " + SN + "已执行过" + istepcode + "\n");
+                        return;
+                    }
                     switch (Result)
                     {
                         case "OK":
@@ -369,13 +382,13 @@ namespace UAS_AutoPass
                                 if (!File.Exists(BackUpFolderPath.Text + @"\" + FileName))
                                 {
                                     file.MoveTo(BackUpFolderPath.Text + @"\" + FileName);
-                                    OperateResult.AppendText("成功解析文件" + FileName + "\n");
+                                    OperateResult.AppendText("成功解析文件" + DateTime.Now.ToString("yyyy-MM-dd HH-mm-ss") + " " + FileName + "\n");
                                     break;
                                 }
                                 else if (!File.Exists(BackUpFolderPath.Text + @"\" + FileName.Split('.')[0] + "(" + i + ")" + "." + FileName.Split('.')[1]))
                                 {
                                     file.MoveTo(BackUpFolderPath.Text + @"\" + FileName.Split('.')[0] + "(" + i + ")" + "." + FileName.Split('.')[1]);
-                                    OperateResult.AppendText("成功解析文件" + FileName + "\n");
+                                    OperateResult.AppendText("成功解析文件" + DateTime.Now.ToString("yyyy-MM-dd HH-mm-ss") + " " + FileName + "\n");
                                     break;
                                 }
                             }

+ 15 - 6
UAS_MES_MAXMADE/FunctionCode/Make/Make_Repair.cs

@@ -80,21 +80,24 @@ namespace UAS_MES_NEW.Make
             bd_soncode.DbChange += Prodcode_DbChange;
 
             //nrg_name.BringToFront();
-            nrg_name.TableName = "QUA_NGREASONGROUP";
+            nrg_name.TableName = "(select nrg_name,nrg_code from QUA_NGREASONGROUP left join DATAINPUTRECORD ON NRG_NAME = DIR_COMMENT AND DIR_GROUP = '不良原因组' and DIR_SOURCECODE = '" + User.UserSourceCode + "' ORDER BY NVL(DIR_NUMBER,0) DESC)";
             nrg_name.Field = "nrg_name";
             nrg_name.ValueField = "nrg_code";
+            nrg_name.Condition = " 1=1 ORDER BY ROWNUM asc";
 
-            nr_name.TableName = "QUA_NGREASONGROUPDET left join QUA_NGREASONGROUP on nrgd_nrgid=nrg_id left join QUA_NGReason on nrgd_nrcode=nr_code ";
+            nr_name.TableName = "QUA_NGREASONGROUPDET left join QUA_NGREASONGROUP on nrgd_nrgid=nrg_id left join QUA_NGReason on nrgd_nrcode=nr_code left join DATAINPUTRECORD ON nr_name = DIR_COMMENT AND DIR_GROUP = '不良原因' and  DIR_SOURCECODE = '" + User.UserSourceCode + "' ";
             nr_name.Field = "nr_name";
             nr_name.ValueField = "nr_code";
 
-            mbr_dutyname.TableName = "ngduty";
+            mbr_dutyname.TableName = "(select nd_name,nd_code from  ngduty left join DATAINPUTRECORD ON nd_name = DIR_COMMENT  AND DIR_GROUP = '责任别' and DIR_SOURCECODE = '" + User.UserSourceCode + "' ORDER BY NVL(DIR_NUMBER,0) DESC) ";
             mbr_dutyname.Field = "nd_name";
             mbr_dutyname.ValueField = "nd_code";
+            mbr_dutyname.Condition = " 1=1 ORDER BY ROWNUM asc";
 
-            so_name.TableName = "solution";
+            so_name.TableName = "(select so_name,so_code from solution left join DATAINPUTRECORD ON so_name = DIR_COMMENT AND DIR_GROUP = '解决方案' and DIR_SOURCECODE = '" + User.UserSourceCode + "' ORDER BY NVL(DIR_NUMBER,0) DESC)";
             so_name.Field = "so_name";
             so_name.ValueField = "so_code";
+            so_name.Condition = " 1=1 ORDER BY ROWNUM asc";
 
             asc.controllInitializeSize(this);
             mbc_component.SendToBack();
@@ -501,14 +504,14 @@ namespace UAS_MES_NEW.Make
                 return;
             }
             //如果岗位资源对应工序的版面不为空的时候
-            if (dh.getFieldDataByCondition("makeserial left join step on ms_stepcode=st_code", "st_table", "ms_id='" + msid + "'").ToString() != "")
+           /* if (dh.getFieldDataByCondition("makeserial left join step on ms_stepcode=st_code", "st_table", "ms_id='" + msid + "'").ToString() != "")
             {
                 if (!dh.CheckExist("makebadrsloc", "mbl_mbrid='" + mbr_id + "' and mbl_makecode='" + ms_makecode.Text + "' and mbl_sncode='" + GetSNCode.Text + "' "))
                 {
                     OperatResult.AppendText(">>工序存在版面必须维护不良位置\n", Color.Red);
                     return;
                 }
-            }
+            }*/
             //查询拆解的物料
             sql.Clear();
             sql.Append("select distinct cm_soncode from craftmaterial where cm_sncode in (select '" + firstsn + "' from dual union ");
@@ -707,6 +710,12 @@ namespace UAS_MES_NEW.Make
                 OperatResult.AppendText(">>解决方案不存在\n", Color.Red);
                 return;
             }
+
+            dh.ExecuteSql("merge into DATAINPUTRECORD using (select NRG_NAME  from QUA_NGREASONGROUP where NRG_NAME = '" + nrg_name.Text + "') ON (NRG_NAME = DIR_COMMENT AND DIR_GROUP = '不良原因组' and DIR_SOURCECODE = '" + User.UserSourceCode + "') when matched then update set DIR_NUMBER = DIR_NUMBER +1 when not matched then insert (DIR_COMMENT,DIR_NUMBER,DIR_SOURCECODE,DIR_GROUP) VALUES (NRG_NAME,1,'" + User.UserSourceCode + "','不良原因组')", "select");
+            dh.ExecuteSql("merge into DATAINPUTRECORD using (select nr_name  from QUA_NGReason left join QUA_NGREASONGROUPDET on nrgd_nrcode=nr_code left join QUA_NGREASONGROUP on nrgd_nrgid=nrg_id where nr_name = '" + nr_name.Text + "' and NRG_NAME = '" + nrg_name.Text + "') ON (nr_name = DIR_COMMENT AND DIR_GROUP = '不良原因' and DIR_SOURCECODE = '" + User.UserSourceCode + "') when matched then update set DIR_NUMBER = DIR_NUMBER +1 when not matched then insert (DIR_COMMENT,DIR_NUMBER,DIR_SOURCECODE,DIR_GROUP) VALUES (nr_name,1,'" + User.UserSourceCode + "','不良原因')", "select");
+            dh.ExecuteSql("merge into DATAINPUTRECORD using (select nd_name  from ngduty where nd_name = '" + mbr_dutyname.Text + "') ON (nd_name = DIR_COMMENT AND DIR_GROUP = '责任别' and DIR_SOURCECODE = '" + User.UserSourceCode + "') when matched then update set DIR_NUMBER = DIR_NUMBER +1 when not matched then insert (DIR_COMMENT,DIR_NUMBER,DIR_SOURCECODE,DIR_GROUP) VALUES (nd_name,1,'" + User.UserSourceCode + "','责任别')", "select");
+            dh.ExecuteSql("merge into DATAINPUTRECORD using (select so_name  from solution where so_name = '" + so_name.Text + "') ON (so_name = DIR_COMMENT AND DIR_GROUP = '解决方案' and DIR_SOURCECODE = '" + User.UserSourceCode + "') when matched then update set DIR_NUMBER = DIR_NUMBER +1 when not matched then insert (DIR_COMMENT,DIR_NUMBER,DIR_SOURCECODE,DIR_GROUP) VALUES (so_name,1,'" + User.UserSourceCode + "','解决方案')", "select");
+            
             //保存不良原因
             sql.Clear();
             sql.Append("insert into makebadreason (mbr_mbid,mbr_id,mbr_brcode,mbr_solutioncode,");

+ 116 - 160
UAS_MES_MAXMADE/FunctionCode/Query/Query_SpecialReport.Designer.cs

@@ -31,18 +31,16 @@
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Query_SpecialReport));
             this.Export = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
             this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog();
+            this.Prefix = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.label5 = new System.Windows.Forms.Label();
+            this.Date = new System.Windows.Forms.DateTimePicker();
+            this.Num = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.label1 = new System.Windows.Forms.Label();
             this.label2 = new System.Windows.Forms.Label();
             this.label3 = new System.Windows.Forms.Label();
+            this.Rn = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.label4 = new System.Windows.Forms.Label();
-            this.SerialNum = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
-            this.CartonBegin = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
-            this.CartonEnd = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
-            this.PaletteEnd = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
-            this.PaletteBegin = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
-            this.InDate = new System.Windows.Forms.DateTimePicker();
-            this.inoutno = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
-            this.label5 = new System.Windows.Forms.Label();
+            this.Printer = new UAS_MES_NEW.CustomControl.ComBoxWithFocus.PrinterCombox();
             this.SuspendLayout();
             // 
             // Export
@@ -52,193 +50,153 @@
             this.Export.DownImage = ((System.Drawing.Image)(resources.GetObject("Export.DownImage")));
             this.Export.Image = null;
             this.Export.IsShowBorder = true;
-            this.Export.Location = new System.Drawing.Point(241, 340);
-            this.Export.Margin = new System.Windows.Forms.Padding(4);
+            this.Export.Location = new System.Drawing.Point(362, 506);
+            this.Export.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
             this.Export.MoveImage = ((System.Drawing.Image)(resources.GetObject("Export.MoveImage")));
             this.Export.Name = "Export";
             this.Export.NormalImage = ((System.Drawing.Image)(resources.GetObject("Export.NormalImage")));
             this.Export.Power = null;
-            this.Export.Size = new System.Drawing.Size(100, 35);
+            this.Export.Size = new System.Drawing.Size(150, 56);
             this.Export.TabIndex = 0;
-            this.Export.Text = "导出";
+            this.Export.Text = "打印";
             this.Export.UseVisualStyleBackColor = false;
             this.Export.Click += new System.EventHandler(this.Export_Click);
             // 
+            // Prefix
+            // 
+            this.Prefix.AllPower = null;
+            this.Prefix.BackColor = System.Drawing.Color.White;
+            this.Prefix.ID = null;
+            this.Prefix.Location = new System.Drawing.Point(362, 85);
+            this.Prefix.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
+            this.Prefix.Name = "Prefix";
+            this.Prefix.Power = null;
+            this.Prefix.Size = new System.Drawing.Size(278, 35);
+            this.Prefix.Str = null;
+            this.Prefix.Str1 = null;
+            this.Prefix.Str2 = null;
+            this.Prefix.TabIndex = 12;
+            this.Prefix.TextChanged += new System.EventHandler(this.inoutno_TextChanged);
+            // 
+            // label5
+            // 
+            this.label5.AutoSize = true;
+            this.label5.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label5.Location = new System.Drawing.Point(217, 79);
+            this.label5.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label5.Name = "label5";
+            this.label5.Size = new System.Drawing.Size(82, 41);
+            this.label5.TabIndex = 11;
+            this.label5.Text = "前缀";
+            // 
+            // Date
+            // 
+            this.Date.Location = new System.Drawing.Point(362, 190);
+            this.Date.Name = "Date";
+            this.Date.Size = new System.Drawing.Size(278, 35);
+            this.Date.TabIndex = 13;
+            // 
+            // Num
+            // 
+            this.Num.AllPower = null;
+            this.Num.BackColor = System.Drawing.Color.White;
+            this.Num.ID = null;
+            this.Num.Location = new System.Drawing.Point(362, 310);
+            this.Num.Margin = new System.Windows.Forms.Padding(6);
+            this.Num.Name = "Num";
+            this.Num.Power = null;
+            this.Num.Size = new System.Drawing.Size(278, 35);
+            this.Num.Str = null;
+            this.Num.Str1 = null;
+            this.Num.Str2 = null;
+            this.Num.TabIndex = 14;
+            // 
             // label1
             // 
             this.label1.AutoSize = true;
             this.label1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label1.Location = new System.Drawing.Point(71, 100);
-            this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label1.Location = new System.Drawing.Point(217, 304);
+            this.label1.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(65, 27);
-            this.label1.TabIndex = 1;
-            this.label1.Text = "SERIE";
+            this.label1.Size = new System.Drawing.Size(82, 41);
+            this.label1.TabIndex = 15;
+            this.label1.Text = "数量";
             // 
             // label2
             // 
             this.label2.AutoSize = true;
             this.label2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label2.Location = new System.Drawing.Point(71, 145);
-            this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label2.Location = new System.Drawing.Point(217, 190);
+            this.label2.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(95, 27);
-            this.label2.TabIndex = 2;
-            this.label2.Text = "CARTON";
+            this.label2.Size = new System.Drawing.Size(82, 41);
+            this.label2.TabIndex = 16;
+            this.label2.Text = "日期";
             // 
             // label3
             // 
             this.label3.AutoSize = true;
             this.label3.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label3.Location = new System.Drawing.Point(71, 242);
-            this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label3.Location = new System.Drawing.Point(217, 411);
+            this.label3.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label3.Name = "label3";
-            this.label3.Size = new System.Drawing.Size(100, 27);
-            this.label3.TabIndex = 3;
-            this.label3.Text = "DATECRE";
+            this.label3.Size = new System.Drawing.Size(82, 41);
+            this.label3.TabIndex = 18;
+            this.label3.Text = "流水";
+            // 
+            // Rn
+            // 
+            this.Rn.AllPower = null;
+            this.Rn.BackColor = System.Drawing.Color.White;
+            this.Rn.ID = null;
+            this.Rn.Location = new System.Drawing.Point(362, 417);
+            this.Rn.Margin = new System.Windows.Forms.Padding(6);
+            this.Rn.Name = "Rn";
+            this.Rn.Power = null;
+            this.Rn.Size = new System.Drawing.Size(278, 35);
+            this.Rn.Str = null;
+            this.Rn.Str1 = null;
+            this.Rn.Str2 = null;
+            this.Rn.TabIndex = 17;
+            this.Rn.Text = "1";
             // 
             // label4
             // 
             this.label4.AutoSize = true;
             this.label4.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label4.Location = new System.Drawing.Point(71, 191);
-            this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label4.Location = new System.Drawing.Point(801, 85);
+            this.label4.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label4.Name = "label4";
-            this.label4.Size = new System.Drawing.Size(92, 27);
-            this.label4.TabIndex = 4;
-            this.label4.Text = "PALETTE";
-            // 
-            // SerialNum
-            // 
-            this.SerialNum.AllPower = null;
-            this.SerialNum.BackColor = System.Drawing.Color.White;
-            this.SerialNum.ID = null;
-            this.SerialNum.Location = new System.Drawing.Point(241, 100);
-            this.SerialNum.Margin = new System.Windows.Forms.Padding(4);
-            this.SerialNum.Name = "SerialNum";
-            this.SerialNum.Power = null;
-            this.SerialNum.Size = new System.Drawing.Size(260, 25);
-            this.SerialNum.Str = null;
-            this.SerialNum.Str1 = null;
-            this.SerialNum.Str2 = null;
-            this.SerialNum.TabIndex = 5;
-            // 
-            // CartonBegin
-            // 
-            this.CartonBegin.AllPower = null;
-            this.CartonBegin.BackColor = System.Drawing.Color.White;
-            this.CartonBegin.ID = null;
-            this.CartonBegin.Location = new System.Drawing.Point(241, 150);
-            this.CartonBegin.Margin = new System.Windows.Forms.Padding(4);
-            this.CartonBegin.Name = "CartonBegin";
-            this.CartonBegin.Power = null;
-            this.CartonBegin.Size = new System.Drawing.Size(260, 25);
-            this.CartonBegin.Str = null;
-            this.CartonBegin.Str1 = null;
-            this.CartonBegin.Str2 = null;
-            this.CartonBegin.TabIndex = 6;
-            // 
-            // CartonEnd
-            // 
-            this.CartonEnd.AllPower = null;
-            this.CartonEnd.BackColor = System.Drawing.Color.White;
-            this.CartonEnd.ID = null;
-            this.CartonEnd.Location = new System.Drawing.Point(503, 150);
-            this.CartonEnd.Margin = new System.Windows.Forms.Padding(4);
-            this.CartonEnd.Name = "CartonEnd";
-            this.CartonEnd.Power = null;
-            this.CartonEnd.Size = new System.Drawing.Size(260, 25);
-            this.CartonEnd.Str = null;
-            this.CartonEnd.Str1 = null;
-            this.CartonEnd.Str2 = null;
-            this.CartonEnd.TabIndex = 7;
-            // 
-            // PaletteEnd
+            this.label4.Size = new System.Drawing.Size(114, 41);
+            this.label4.TabIndex = 186;
+            this.label4.Text = "打印机";
             // 
-            this.PaletteEnd.AllPower = null;
-            this.PaletteEnd.BackColor = System.Drawing.Color.White;
-            this.PaletteEnd.ID = null;
-            this.PaletteEnd.Location = new System.Drawing.Point(503, 196);
-            this.PaletteEnd.Margin = new System.Windows.Forms.Padding(4);
-            this.PaletteEnd.Name = "PaletteEnd";
-            this.PaletteEnd.Power = null;
-            this.PaletteEnd.Size = new System.Drawing.Size(260, 25);
-            this.PaletteEnd.Str = null;
-            this.PaletteEnd.Str1 = null;
-            this.PaletteEnd.Str2 = null;
-            this.PaletteEnd.TabIndex = 9;
+            // Printer
             // 
-            // PaletteBegin
-            // 
-            this.PaletteBegin.AllPower = null;
-            this.PaletteBegin.BackColor = System.Drawing.Color.White;
-            this.PaletteBegin.ID = null;
-            this.PaletteBegin.Location = new System.Drawing.Point(241, 196);
-            this.PaletteBegin.Margin = new System.Windows.Forms.Padding(4);
-            this.PaletteBegin.Name = "PaletteBegin";
-            this.PaletteBegin.Power = null;
-            this.PaletteBegin.Size = new System.Drawing.Size(260, 25);
-            this.PaletteBegin.Str = null;
-            this.PaletteBegin.Str1 = null;
-            this.PaletteBegin.Str2 = null;
-            this.PaletteBegin.TabIndex = 8;
-            // 
-            // InDate
-            // 
-            this.InDate.Checked = false;
-            this.InDate.Location = new System.Drawing.Point(241, 242);
-            this.InDate.Margin = new System.Windows.Forms.Padding(4);
-            this.InDate.Name = "InDate";
-            this.InDate.ShowCheckBox = true;
-            this.InDate.Size = new System.Drawing.Size(260, 25);
-            this.InDate.TabIndex = 10;
-            // 
-            // inoutno
-            // 
-            this.inoutno.AllPower = null;
-            this.inoutno.BackColor = System.Drawing.Color.White;
-            this.inoutno.ID = null;
-            this.inoutno.Location = new System.Drawing.Point(241, 53);
-            this.inoutno.Margin = new System.Windows.Forms.Padding(4);
-            this.inoutno.Name = "inoutno";
-            this.inoutno.Power = null;
-            this.inoutno.Size = new System.Drawing.Size(260, 25);
-            this.inoutno.Str = null;
-            this.inoutno.Str1 = null;
-            this.inoutno.Str2 = null;
-            this.inoutno.TabIndex = 12;
-            // 
-            // label5
-            // 
-            this.label5.AutoSize = true;
-            this.label5.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label5.Location = new System.Drawing.Point(71, 53);
-            this.label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.label5.Name = "label5";
-            this.label5.Size = new System.Drawing.Size(92, 27);
-            this.label5.TabIndex = 11;
-            this.label5.Text = "出货单号";
+            this.Printer.Location = new System.Drawing.Point(960, 85);
+            this.Printer.Margin = new System.Windows.Forms.Padding(8);
+            this.Printer.Name = "Printer";
+            this.Printer.Size = new System.Drawing.Size(291, 50);
+            this.Printer.TabIndex = 185;
             // 
             // Query_SpecialReport
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(996, 672);
-            this.Controls.Add(this.inoutno);
-            this.Controls.Add(this.label5);
-            this.Controls.Add(this.InDate);
-            this.Controls.Add(this.PaletteEnd);
-            this.Controls.Add(this.PaletteBegin);
-            this.Controls.Add(this.CartonEnd);
-            this.Controls.Add(this.CartonBegin);
-            this.Controls.Add(this.SerialNum);
+            this.ClientSize = new System.Drawing.Size(1494, 1075);
             this.Controls.Add(this.label4);
+            this.Controls.Add(this.Printer);
             this.Controls.Add(this.label3);
+            this.Controls.Add(this.Rn);
             this.Controls.Add(this.label2);
             this.Controls.Add(this.label1);
+            this.Controls.Add(this.Num);
+            this.Controls.Add(this.Date);
+            this.Controls.Add(this.Prefix);
+            this.Controls.Add(this.label5);
             this.Controls.Add(this.Export);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
-            this.Margin = new System.Windows.Forms.Padding(4);
+            this.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
             this.Name = "Query_SpecialReport";
             this.Tag = "Query!SpecialReport";
             this.Text = "Query_SpecialReport";
@@ -252,17 +210,15 @@
 
         private CustomControl.ButtonUtil.NormalButton Export;
         private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog1;
+        private CustomControl.TextBoxWithIcon.EnterTextBox Prefix;
+        private System.Windows.Forms.Label label5;
+        private System.Windows.Forms.DateTimePicker Date;
+        private CustomControl.TextBoxWithIcon.EnterTextBox Num;
         private System.Windows.Forms.Label label1;
         private System.Windows.Forms.Label label2;
         private System.Windows.Forms.Label label3;
+        private CustomControl.TextBoxWithIcon.EnterTextBox Rn;
         private System.Windows.Forms.Label label4;
-        private CustomControl.TextBoxWithIcon.EnterTextBox SerialNum;
-        private CustomControl.TextBoxWithIcon.EnterTextBox CartonBegin;
-        private CustomControl.TextBoxWithIcon.EnterTextBox CartonEnd;
-        private CustomControl.TextBoxWithIcon.EnterTextBox PaletteEnd;
-        private CustomControl.TextBoxWithIcon.EnterTextBox PaletteBegin;
-        private System.Windows.Forms.DateTimePicker InDate;
-        private CustomControl.TextBoxWithIcon.EnterTextBox inoutno;
-        private System.Windows.Forms.Label label5;
+        private CustomControl.ComBoxWithFocus.PrinterCombox Printer;
     }
 }

+ 43 - 137
UAS_MES_MAXMADE/FunctionCode/Query/Query_SpecialReport.cs

@@ -1,4 +1,5 @@
-using System;
+using Seagull.BarTender.Print;
+using System;
 using System.Collections.Generic;
 using System.ComponentModel;
 using System.Data;
@@ -17,6 +18,10 @@ namespace UAS_MES_NEW.Query
 
         DataHelper dh = SystemInf.dh;
 
+        Seagull.BarTender.Print.Engine engine = new Seagull.BarTender.Print.Engine();
+
+        LabelFormatDocument format;
+
         public Query_SpecialReport()
         {
             InitializeComponent();
@@ -30,152 +35,53 @@ namespace UAS_MES_NEW.Query
         //选择导出Excel时是选择导出数据的还是模板
         private void ExcelExport(string DataOrTemplet)
         {
-            //Data表示导出数据
-            //Templet表示导出模板
-            folderBrowserDialog1.Description = "选择导出的路径";
-            DialogResult result = folderBrowserDialog1.ShowDialog();
-            if (result == DialogResult.OK)
+            for (int i = int.Parse(Rn.Text); i < int.Parse(Num.Text); i = i + 4)
             {
-                string FolderPath = folderBrowserDialog1.SelectedPath;
-                ExcelHandler eh = new ExcelHandler();
-                DataTable dt = new DataTable();
-                string st_tablesql = "";
-                string st_id = "";
-                string st_condition = "";
-                dt = (DataTable)dh.ExecuteSql("select st_id,st_tablesql,st_condition from SEARCHTEMPLATE where st_title='ZIDE出货报表'", "select");
-                if (dt.Rows.Count > 0)
+                int temp = i;
+                for (int j = 0; j < format.SubStrings.Count; j++)
                 {
-                    string InOutNo = "";
-                    st_tablesql = dt.Rows[0]["st_tablesql"].ToString();
-                    st_id = dt.Rows[0]["st_id"].ToString();
-                    st_condition = dt.Rows[0]["st_condition"].ToString();
-                    string SQLField = "";
-                    string AddCondition = "";
-                    if (inoutno.Text != "")
-                    {
-                        AddCondition = " and ms_outno='" + inoutno.Text + "'";
-                    }
-                    if (SerialNum.Text != "")
-                    {
-                        AddCondition += " and ms_sncode='" + SerialNum.Text + "'";
-                    }
-                    if (CartonBegin.Text != "" || CartonEnd.Text != "")
-                    {
-                        if (CartonBegin.Text != "" && CartonEnd.Text == "")
-                        {
-                            AddCondition += " and ms_outboxcode> '" + CartonBegin.Text + "' ";
-                        }
-                        if (CartonBegin.Text == "" && CartonEnd.Text != "")
-                        {
-                            AddCondition += " and ms_outboxcode< '" + CartonBegin.Text + "' ";
-                        }
-                        if (CartonBegin.Text != "" && CartonEnd.Text != "")
-                        {
-                            AddCondition += " and ms_outboxcode between '" + CartonBegin.Text + "' and '" + CartonEnd.Text + "' ";
-                        }
-                    }
-                    if (PaletteBegin.Text != "" || PaletteBegin.Text != "")
-                    {
-                        if (PaletteBegin.Text != "" && PaletteEnd.Text == "")
-                        {
-                            AddCondition += " and v_outboxcode> '" + PaletteBegin.Text + "' ";
-                        }
-                        if (PaletteBegin.Text == "" && PaletteEnd.Text != "")
-                        {
-                            AddCondition += " and v_outboxcode< '" + PaletteEnd.Text + "' ";
-                        }
-                        if (PaletteBegin.Text != "" && PaletteEnd.Text != "")
-                        {
-                            AddCondition += " and v_outboxcode between '" + PaletteBegin.Text + "' and '" + PaletteEnd.Text + "' ";
-                        }
-                    }
-                    if (InDate.Checked)
-                    {
-                        AddCondition += " and trunc(ms_indate) = trunc(to_date('" + InDate.Value.ToString("yyyy-MM-dd") + "','yyyy-MM-dd')) ";
-                    }
-                    string GetInOutNoSQL = "select ms_outno from " + st_tablesql;
-                    if (st_condition != "")
-                    {
-                        GetInOutNoSQL += " where " + st_condition;
-                    }
-                    //获取出货单号
-                    dt = (DataTable)dh.ExecuteSql(GetInOutNoSQL + AddCondition + " and rownum=1", "select");
-                    if (dt.Rows.Count > 0)
-                    {
-                        InOutNo = dt.Rows[0]["ms_outno"].ToString();
-                    }
-                    DataTable SeqTanle = (DataTable)dh.ExecuteSql("select cl_code,cl_result from commandlog where cl_operate='导出特殊报表' order by cl_id desc", "select");
-                    string SEQ_NUMBER = "";
-                    string SEQ = "";
-                    string SEQ_PreFix = "NL" + DateTime.Now.Year.ToString().Substring(2, 2) + (DateTime.Now.DayOfYear < 100 ? "0" + DateTime.Now.DayOfYear.ToString() : DateTime.Now.DayOfYear.ToString()) + "COC";
-                    if (SeqTanle.Rows.Count > 0)
+                    switch (format.SubStrings[j].Name)
                     {
-                        //如果今天已经包含本出货单则导出的使用之前的流水
-                        DataRow[] dr = SeqTanle.Select("cl_result='" + InOutNo + "'");
-                        if (dr.Length > 0)
-                        {
-                            SEQ_NUMBER = dr[0]["cl_code"].ToString();
-                            SEQ = SEQ_PreFix + SEQ_NUMBER;
-                        }
-                        else
-                        {
-                            SEQ_NUMBER = SeqTanle.Rows[0]["cl_code"].ToString();
-                            int temp = int.Parse(SEQ_NUMBER) + 1;
-                            SEQ_NUMBER = temp.ToString().PadLeft(5, '0');
-                            SEQ = SEQ_PreFix + SEQ_NUMBER;
-                            LogicHandler.DoCommandLog(Tag.ToString(), User.CurrentStepCode, "", "", User.UserSourceCode, "导出特殊报表", InOutNo, SEQ, SEQ_NUMBER);
-                        }
+                        case "RN1":
+                            format.SubStrings[j].Value = (Prefix.Text + Date.Value.ToString("yymmdd") + lpad(4, (temp).ToString()));
+                            break;
+                        case "RN2":
+                            format.SubStrings[j].Value = (Prefix.Text + Date.Value.ToString("yymmdd") + lpad(4, (temp + 1).ToString()));
+                            break;
+                        case "RN3":
+                            format.SubStrings[j].Value = (Prefix.Text + Date.Value.ToString("yymmdd") + lpad(4, (temp + 2).ToString()));
+                            break;
+                        case "RN4":
+                            format.SubStrings[j].Value = (Prefix.Text + Date.Value.ToString("yymmdd") + lpad(4, (temp + 3).ToString()));
+                            break;
+                        default:
+                            break;
                     }
-                    else
-                    {
-                        SEQ = SEQ_PreFix + "00001";
-                        LogicHandler.DoCommandLog(Tag.ToString(), User.CurrentStepCode, "", "", User.UserSourceCode, "导出特殊报表", InOutNo, SEQ, "00001");
-                    }
-                    dt = (DataTable)dh.ExecuteSql("select stg_field,stg_text,stg_table,stg_formula,stg_type from  SEARCHTEMPLATEgrid where stg_stid='" + st_id + "'", "select");
-                    for (int i = 0; i < dt.Rows.Count; i++)
-                    {
-                        if (dt.Rows[i]["stg_table"].ToString() != "")
-                        {
-                            if (dt.Rows[i]["stg_type"].ToString() == "DATE")
-                            {
-                                SQLField += "to_char(" + dt.Rows[i]["stg_field"].ToString() + ",'YYYYMMDD')||';' as " + dt.Rows[i]["stg_text"].ToString() + ",";
-                            }
-                            else
-                            {
-                                SQLField += dt.Rows[i]["stg_field"].ToString() + "||';' as " + dt.Rows[i]["stg_text"].ToString() + ",";
-                            }
-                        }
-                        else
-                        {
-                            if (dt.Rows[i]["stg_text"].ToString() == "SEQ")
-                            {
-                                SQLField += "'" + SEQ + "'" + "||';' as " + dt.Rows[i]["stg_text"].ToString() + ",";
-                            }
-                            else if (dt.Rows[i]["stg_formula"].ToString().Replace("'", "").Trim() == "")
-                                SQLField += "''" + " as " + dt.Rows[i]["stg_text"].ToString() + ",";
-                            else
-                                SQLField += dt.Rows[i]["stg_formula"].ToString() + "||';' as " + dt.Rows[i]["stg_text"].ToString() + ",";
-                        }
-                    }
-                    SQLField = SQLField.Substring(0, SQLField.Length - 1);
-                    string sql = "select " + SQLField + " from " + st_tablesql;
-                    //单独获取出货单号对流水进行标识
-                    if (st_condition != "")
-                    {
-                        sql += " where " + st_condition;
-                    }
-                    //界面生成的条件
-                    dt = (DataTable)dh.ExecuteSql(sql + AddCondition, "select");
-                    //导出Excel的时候返回一个文件名,用户选择是否打开
-                    eh.WriteTxt(dt, FolderPath, SEQ);
-                    MessageBox.Show("导出成功");
                 }
             }
+            format.PrintSetup.PrinterName = Printer.Text;
+            format.PrintSetup.IdenticalCopiesOfLabel = 1;
+            format.Print();
         }
 
         private void Query_SpecialReport_Load(object sender, EventArgs e)
         {
-            InDate.Checked = false;
+            format = engine.Documents.Open("Label.btw");
+        }
+
+        private static string lpad(int length, string number)
+        {
+            while (number.Length < length)
+            {
+                number = "0" + number;
+            }
+            number = number.Substring(number.Length - length, length);
+            return number;
+        }
+
+        private void inoutno_TextChanged(object sender, EventArgs e)
+        {
+
         }
     }
 }

+ 159 - 13
UAS_MES_MAXMADE/FunctionCode/SystemSetting/SystemSetting_PrinterTest.Designer.cs

@@ -33,6 +33,15 @@
             this.PrinterList = new UAS_MES_NEW.CustomControl.ComBoxWithFocus.PrinterCombox();
             this.PrintTest = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
             this.Setting = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
+            this.label3 = new System.Windows.Forms.Label();
+            this.Rn = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.label2 = new System.Windows.Forms.Label();
+            this.label1 = new System.Windows.Forms.Label();
+            this.Num = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.Date = new System.Windows.Forms.DateTimePicker();
+            this.Prefix = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.label5 = new System.Windows.Forms.Label();
+            this.Export = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
             this.SuspendLayout();
             // 
             // ma_salecode_label
@@ -42,19 +51,20 @@
             | System.Windows.Forms.AnchorStyles.Right)));
             this.ma_salecode_label.AutoSize = true;
             this.ma_salecode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_salecode_label.Location = new System.Drawing.Point(71, 60);
+            this.ma_salecode_label.Location = new System.Drawing.Point(142, 120);
+            this.ma_salecode_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.ma_salecode_label.Name = "ma_salecode_label";
-            this.ma_salecode_label.Size = new System.Drawing.Size(90, 21);
+            this.ma_salecode_label.Size = new System.Drawing.Size(178, 41);
             this.ma_salecode_label.TabIndex = 20;
             this.ma_salecode_label.Text = "打印机列表";
             // 
             // PrinterList
             // 
             this.PrinterList.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.PrinterList.Location = new System.Drawing.Point(178, 60);
-            this.PrinterList.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
+            this.PrinterList.Location = new System.Drawing.Point(356, 120);
+            this.PrinterList.Margin = new System.Windows.Forms.Padding(6, 8, 6, 8);
             this.PrinterList.Name = "PrinterList";
-            this.PrinterList.Size = new System.Drawing.Size(213, 31);
+            this.PrinterList.Size = new System.Drawing.Size(426, 62);
             this.PrinterList.TabIndex = 22;
             // 
             // PrintTest
@@ -65,13 +75,13 @@
             this.PrintTest.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.PrintTest.Image = ((System.Drawing.Image)(resources.GetObject("PrintTest.Image")));
             this.PrintTest.IsShowBorder = true;
-            this.PrintTest.Location = new System.Drawing.Point(413, 60);
-            this.PrintTest.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.PrintTest.Location = new System.Drawing.Point(826, 120);
+            this.PrintTest.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.PrintTest.MoveImage = ((System.Drawing.Image)(resources.GetObject("PrintTest.MoveImage")));
             this.PrintTest.Name = "PrintTest";
             this.PrintTest.NormalImage = ((System.Drawing.Image)(resources.GetObject("PrintTest.NormalImage")));
             this.PrintTest.Power = null;
-            this.PrintTest.Size = new System.Drawing.Size(63, 24);
+            this.PrintTest.Size = new System.Drawing.Size(126, 48);
             this.PrintTest.TabIndex = 21;
             this.PrintTest.Text = "打印测试";
             this.PrintTest.UseVisualStyleBackColor = true;
@@ -85,31 +95,158 @@
             this.Setting.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.Setting.Image = ((System.Drawing.Image)(resources.GetObject("Setting.Image")));
             this.Setting.IsShowBorder = true;
-            this.Setting.Location = new System.Drawing.Point(494, 60);
-            this.Setting.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.Setting.Location = new System.Drawing.Point(988, 120);
+            this.Setting.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.Setting.MoveImage = ((System.Drawing.Image)(resources.GetObject("Setting.MoveImage")));
             this.Setting.Name = "Setting";
             this.Setting.NormalImage = ((System.Drawing.Image)(resources.GetObject("Setting.NormalImage")));
             this.Setting.Power = null;
-            this.Setting.Size = new System.Drawing.Size(63, 24);
+            this.Setting.Size = new System.Drawing.Size(126, 48);
             this.Setting.TabIndex = 23;
             this.Setting.Text = "参数设置";
             this.Setting.UseVisualStyleBackColor = true;
             this.Setting.Click += new System.EventHandler(this.Setting_Click);
             // 
+            // label3
+            // 
+            this.label3.AutoSize = true;
+            this.label3.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label3.Location = new System.Drawing.Point(211, 597);
+            this.label3.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(82, 41);
+            this.label3.TabIndex = 31;
+            this.label3.Text = "流水";
+            // 
+            // Rn
+            // 
+            this.Rn.AllPower = null;
+            this.Rn.BackColor = System.Drawing.Color.White;
+            this.Rn.ID = null;
+            this.Rn.Location = new System.Drawing.Point(356, 603);
+            this.Rn.Margin = new System.Windows.Forms.Padding(6);
+            this.Rn.Name = "Rn";
+            this.Rn.Power = null;
+            this.Rn.Size = new System.Drawing.Size(278, 35);
+            this.Rn.Str = null;
+            this.Rn.Str1 = null;
+            this.Rn.Str2 = null;
+            this.Rn.TabIndex = 30;
+            this.Rn.Text = "1";
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label2.Location = new System.Drawing.Point(211, 376);
+            this.label2.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(82, 41);
+            this.label2.TabIndex = 29;
+            this.label2.Text = "日期";
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label1.Location = new System.Drawing.Point(211, 490);
+            this.label1.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(82, 41);
+            this.label1.TabIndex = 28;
+            this.label1.Text = "数量";
+            // 
+            // Num
+            // 
+            this.Num.AllPower = null;
+            this.Num.BackColor = System.Drawing.Color.White;
+            this.Num.ID = null;
+            this.Num.Location = new System.Drawing.Point(356, 496);
+            this.Num.Margin = new System.Windows.Forms.Padding(6);
+            this.Num.Name = "Num";
+            this.Num.Power = null;
+            this.Num.Size = new System.Drawing.Size(278, 35);
+            this.Num.Str = null;
+            this.Num.Str1 = null;
+            this.Num.Str2 = null;
+            this.Num.TabIndex = 27;
+            // 
+            // Date
+            // 
+            this.Date.Location = new System.Drawing.Point(356, 376);
+            this.Date.Name = "Date";
+            this.Date.Size = new System.Drawing.Size(278, 35);
+            this.Date.TabIndex = 26;
+            // 
+            // Prefix
+            // 
+            this.Prefix.AllPower = null;
+            this.Prefix.BackColor = System.Drawing.Color.White;
+            this.Prefix.ID = null;
+            this.Prefix.Location = new System.Drawing.Point(356, 271);
+            this.Prefix.Margin = new System.Windows.Forms.Padding(6);
+            this.Prefix.Name = "Prefix";
+            this.Prefix.Power = null;
+            this.Prefix.Size = new System.Drawing.Size(278, 35);
+            this.Prefix.Str = null;
+            this.Prefix.Str1 = null;
+            this.Prefix.Str2 = null;
+            this.Prefix.TabIndex = 25;
+            // 
+            // label5
+            // 
+            this.label5.AutoSize = true;
+            this.label5.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label5.Location = new System.Drawing.Point(211, 265);
+            this.label5.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label5.Name = "label5";
+            this.label5.Size = new System.Drawing.Size(82, 41);
+            this.label5.TabIndex = 24;
+            this.label5.Text = "前缀";
+            // 
+            // Export
+            // 
+            this.Export.AllPower = null;
+            this.Export.BackColor = System.Drawing.Color.Transparent;
+            this.Export.DownImage = ((System.Drawing.Image)(resources.GetObject("Export.DownImage")));
+            this.Export.Image = null;
+            this.Export.IsShowBorder = true;
+            this.Export.Location = new System.Drawing.Point(356, 693);
+            this.Export.Margin = new System.Windows.Forms.Padding(6);
+            this.Export.MoveImage = ((System.Drawing.Image)(resources.GetObject("Export.MoveImage")));
+            this.Export.Name = "Export";
+            this.Export.NormalImage = ((System.Drawing.Image)(resources.GetObject("Export.NormalImage")));
+            this.Export.Power = null;
+            this.Export.Size = new System.Drawing.Size(150, 56);
+            this.Export.TabIndex = 32;
+            this.Export.Text = "打印";
+            this.Export.UseVisualStyleBackColor = false;
+            this.Export.Click += new System.EventHandler(this.Export_Click);
+            // 
             // SystemSetting_PrinterTest
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(1017, 559);
+            this.ClientSize = new System.Drawing.Size(2034, 1118);
+            this.Controls.Add(this.Export);
+            this.Controls.Add(this.label3);
+            this.Controls.Add(this.Rn);
+            this.Controls.Add(this.label2);
+            this.Controls.Add(this.label1);
+            this.Controls.Add(this.Num);
+            this.Controls.Add(this.Date);
+            this.Controls.Add(this.Prefix);
+            this.Controls.Add(this.label5);
             this.Controls.Add(this.Setting);
             this.Controls.Add(this.PrinterList);
             this.Controls.Add(this.PrintTest);
             this.Controls.Add(this.ma_salecode_label);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
+            this.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
             this.Name = "SystemSetting_PrinterTest";
             this.Tag = "Setup!PrinterTest";
             this.Text = "打印机调试";
+            this.Load += new System.EventHandler(this.SystemSetting_PrinterTest_Load);
             this.ResumeLayout(false);
             this.PerformLayout();
 
@@ -120,5 +257,14 @@
         private CustomControl.ButtonUtil.NormalButton PrintTest;
         private CustomControl.ComBoxWithFocus.PrinterCombox PrinterList;
         private CustomControl.ButtonUtil.NormalButton Setting;
+        private System.Windows.Forms.Label label3;
+        private CustomControl.TextBoxWithIcon.EnterTextBox Rn;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.Label label1;
+        private CustomControl.TextBoxWithIcon.EnterTextBox Num;
+        private System.Windows.Forms.DateTimePicker Date;
+        private CustomControl.TextBoxWithIcon.EnterTextBox Prefix;
+        private System.Windows.Forms.Label label5;
+        private CustomControl.ButtonUtil.NormalButton Export;
     }
 }

+ 54 - 1
UAS_MES_MAXMADE/FunctionCode/SystemSetting/SystemSetting_PrinterTest.cs

@@ -1,4 +1,5 @@
-using System;
+using Seagull.BarTender.Print;
+using System;
 using System.Collections.Generic;
 using System.ComponentModel;
 using System.Data;
@@ -12,6 +13,11 @@ namespace UAS_MES_NEW.SystemSetting
 {
     public partial class SystemSetting_PrinterTest : Form
     {
+
+        Engine engine = new Engine();
+
+        LabelFormatDocument format;
+
         public SystemSetting_PrinterTest()
         {
             InitializeComponent();
@@ -42,5 +48,52 @@ namespace UAS_MES_NEW.SystemSetting
             printd.PrinterSettings.PrinterName = PrinterList.Text;
             printd.ShowDialog();
         }
+
+        private void Export_Click(object sender, EventArgs e)
+        {
+            for (int i = int.Parse(Rn.Text); i < (int.Parse(Num.Text)+ int.Parse(Rn.Text)); i = i + 4)
+            {
+                int temp = i;
+                for (int j = 0; j < format.SubStrings.Count; j++)
+                {
+                    switch (format.SubStrings[j].Name)
+                    {
+                        case "RN1":
+                            format.SubStrings[j].Value = (Prefix.Text + Date.Value.ToString("yyMMdd") + lpad(4, (temp).ToString()));
+                            break;
+                        case "RN2":
+                            format.SubStrings[j].Value = (Prefix.Text + Date.Value.ToString("yyMMdd") + lpad(4, (temp + 1).ToString()));
+                            break;
+                        case "RN3":
+                            format.SubStrings[j].Value = (Prefix.Text + Date.Value.ToString("yyMMdd") + lpad(4, (temp + 2).ToString()));
+                            break;
+                        case "RN4":
+                            format.SubStrings[j].Value = (Prefix.Text + Date.Value.ToString("yyMMdd") + lpad(4, (temp + 3).ToString()));
+                            break;
+                        default:
+                            break;
+                    }
+                }
+                format.PrintSetup.PrinterName = PrinterList.Text;
+                format.PrintSetup.IdenticalCopiesOfLabel = 1;
+                format.Print();
+            }
+        }
+
+        private static string lpad(int length, string number)
+        {
+            while (number.Length < length)
+            {
+                number = "0" + number;
+            }
+            number = number.Substring(number.Length - length, length);
+            return number;
+        }
+
+        private void SystemSetting_PrinterTest_Load(object sender, EventArgs e)
+        {
+            engine.Start();
+            format = engine.Documents.Open(Application.StartupPath + "/Label.btw");
+        }
     }
 }

+ 38 - 0
UAS_MES_MAXMADE/FunctionCode/SystemSetting/SystemSetting_PrinterTest.resx

@@ -378,6 +378,44 @@
         2azB52i13asPDvCgTCZjHGt5sdmqDw7woHQ6bRzX8ny1UR8c4EHJZNJc5fC7XKsPDvCgRCLR2x9Pzt9q
         zT+Lpdqw/3A6W/HoUywWa32Nx8OL4zwffM8X6sJu7IcDPCgajaak7udoNNjsdgc81BZ2Yz8c4PH8cR2J
         ROJSU3qXjMKwG/vjzEz/skOI3Zqgv7AAAAAASUVORK5CYII=
+</value>
+  </data>
+  <data name="Export.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFcSURBVFhH5di7UsJAFMbxtDT6QMI76IAFT0npIE0K
+        GcRORxHklpAIBHLfbILV8XxeNsMznJ35F5vu+82kWYuILD4N7oq75roCw27sb/x5WBdc27btntY64o/i
+        DnZjPxy4S6A0R6PHO1WUNHc9ep4uxIXd2D8eP/XZowWUThBG+n3p0stsKbbJ0qFDFFfscQuUbpzm9Pqx
+        Eh8c4PGLkuX0Nl+LDw4GJckUTRaO+OBQo+SKpitXfHAwKClfZuuN+OBgUDJV0NzxxAeHM5TFxhffGUpe
+        aFp5n+KDg0FRfHH8nfjgUKPoktztXnxwMCgFX7xdID441ChlRf7+ID44GBTNl21wFB8capSqot0xFB8c
+        /lE6Wa70IU5oH0Ziw/5cFebpoPUwHPbL04nCJKUgisWF3dgPB3gABc9v7fvBoBcnaVKdvkha2I39cPjx
+        oPrhusndcPinpIXd2N8gIusbTaFspKtR2SQAAAAASUVORK5CYII=
+</value>
+  </data>
+  <data name="Export.MoveImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFzSURBVFhH5djNSgJRGMZxL2P2gTfQFbZvHSEZFBEW
+        CEIQBEIgVFiS9qXWoDmp4/fHzDmjM2a+vU/QqUVX0DvwXxxn9fwYXJwYEcXWNzIWt83dcq7AsBv7LXgA
+        ZI0r71/aaqjCJf8o7sFu7IcDFwdK4vimrv1oSZXRnArdQFzYjf3pQkOzRxIoVWc6X5X6M7ruBGIr9mbU
+        9MIVe9hAcXvBO125WnxwgMcXSpcPF20tPjgYlI5eUK6lxAcHg9Lmw3nTFx8cDEpLLSjr+OKDg0FpqojO
+        Gp744GBQ3vyITutT8cHBoDheRCe1ifjgYFBe+ZCxJ+KDg0GpT0NKv4zFBweDUpuEdFQdiQ8OBsXmw2Fl
+        JD44/KCM53TwNBQfHAzKMx/2Hgfig8M3SrXYUasUfz67DwOxYf9dV5urg+RWzta4aEnxn83OfV9c2I39
+        cIAHUOJceTNbUfmW94GX0sJu7IcDPH5fXCe4EvfXxe5/D7ux3yKi2CfkPhTy27lqkwAAAABJRU5ErkJg
+        gg==
+</value>
+  </data>
+  <data name="Export.NormalImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAGVSURBVFhH5di7agJRFIXhDSKoYBQEC8FCECwEQRBE
+        4uUVEtTiPKVlom2wttM6IfF+15njXHRnL19jD/zFmanWV8zAEDNTp9OJS6/Sm2QUht3YH4cHtdvtF6k7
+        mUwG1tqd3FR3YTf2w0FKUVOu6XT68Xgw3+8PtWH/bDYbCkeLGo1Gz/d9JwzvrL0gCKx49KlerxtIBUGo
+        PjjAg2q1mqDc2fN99cEBHlStVk0oB+t56oMDPKhSqZggDNm1N/XBAR5ULpeNvGD46rrqgwM8qFQqGV8O
+        56ujPjjAg4rFosFL5ni5qA8O8KBCoWBuns/701l9cIAH5fN5QfF4dzipDw7woFwuZ+zN483+oD44wIOy
+        2azB52i13asPDvCgTCZjHGt5sdmqDw7woHQ6bRzX8ny1UR8c4EHJZNJc5fC7XKsPDvCgRCLR2x9Pzt9q
+        zT+Lpdqw/3A6W/HoUywWa32Nx8OL4zwffM8X6sJu7IcDPCgajaak7udoNNjsdgc81BZ2Yz8c4PH8cR2J
+        ROJSU3qXjMKwG/vjzEz/skOI3Zqgv7AAAAAASUVORK5CYII=
 </value>
   </data>
 </root>