Browse Source

设备只能测试3次

callm 5 years ago
parent
commit
1809773c37

+ 6 - 0
UAS_MES_ODLF/FunctionCode/Make/Make_ColorBoxWeigh.cs

@@ -180,12 +180,18 @@ namespace UAS_MES_NEW.Make
                                     LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "彩盒称重:" + weight.Text, "称量合格", sncode.Text, "");
                                     LogicHandler.RecordProdWeight(sncode.Text, "SN", float.Parse(ActualWeight.ToString()), "kg", User.UserLineCode, pr_code.Text, User.UserSourceCode, User.UserName);
                                     dh.ExecuteSql("update makeserial set ms_grossw='" + ActualWeight + "' where ms_id='" + oMsID + "'", "update");
+                                    SetCheck set = new SetCheck("OK", Color.Green);
+                                    BaseUtil.SetFormCenter(set);
+                                    set.ShowDialog();
                                 }
                                 else
                                 {
                                     OperateResult.AppendText(">>彩盒" + sncode.Text + "重量检测未通过\n", Color.Red);
                                     LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "彩盒称重:" + weight.Text, "称量不合格", sncode.Text, "");
                                     LogicHandler.RecordProdWeight(sncode.Text, "SN", float.Parse(ActualWeight.ToString()), "kg", User.UserLineCode, pr_code.Text, User.UserSourceCode, User.UserName);
+                                    SetCheck set = new SetCheck("NG", Color.Red);
+                                    BaseUtil.SetFormCenter(set);
+                                    set.ShowDialog();
                                     return;
                                 }
                             }

+ 1 - 0
UAS_MES_ODLF/FunctionCode/Make/Make_FeedingCollectionCombine.cs

@@ -184,6 +184,7 @@ namespace UAS_MES_NEW.Make
                                         //提示正确返回时传递的信息
                                         if (ErrorMessage.Contains("AFTERSUCCESS"))
                                             OperateResult.AppendText(">>" + ErrorMessage + "\n");
+                                        OperateResult.AppendText(">>条码" + code.Text + "绑定成功!\n", Color.Green);
                                         OperateResult.AppendText(">>序列号" + sn_code.Text + "采集成功!\n", Color.Green);
                                         code.Text = "";
                                         sn_code.Text = "";

+ 13 - 0
UAS_MES_ODLF/FunctionCode/Make/Make_ImeiCheck.cs

@@ -8,6 +8,7 @@ using System.Text;
 using System.Windows.Forms;
 using UAS_MES_NEW.DataOperate;
 using UAS_MES_NEW.Entity;
+using UAS_MES_NEW.PublicForm;
 using UAS_MES_NEW.PublicMethod;
 
 namespace UAS_MES_NEW.Make
@@ -122,6 +123,9 @@ namespace UAS_MES_NEW.Make
                         {
                             OperateResult.AppendText("<<SN:" + sncode.Text + "对应的SN不存在\n", Color.Red, sncode);
                             OperateResult.AppendText(">>请输入SN\n", Color.Black);
+                            SetCheck set = new SetCheck("NG", Color.Red);
+                            BaseUtil.SetFormCenter(set);
+                            set.ShowDialog();
                         }
                     }
                 }
@@ -159,12 +163,18 @@ namespace UAS_MES_NEW.Make
                                     //>> 请输入SN
                                     OperateResult.AppendText("<<SN核对成功\n", Color.Green, sncode);
                                     OperateResult.AppendText(">>请输入SN\n", Color.Black);
+                                    SetCheck set = new SetCheck("OK", Color.Green);
+                                    BaseUtil.SetFormCenter(set);
+                                    set.ShowDialog();
                                 }
                                 else
                                 {
                                     //setstepresult不通过
                                     OperateResult.AppendText(">>" + oErrorMessage + "\n", Color.Red, sncode);
                                     recordResult(SN, DateTime.Now.ToString(), "失败");
+                                    SetCheck set = new SetCheck("NG", Color.Red);
+                                    BaseUtil.SetFormCenter(set);
+                                    set.ShowDialog();
                                 }
                             }
                             else
@@ -172,6 +182,9 @@ namespace UAS_MES_NEW.Make
                                 //判定序列号下一工序不通过
                                 OperateResult.AppendText(">>" + oErrorMessage + "\n", Color.Red, sncode);
                                 recordResult(SN, DateTime.Now.ToString(), "失败");
+                                SetCheck set = new SetCheck("NG", Color.Red);
+                                BaseUtil.SetFormCenter(set);
+                                set.ShowDialog();
                             }
                         }
                         else

+ 13 - 1
UAS_MES_ODLF/FunctionCode/Make/Make_PreFeedingCollection.cs

@@ -131,6 +131,7 @@ namespace UAS_MES_NEW.Make
                             if (mainbarcode.Text == "")
                             {
                                 mainbarcode.Text = code.Text;
+                                OperateResult.AppendText(">> 获取条码" + code.Text + "成功\n");
                                 GetItem();
                                 code.Clear();
                                 return;
@@ -168,13 +169,24 @@ namespace UAS_MES_NEW.Make
                             }
                             if (LogicHandler.CheckSNBeforeLoad(ma_code.Text, code.Text, sp_fsoncode, sp_soncode, sp_barcoderule, sp_prefix, length, sp_ifrepeat, sp_checksalecode, out ErrorMessage))
                             {
-
                                 //查询条码是否存在预加工列表
                                 if (dh.CheckExist("BEFOREHANDPROCESS", "bhp_barcode='" + code.Text + "'"))
                                 {
                                     OperateResult.AppendText(">> 条码" + code.Text + "已经上料\n", Color.Red, code);
                                     return;
                                 }
+                                //获取的主条码和绑定条码必须一致
+                                if (RemainIndex == 0)
+                                {
+                                    if (code.Text != mainbarcode.Text)
+                                    {
+                                        OperateResult.AppendText(">>获取的主条码" + mainbarcode.Text + "和" + code.Text + "不一致\n", Color.Red, code);
+                                        SetCheck set = new SetCheck("NG", Color.Red);
+                                        BaseUtil.SetFormCenter(set);
+                                        set.ShowDialog();
+                                        return;
+                                    }
+                                }
                                 LabelDataGridView.Rows[RemainIndex].Cells["BarCode"].Value = code.Text;
                                 string maincode = LabelDataGridView.Rows[0].Cells["BarCode"].Value.ToString();
                                 sql.Clear();

+ 1 - 0
UAS_MES_ODLF/FunctionCode/Make/Make_Repair.cs

@@ -572,6 +572,7 @@ namespace UAS_MES_NEW.Make
                     SQLS.Add("update makebad set mb_status=-1 where mb_sncode='" + ms_sncode.Text + "' and mb_makecode='" + ms_makecode.Text + "'");
                     //取消最近拆解部件
                     SQLS.Add("update craftmaterial set cm_lastdeco=0 where cm_sncode='" + ms_sncode.Text + "' and cm_makecode='" + ms_makecode.Text + "' and nvl(cm_lastdeco,0)<>0");
+                    SQLS.Add("update MakeBadCount set mbc_status=-1 where mb_sncode='" + ms_sncode.Text + "'");
                     dh.ExecuteSQLTran(SQLS.ToArray());
                     LogicHandler.InsertMakeProcess(ms_sncode.Text, ms_makecode.Text, User.UserSourceCode, "回流工序", "完成维修回流", User.UserCode);
                     LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, macode, User.UserLineCode, User.UserSourceCode, "回流工序", "完成维修回流", ms_sncode.Text, ms_checkno.Text);

+ 75 - 167
UAS_MES_ODLF/FunctionCode/Query/Query_SpecialReport.Designer.cs

@@ -33,15 +33,9 @@
             this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog();
             this.label1 = new System.Windows.Forms.Label();
             this.label2 = new System.Windows.Forms.Label();
-            this.label3 = new System.Windows.Forms.Label();
-            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.Num = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.BeginMac = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.ma_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.label5 = new System.Windows.Forms.Label();
             this.SuspendLayout();
             // 
@@ -52,13 +46,13 @@
             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(305, 371);
+            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.UseVisualStyleBackColor = false;
@@ -68,177 +62,97 @@
             // 
             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(106, 160);
+            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.Size = new System.Drawing.Size(82, 41);
             this.label1.TabIndex = 1;
-            this.label1.Text = "SERIE";
+            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(106, 240);
+            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.Size = new System.Drawing.Size(157, 41);
             this.label2.TabIndex = 2;
-            this.label2.Text = "CARTON";
-            // 
-            // 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.Name = "label3";
-            this.label3.Size = new System.Drawing.Size(100, 27);
-            this.label3.TabIndex = 3;
-            this.label3.Text = "DATECRE";
-            // 
-            // 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.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.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;
-            // 
-            // 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;
+            this.label2.Text = "起始MAC";
+            // 
+            // Num
+            // 
+            this.Num.AllPower = null;
+            this.Num.BackColor = System.Drawing.Color.White;
+            this.Num.ID = null;
+            this.Num.Location = new System.Drawing.Point(305, 161);
+            this.Num.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
+            this.Num.Name = "Num";
+            this.Num.Power = null;
+            this.Num.Size = new System.Drawing.Size(388, 35);
+            this.Num.Str = null;
+            this.Num.Str1 = null;
+            this.Num.Str2 = null;
+            this.Num.TabIndex = 5;
+            this.Num.Text = "10";
+            // 
+            // BeginMac
+            // 
+            this.BeginMac.AllPower = null;
+            this.BeginMac.BackColor = System.Drawing.Color.White;
+            this.BeginMac.ID = null;
+            this.BeginMac.Location = new System.Drawing.Point(305, 242);
+            this.BeginMac.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
+            this.BeginMac.Name = "BeginMac";
+            this.BeginMac.Power = null;
+            this.BeginMac.Size = new System.Drawing.Size(388, 35);
+            this.BeginMac.Str = null;
+            this.BeginMac.Str1 = null;
+            this.BeginMac.Str2 = null;
+            this.BeginMac.TabIndex = 6;
+            this.BeginMac.Text = "D46075F8C89E";
+            // 
+            // ma_code
+            // 
+            this.ma_code.AllPower = null;
+            this.ma_code.BackColor = System.Drawing.Color.White;
+            this.ma_code.ID = null;
+            this.ma_code.Location = new System.Drawing.Point(305, 88);
+            this.ma_code.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
+            this.ma_code.Name = "ma_code";
+            this.ma_code.Power = null;
+            this.ma_code.Size = new System.Drawing.Size(388, 35);
+            this.ma_code.Str = null;
+            this.ma_code.Str1 = null;
+            this.ma_code.Str2 = null;
+            this.ma_code.TabIndex = 12;
+            this.ma_code.Text = "1111111";
             // 
             // 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.Location = new System.Drawing.Point(106, 85);
+            this.label5.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label5.Name = "label5";
-            this.label5.Size = new System.Drawing.Size(92, 27);
+            this.label5.Size = new System.Drawing.Size(114, 41);
             this.label5.TabIndex = 11;
-            this.label5.Text = "出货单号";
+            this.label5.Text = "工单号";
             // 
             // 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.ClientSize = new System.Drawing.Size(1494, 1075);
+            this.Controls.Add(this.ma_code);
             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.Controls.Add(this.label4);
-            this.Controls.Add(this.label3);
+            this.Controls.Add(this.BeginMac);
+            this.Controls.Add(this.Num);
             this.Controls.Add(this.label2);
             this.Controls.Add(this.label1);
             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";
@@ -254,15 +168,9 @@
         private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog1;
         private System.Windows.Forms.Label label1;
         private System.Windows.Forms.Label label2;
-        private System.Windows.Forms.Label label3;
-        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 CustomControl.TextBoxWithIcon.EnterTextBox Num;
+        private CustomControl.TextBoxWithIcon.EnterTextBox BeginMac;
+        private CustomControl.TextBoxWithIcon.EnterTextBox ma_code;
         private System.Windows.Forms.Label label5;
     }
 }

+ 20 - 130
UAS_MES_ODLF/FunctionCode/Query/Query_SpecialReport.cs

@@ -39,143 +39,33 @@ namespace UAS_MES_NEW.Query
                 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)
+                dt.Columns.Add("工单号");
+                dt.Columns.Add("MAC");
+                dt.Columns.Add("BT");
+                dt.Columns.Add("拓展栏位1");
+                dt.Columns.Add("拓展栏位2");
+                dt.Columns.Add("拓展栏位3");
+                dt.Columns.Add("备注");
+                string prefix = BeginMac.Text.Substring(0, 8);
+                string suffix = BeginMac.Text.Substring(8, 4);
+                int num = Int32.Parse(suffix, System.Globalization.NumberStyles.HexNumber);
+                for (int i = 0; i < int.Parse(Num.Text); i++)
                 {
-                    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)
-                    {
-                        //如果今天已经包含本出货单则导出的使用之前的流水
-                        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);
-                        }
-                    }
-                    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("导出成功");
+                    DataRow dr = dt.NewRow();
+                    dr["工单号"] = ma_code.Text;
+                    dr["MAC"] = prefix + num.ToString("X");
+                    num = num + 1;
+                    dr["BT"] = prefix + num.ToString("X");
+                    num = num + 1;
+                    dt.Rows.Add(dr);
                 }
+                eh.ExportExcel(dt, FolderPath);
             }
         }
 
         private void Query_SpecialReport_Load(object sender, EventArgs e)
         {
-            InDate.Checked = false;
+
         }
     }
 }

+ 0 - 2
UAS_MES_ODLF/Properties/licenses.licx

@@ -1,2 +0,0 @@
-DevExpress.XtraBars.BarManager, DevExpress.XtraBars.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
-DevExpress.XtraEditors.Repository.RepositoryItemTextEdit, DevExpress.XtraEditors.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a