Bläddra i källkod

Merge branch 'master' of ssh://10.10.100.21/source/mes-client

Hcsy 8 år sedan
förälder
incheckning
4a91af1c5b

+ 17 - 17
UAS-MES/FunctionCode/Make/Make_FeedingCollection.Designer.cs

@@ -76,7 +76,7 @@
             this.panel2.Controls.Add(this.label1);
             this.panel2.Dock = System.Windows.Forms.DockStyle.Top;
             this.panel2.Location = new System.Drawing.Point(0, 0);
-            this.panel2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.panel2.Margin = new System.Windows.Forms.Padding(4);
             this.panel2.Name = "panel2";
             this.panel2.Size = new System.Drawing.Size(1197, 36);
             this.panel2.TabIndex = 31;
@@ -166,7 +166,7 @@
             this.Loading.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.Loading.ForeColor = System.Drawing.Color.Blue;
             this.Loading.Location = new System.Drawing.Point(24, 540);
-            this.Loading.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.Loading.Margin = new System.Windows.Forms.Padding(4);
             this.Loading.Name = "Loading";
             this.Loading.Size = new System.Drawing.Size(73, 31);
             this.Loading.TabIndex = 62;
@@ -180,7 +180,7 @@
             this.UnLoading.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.UnLoading.ForeColor = System.Drawing.Color.Blue;
             this.UnLoading.Location = new System.Drawing.Point(131, 540);
-            this.UnLoading.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.UnLoading.Margin = new System.Windows.Forms.Padding(4);
             this.UnLoading.Name = "UnLoading";
             this.UnLoading.Size = new System.Drawing.Size(73, 31);
             this.UnLoading.TabIndex = 63;
@@ -215,7 +215,7 @@
             this.iflastsn.Enabled = false;
             this.iflastsn.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.iflastsn.Location = new System.Drawing.Point(385, 588);
-            this.iflastsn.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.iflastsn.Margin = new System.Windows.Forms.Padding(4);
             this.iflastsn.Name = "iflastsn";
             this.iflastsn.Size = new System.Drawing.Size(142, 31);
             this.iflastsn.TabIndex = 72;
@@ -229,7 +229,7 @@
             this.ma_softversion_label.CheckState = System.Windows.Forms.CheckState.Checked;
             this.ma_softversion_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.ma_softversion_label.Location = new System.Drawing.Point(907, 226);
-            this.ma_softversion_label.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.ma_softversion_label.Margin = new System.Windows.Forms.Padding(4);
             this.ma_softversion_label.Name = "ma_softversion_label";
             this.ma_softversion_label.Size = new System.Drawing.Size(114, 31);
             this.ma_softversion_label.TabIndex = 74;
@@ -243,7 +243,7 @@
             this.ma_ecncode_label.CheckState = System.Windows.Forms.CheckState.Checked;
             this.ma_ecncode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.ma_ecncode_label.Location = new System.Drawing.Point(907, 278);
-            this.ma_ecncode_label.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.ma_ecncode_label.Margin = new System.Windows.Forms.Padding(4);
             this.ma_ecncode_label.Name = "ma_ecncode_label";
             this.ma_ecncode_label.Size = new System.Drawing.Size(94, 31);
             this.ma_ecncode_label.TabIndex = 75;
@@ -255,7 +255,7 @@
             this.ClearSn_code.Cursor = System.Windows.Forms.Cursors.Hand;
             this.ClearSn_code.Image = global::UAS_MES.Properties.Resources.bindingNavigatorDeleteItem_Image;
             this.ClearSn_code.Location = new System.Drawing.Point(351, 591);
-            this.ClearSn_code.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.ClearSn_code.Margin = new System.Windows.Forms.Padding(4);
             this.ClearSn_code.Name = "ClearSn_code";
             this.ClearSn_code.Size = new System.Drawing.Size(21, 20);
             this.ClearSn_code.TabIndex = 138;
@@ -414,7 +414,7 @@
             // 
             this.OperateResult.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.OperateResult.Location = new System.Drawing.Point(17, 160);
-            this.OperateResult.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.OperateResult.Margin = new System.Windows.Forms.Padding(4);
             this.OperateResult.Name = "OperateResult";
             this.OperateResult.Size = new System.Drawing.Size(856, 362);
             this.OperateResult.TabIndex = 94;
@@ -428,7 +428,7 @@
             this.Clean.Image = ((System.Drawing.Image)(resources.GetObject("Clean.Image")));
             this.Clean.IsShowBorder = true;
             this.Clean.Location = new System.Drawing.Point(789, 541);
-            this.Clean.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.Clean.Margin = new System.Windows.Forms.Padding(4);
             this.Clean.MoveImage = ((System.Drawing.Image)(resources.GetObject("Clean.MoveImage")));
             this.Clean.Name = "Clean";
             this.Clean.NormalImage = ((System.Drawing.Image)(resources.GetObject("Clean.NormalImage")));
@@ -447,7 +447,7 @@
             this.ma_softversion.BackColor = System.Drawing.Color.White;
             this.ma_softversion.ID = null;
             this.ma_softversion.Location = new System.Drawing.Point(1029, 226);
-            this.ma_softversion.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.ma_softversion.Margin = new System.Windows.Forms.Padding(4);
             this.ma_softversion.Name = "ma_softversion";
             this.ma_softversion.Power = null;
             this.ma_softversion.Size = new System.Drawing.Size(140, 25);
@@ -464,7 +464,7 @@
             this.ma_ecncode.BackColor = System.Drawing.Color.White;
             this.ma_ecncode.ID = null;
             this.ma_ecncode.Location = new System.Drawing.Point(1029, 282);
-            this.ma_ecncode.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.ma_ecncode.Margin = new System.Windows.Forms.Padding(4);
             this.ma_ecncode.Name = "ma_ecncode";
             this.ma_ecncode.Power = null;
             this.ma_ecncode.Size = new System.Drawing.Size(140, 25);
@@ -481,7 +481,7 @@
             this.Confirm.Image = ((System.Drawing.Image)(resources.GetObject("Confirm.Image")));
             this.Confirm.IsShowBorder = true;
             this.Confirm.Location = new System.Drawing.Point(385, 640);
-            this.Confirm.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.Confirm.Margin = new System.Windows.Forms.Padding(4);
             this.Confirm.MoveImage = ((System.Drawing.Image)(resources.GetObject("Confirm.MoveImage")));
             this.Confirm.Name = "Confirm";
             this.Confirm.NormalImage = ((System.Drawing.Image)(resources.GetObject("Confirm.NormalImage")));
@@ -499,7 +499,7 @@
             this.code.BackColor = System.Drawing.Color.White;
             this.code.ID = null;
             this.code.Location = new System.Drawing.Point(131, 642);
-            this.code.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.code.Margin = new System.Windows.Forms.Padding(4);
             this.code.Name = "code";
             this.code.Power = null;
             this.code.Size = new System.Drawing.Size(212, 25);
@@ -517,7 +517,7 @@
             this.sn_code.Enabled = false;
             this.sn_code.ID = null;
             this.sn_code.Location = new System.Drawing.Point(131, 588);
-            this.sn_code.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.sn_code.Margin = new System.Windows.Forms.Padding(4);
             this.sn_code.Name = "sn_code";
             this.sn_code.Power = null;
             this.sn_code.Size = new System.Drawing.Size(212, 25);
@@ -600,16 +600,16 @@
             this.Controls.Add(this.ma_prodcode_label);
             this.Controls.Add(this.panel2);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
-            this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.Margin = new System.Windows.Forms.Padding(4);
             this.Name = "Make_FeedingCollection";
             this.Tag = "Make!FeedingCollection";
             this.Text = "上料采集";
             this.Load += new System.EventHandler(this.Make_FeedingCollection_Load);
             this.SizeChanged += new System.EventHandler(this.Make_FeedingCollection_SizeChanged);
-            this.panel2.ResumeLayout(true);
+            this.panel2.ResumeLayout(false);
             this.panel2.PerformLayout();
             ((System.ComponentModel.ISupportInitialize)(this.ClearSn_code)).EndInit();
-            this.ResumeLayout(true);
+            this.ResumeLayout(false);
             this.PerformLayout();
 
         }

+ 24 - 16
UAS-MES/FunctionCode/Make/Make_FeedingCollection.cs

@@ -54,6 +54,8 @@ namespace UAS_MES.Make
 
         List<string> CollectDataSonCode = new List<string>();
 
+        List<string> SPBOMVERSION = new List<string>();
+
         List<string> SPID = new List<string>();
 
         public Make_FeedingCollection()
@@ -143,7 +145,8 @@ namespace UAS_MES.Make
                             string sp_prefix = dt1.Rows[RemainIndex]["sp_prefix"].ToString();
                             string sp_regex = dt1.Rows[RemainIndex]["sp_regex"].ToString();
                             string length = dt1.Rows[RemainIndex]["sp_length"].ToString();
-                            string sp_id = dt1.Rows[RemainIndex]["sp_id"].ToString();
+                            string spbomversion = dt1.Rows[RemainIndex]["sp_bomversion"].ToString();
+                            string spid = dt1.Rows[RemainIndex]["sp_id"].ToString();
                             string sp_ifforsn = dt1.Rows[RemainIndex]["sp_ifforsn"].ToString();
                             string sp_barcoderule = dt1.Rows[RemainIndex]["sp_barcoderule"].ToString();
                             if (LogicHandler.CheckSNBeforeLoad(ma_code.Text, code.Text, sp_fsoncode, sp_soncode, sp_barcoderule, sp_prefix, length, out ErrorMessage))
@@ -159,7 +162,7 @@ namespace UAS_MES.Make
                                 {
                                     sp_soncode = ErrorMessage;
                                 }
-                                Save_OtherCode(sp_soncode, make_code, sn_code.Text, sp_id);
+                                Save_OtherCode(sp_soncode, make_code, sn_code.Text, spid, spbomversion);
                             }
                             else
                                 OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, code);
@@ -226,7 +229,7 @@ namespace UAS_MES.Make
                 //将录入框的值给序列号
                 sn_code.Text = code.Text;
                 sql.Clear();
-                sql.Append("select ma_prodcode,ma_ecncode,ma_softversion,ms_firstsn,ma_bomversion,ma_qty,ma_code,pr_detail,ms_status,ms_id,ms_craftcode,ms_nextstepcode");
+                sql.Append("select ma_prodcode,ma_ecncode,ma_craftcode,ma_softversion,ms_firstsn,ma_bomversion,ma_qty,ma_code,pr_detail,ms_status,ms_id,ms_craftcode,ms_nextstepcode");
                 sql.Append(",ms_prodcode,ms_makecode,ms_code,ms_stepname  from makeserial left join make on ma_code=ms_makecode ");
                 sql.Append("left join product on ms_prodcode=pr_code where ms_sncode='" + code.Text + "' order by ms_id desc");
                 dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
@@ -265,18 +268,20 @@ namespace UAS_MES.Make
                             if (dt.Rows[0]["ms_makecode"].ToString() != ma_code.Text && dt.Rows[0]["ms_status"].ToString() == "2")
                             {
                                 sql.Clear();
-                                sql.Append("select sp_id,sp_soncode from make inner join stepbom on ma_prodcode=sb_prodcode and ma_bomversion=sb_bomversion left ");
+                                sql.Append("select sp_id,sp_bomversion,sp_soncode from make inner join stepbom on ma_prodcode=sb_prodcode and ma_bomversion=sb_bomversion left ");
                                 sql.Append("join stepproduct on sp_sbid=sb_id where ma_code='" + ma_code.Text + "' and sp_craftcode='" + ms_craftcode.Text + "' ");
                                 sql.Append("and sp_stepcode='" + User.CurrentStepCode + "' and nvl(sp_ifforsn,0)<>0");
                                 dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                                 if (dt.Rows.Count > 0)
                                 {
-                                    string sp_id = dt.Rows[0]["sp_id"].ToString();
+                                    string spbomversion = dt.Rows[0]["sp_bomversion"].ToString();
+                                    string spid = dt.Rows[0]["sp_id"].ToString();
                                     string sp_soncode = dt.Rows[0]["sp_soncode"].ToString();
                                     if (!dh.CheckExist("Craftmaterial", "cm_makecode='" + ma_code.Text + "' and cm_soncode='" + make_prodcode + "' and cm_sncode='" + code.Text + "' and cm_status=0"))
                                     {
+                                        SPID.Add(spid);
                                         CollectDataSonCode.Add(sp_soncode);
-                                        SPID.Add(sp_id);
+                                        SPBOMVERSION.Add(spbomversion);
                                         CollectData.Add(code.Text.Substring(0, code.Text.Length > 40 ? 40 : code.Text.Length));
                                         sn_code.Text = code.Text;
                                         OperateResult.AppendText(">>序列号" + code.Text + ",物料" + sp_soncode + "上料成功\n", Color.Green);
@@ -302,7 +307,7 @@ namespace UAS_MES.Make
                         ms_status = dt.Rows[0]["ms_status"].ToString();
                         sn_code.Text = code.Text;
                         sql.Clear();
-                        sql.Append("select ma_code,ma_softversion,ma_ecncode,ma_prodcode,pr_detail,ma_qty from makeserial left join product ");
+                        sql.Append("select ma_code,ma_softversion,ma_craftcode,ma_ecncode,ma_prodcode,pr_detail,ma_qty,ma_craftcode from makeserial left join product ");
                         sql.Append(" on ms_prodcode=pr_code left join make on ms_makecode=ma_code left join ");
                         sql.Append("makecraftdetail on mcd_macode=ms_makecode where ms_id='" + oMsid + "'");
                         dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
@@ -326,11 +331,11 @@ namespace UAS_MES.Make
             //单独用一个DataTable存储一个
             dt1 = new DataTable();
             sql.Clear();
-            sql.Append("select max(sp_id)sp_id,max(sp_detno)sp_detno,sp_fsoncode,max(sp_barcoderule)");
+            sql.Append("select max(sp_id)sp_id,max(sp_bomversion)sp_bomversion,max(sp_detno)sp_detno,sp_fsoncode,max(sp_barcoderule)");
             sql.Append("sp_barcoderule,wm_concat(sp_soncode) sp_soncode,max(sp_ifuseregex)sp_ifuseregex,max(sp_ifforsn)");
             sql.Append("sp_ifforsn,max(sp_length)sp_length,max(sp_type)sp_type,max(sp_prefix)sp_prefix,max(sp_regex)");
             sql.Append("sp_regex,max(pr_detail)pr_detail from stepproduct left join product on pr_code=sp_fsoncode where ");
-            sql.Append("sp_bomversion='" + ma_bomversion.Text + "' and sp_craftcode='" + ms_craftcode.Text + "' and sp_stepcode='" + User.CurrentStepCode + "' ");
+            sql.Append("sp_bomversion='" + ma_bomversion.Text + "' and sp_craftcode='" + ma_craftcode.Text + "' and sp_stepcode='" + User.CurrentStepCode + "' ");
             sql.Append("And sp_mothercode ='" + ma_prodcode.Text + "' and sp_tracekind=1 and not exists(select 1 from craftmaterial where ");
             sql.Append("cm_sncode in (select '" + ms_firstsn + "' from dual union select sn from makesnrelation where firstsn='" + ms_firstsn + "') and cm_makecode='" + ma_code.Text + "' and cm_fsoncode=");
             sql.Append("sp_fsoncode and cm_status=0) group by sp_fsoncode order by SP_DETNO asc");
@@ -377,13 +382,14 @@ namespace UAS_MES.Make
         }
 
         //此类中通用的保存逻辑
-        private void Save_OtherCode(string sp_soncode, string ma_code, string ms_sncode, string sp_id)
+        private void Save_OtherCode(string sp_soncode, string ma_code, string ms_sncode,string spid, string spbomversion)
         {
             CollectDataSonCode.Add(sp_soncode);
             //采集成功提示
             RemainIndex = RemainIndex + 1;
             CollectData.Add(code.Text.Substring(0, code.Text.Length > 40 ? 40 : code.Text.Length));
-            SPID.Add(sp_id);
+            SPID.Add(spid);
+            SPBOMVERSION.Add(spbomversion);
             OperateResult.AppendText(">>物料" + sp_soncode + "采集成功,条码" + code.Text + "\n", Color.Green);
             code.Clear();
             //如果+1后不小于B序列的长度,则已采集完成,不需要进行提示了
@@ -400,14 +406,14 @@ namespace UAS_MES.Make
                 sql.Append("mcd_stepname,sp_fsoncode,ms_craftcode,ms_craftname,:barcode,1,sysdate,'" + User.UserCode + "','" + User.UserLineCode + "',ma_wccode,");
                 sql.Append("'" + User.UserSourceCode + "',:sp_id,0,1,ms_firstsn from make left join makecraftdetail on mcd_macode=ma_code  left join stepproduct on sp_stepcode=mcd_stepcode ");
                 sql.Append("and sp_craftcode=ma_craftcode and sp_mothercode = ma_prodcode left join makeserial on ms_makecode=ma_code ");
-                sql.Append("where ma_code='" + make_code + "'and sp_id=:sp_id1 and mcd_stepcode = '" + User.CurrentStepCode + "' and ms_sncode='" + ms_sncode + "'");
-                dh.BatchInsert(sql.GetString(), new string[] { "soncode", "barcode", "sp_id", "sp_id1" }, CollectDataSonCode.ToArray(), CollectData.ToArray(), SPID.ToArray(), SPID.ToArray());
+                sql.Append("where ma_code='" + make_code + "'and sp_bomversion=:sp_bomversion and mcd_stepcode = '" + User.CurrentStepCode + "' and ms_sncode='" + ms_sncode + "'");
+                dh.BatchInsert(sql.GetString(), new string[] { "soncode", "barcode", "sp_id", "sp_bomversion" }, CollectDataSonCode.ToArray(), CollectData.ToArray(), SPID.ToArray(), SPBOMVERSION.ToArray());
                 try
                 {
                     string Log = "";
                     for (int i = 0; i < CollectDataSonCode.Count; i++)
                     {
-                        Log += CollectDataSonCode.ToArray()[i] + " " + CollectData.ToArray()[i] + " " + SPID.ToArray()[i];
+                        Log += CollectDataSonCode.ToArray()[i] + " " + CollectData.ToArray()[i] + " " + SPBOMVERSION.ToArray()[i];
                     }
                     LogManager.DoLog(Log);
                 }
@@ -431,8 +437,9 @@ namespace UAS_MES.Make
                     dh.ExecuteSql(sql.GetString(), "insert");
                 }
                 CollectData.Clear();
-                TSN.Clear();
                 SPID.Clear();
+                TSN.Clear();
+                SPBOMVERSION.Clear();
                 CollectDataSonCode.Clear();
                 //采集成功,设置序列号栏目为空
                 RemainIndex = 0;
@@ -456,9 +463,10 @@ namespace UAS_MES.Make
         private void ClearSn_code_Click(object sender, EventArgs e)
         {
             sn_code.Clear();
-            SPID.Clear();
+            SPBOMVERSION.Clear();
             TSN.Clear();
             CollectData.Clear();
+            SPID.Clear();
             CollectDataSonCode.Clear();
             if (dt1 != null)
                 BaseUtil.CleanDataTableData(dt1);

+ 66 - 13
UAS_CustomerInterface/MesHelper.cs

@@ -1,6 +1,7 @@
 using Oracle.ManagedDataAccess.Client;
 using System;
 using System.Collections.Generic;
+using System.ComponentModel;
 using System.Data;
 using System.Runtime.InteropServices;
 using System.Text;
@@ -12,7 +13,7 @@ namespace UAS.MES
     [InterfaceType(ComInterfaceType.InterfaceIsDual)]
     public interface IMESHelper
     {
-        [DispId(12)]
+        [DispId(14)]
         bool CheckRoutePassed(string iSN, string iResCode, out string oErrMessage);
         bool GetRcardMOInfo(string iSN, out string oMoCode, out string oErrMessage);
         bool CheckUserAndResourcePassed(string iUserCode, string iResCode, string iPassWord, out string oErrMessage);
@@ -20,12 +21,13 @@ namespace UAS.MES
         bool SetAddressInfo(string iSN, string iWIFI, string iBT, string iCode1, string iCode2, string iCode3, out string oErrorMessage);
         bool SetTestDetail(string iSN, string iTestResult, string iResCode, string[] iTestDetail, out string oErrMessage);
         bool GetMEIOrNetCodeRange(string iSnCode, string iIMEI1, string iNetCode, out string oIMEI1, out string oIMEI2, out string oMEID, out string oNetCode, out string oPSN, out string oID1, out string oID2, out string oID3, out string oID4, out string oID5, out string oErrMessage);
-        bool SetIMEIInfo(string iSnCode, string iIMEI1, out string oErrMessage);
+        bool SetIMEIInfo(string iSnCode, string iIMEI1, string iIMEI2, string iIMEI3, out string oErrMessage);
+        bool SetKeyInfo(string iSN, string iKey1, string iKey2, string iKey3, out string oErrMessage);
         bool GetMobileAllInfo(string iSnCode, out string oWIFI, out string oBT, out string oCode1, out string oCode2, out string oCode3, out string oIMEI1, out string oIMEI2, out string oMEID, out string oNetCode, out string oPSN, out string oID1, out string oID2, out string oID3, out string oID4, out string oID5, out string oErrorMessage);
         bool SetMobileData(string iTSN, string iSN, string iSourceCode, string iOperator, string iResult, string iErrCode, string flag, out string oErrorMessage);
         bool SetPcbaData(string iSN, string iResCode, string iOperator, string iResult, string iErrCode, out string oErrMessage);
         bool GoMo(string iMO, string iSN, string iResCode, out string oErrMessage);
-        bool GetSNAllInfo(string iSN, out string oMakeCode, out string oSaleCode, out string oProdType, out string oSoftVersion1, out string oSoftVersion2, out string oSoftVersion3, out string oMaterialCode1, out string oMaterialCode2, out string oMaterialCode3, out string oMAC, out string oBT, out string oIMEI1, out string oIMEI2, out string oIMEI3, out string oMEID, out string oNetCode, out string oPSN, out string oID1, out string oID2, out string oID3, out string oErrMessage);
+        bool GetSNAllInfo(string iSN, out string oMakeCode, out string oSaleCode, out string oProdType, out string oSoftVersion1, out string oSoftVersion2, out string oSoftVersion3, out string oMaterialCode1, out string oMaterialCode2, out string oMaterialCode3, out string oMaterialCode4, out string oMaterialCode5, out string oMAC, out string oBT, out string oIMEI1, out string oIMEI2, out string oIMEI3, out string oMEID, out string oNetCode, out string oPSN, out string oID1, out string oID2, out string oID3, out string oItem1, out string oItem2, out string oItem3, out string oItem4, out string oErrMessage);
     }
 
     [Guid("707D771D-AA71-4BC1-B2DA-05CBBA868362")]
@@ -39,7 +41,7 @@ namespace UAS.MES
         //用于存放批量执行的SQL
         List<string> sqls = new List<string>();
         //系统默认的的连接字符串
-        private string ConnectionStrings = "Data Source=192.168.230.200/orcl;User ID=MES;PassWord=select!#%*(;";
+        private string ConnectionStrings = "Data Source=192.168.230.200/orcl;User ID=MES_TEST;PassWord=select!#%*(;";
         //用户选择的数据库的连接字符串
         private OracleConnection connection;
         //用户选择的数据库的连接字符串
@@ -57,6 +59,7 @@ namespace UAS.MES
         /// <param name="iResCode"></param>
         /// <param name="oErrMessage"></param>
         /// <returns></returns>
+        [Description("验证登陆信息")]
         public bool CheckRoutePassed(string iSN, string iResCode, out string oErrMessage)
         {
             if (iSN == "")
@@ -103,6 +106,7 @@ namespace UAS.MES
         /// <param name="iResCode"></param>
         /// <param name="oErrMessage"></param>
         /// <returns></returns>
+        [Description("验证用户身份信息和岗位资源")]
         public bool CheckUserAndResourcePassed(string iUserCode, string iResCode, string iPassWord, out string oErrMessage)
         {
             oErrMessage = "";
@@ -172,6 +176,7 @@ namespace UAS.MES
         /// <param name="oCdoe3"></param>
         /// <param name="oErrMessage"></param>
         /// <returns></returns>
+        [Description("分配Mac地址和BT地址")]
         public bool GetAddressRangeByMO(string iSN, out string oWIFI, out string oBT, out string oCode1, out string oCode2, out string oCdoe3, out string oErrMessage)
         {
             oWIFI = "";
@@ -220,6 +225,7 @@ namespace UAS.MES
         /// <param name="oID3"></param>
         /// <param name="oErrMessage"></param>
         /// <returns></returns>
+        [Description("获取IMEI,网标信息")]
         public bool GetMEIOrNetCodeRange(string iSN, string iIMEI1, string iNetCode, out string oIMEI1, out string oIMEI2, out string oMEID, out string oNetCode, out string oPSN, out string oID1, out string oID2, out string oID3, out string oID4, out string oID5, out string oErrMessage)
         {
             oIMEI1 = "";
@@ -263,6 +269,7 @@ namespace UAS.MES
         /// <param name="oMoCode"></param>
         /// <param name="oErrMessage"></param>
         /// <returns></returns>
+        [Description("获取工单信息")]
         public bool GetRcardMOInfo(string iSN, out string oMoCode, out string oErrMessage)
         {
             //取MakeProcess表中的执行记录ID最大的一个工单的号码
@@ -306,6 +313,7 @@ namespace UAS.MES
         /// <param name="oID5"></param>
         /// <param name="oErrMessage"></param>
         /// <returns></returns>
+        [Description("获取序列号关联信息")]
         public bool GetMobileAllInfo(string iSN, out string oWIFI, out string oBT, out string oCode1, out string oCode2, out string oCode3, out string oIMEI1, out string oIMEI2, out string oMEID, out string oNetCode, out string oPSN, out string oID1, out string oID2, out string oID3, out string oID4, out string oID5, out string oErrMessage)
         {
             oBT = "";
@@ -399,6 +407,7 @@ namespace UAS.MES
         /// <param name="iCode3"></param>
         /// <param name="oErrMessage"></param>
         /// <returns></returns>
+        [Description("保存Mac地址和BT地址")]
         public bool SetAddressInfo(string iSN, string iWIFI, string iBT, string iCode1, string iCode2, string iCode3, out string oErrMessage)
         {
             if (iSN == "")
@@ -417,6 +426,7 @@ namespace UAS.MES
                 return false;
         }
 
+        [Description("执行过站")]
         public bool SetStepFinish(string iMakeCode, string iSourceCode, string iSN, string iMPKind, string iResult, string iUserCode, string iErrCode, out string oErrMessage)
         {
             if (iSN == "")
@@ -452,8 +462,10 @@ namespace UAS.MES
                             InsertSQL.Add(sql.ToString().Replace(":bc_code", "'" + BadCode[i] + "'"));
                         }
                         ExecuteSQLTran(InsertSQL.ToArray());
+                        oErrMessage = "测试NG,请重新测试或者判定为不良";
+                        return false;
                         //将不良的序列号的状态码设为3
-                        ExecuteSql("update makeserial set ms_status='3' where ms_sncode='" + iSN + "' and ms_makecode='" + iMakeCode + "'", "update");
+                        //ExecuteSql("update makeserial set ms_status='3' where ms_sncode='" + iSN + "' and ms_makecode='" + iMakeCode + "'", "update");
                     }
                     break;
                 default:
@@ -491,6 +503,7 @@ namespace UAS.MES
         /// <param name="iUserCode"></param>
         /// <param name="oErrorMessage"></param>
         /// <returns></returns>
+        [Description("转号过站")]
         public bool SetMobileData(string iTSN, string iSN, string iSourceCode, string iOperater, string iResult, string iErrCode, string flag, out string oErrorMessage)
         {
             oErrorMessage = "";
@@ -541,6 +554,7 @@ namespace UAS.MES
         /// <param name="iTestResult"></param>
         /// <param name="oErrMessage"></param>                                                      
         /// <returns></returns>
+        [Description("上传测试结果")]
         public bool SetTestDetail(string iSN, string iTestResult, string iResCode, string[] iTestDetail, out string oErrMessage)
         {
             if (iSN == "" || iSN == null)
@@ -581,7 +595,8 @@ namespace UAS.MES
         /// <param name="iID3"></param>
         /// <param name="oErrorMessage"></param>
         /// <returns></returns>
-        public bool SetIMEIInfo(string iSN, string iIMEI1, out string oErrMessage)
+        [Description("保存IMEI信息")]
+        public bool SetIMEIInfo(string iSN, string iIMEI1, string iIMEI2, string iIMEI3, out string oErrMessage)
         {
             if (iSN == "")
             {
@@ -589,9 +604,28 @@ namespace UAS.MES
                 return false;
             }
             oErrMessage = "";
-            string[] param = new string[] { iSN, iIMEI1, "", "", "", "", "", "", "", "", oErrMessage };
+            string[] param = new string[] { iSN, iIMEI1, iIMEI2, iIMEI3, "", "", "", "", "", "", oErrMessage };
+            string[] ParamName = new string[] { "v_i_sncode", "v_i_imei1", "v_i_imei2", "v_i_imei3", "v_i_meid", "v_i_netcode", "v_i_psn", "v_i_id1", "v_i_id2", "v_i_id3", "v_o_errmsg" };
+            CallProcedure("CS_SETKEYINFO", ParamName, ref param);
+            oErrMessage = param[10];
+            if (oErrMessage == "" || oErrMessage == null || oErrMessage == "null")
+                return true;
+            else
+                return false;
+        }
+
+        [Description("保存Key信息")]
+        public bool SetKeyInfo(string iSnCode, string iKey1, string iKey2, string iKey3, out string oErrMessage)
+        {
+            if (iSnCode == "")
+            {
+                oErrMessage = "SN不能为空";
+                return false;
+            }
+            oErrMessage = "";
+            string[] param = new string[] { iSnCode, "", "", "", "", "", "", iKey1, iKey2, iKey3, oErrMessage };
             string[] ParamName = new string[] { "v_i_sncode", "v_i_imei1", "v_i_imei2", "v_i_imei3", "v_i_meid", "v_i_netcode", "v_i_psn", "v_i_id1", "v_i_id2", "v_i_id3", "v_o_errmsg" };
-            CallProcedure("CS_SETIMEIINFO", ParamName, ref param);
+            CallProcedure("CS_SETKEYINFO", ParamName, ref param);
             oErrMessage = param[10];
             if (oErrMessage == "" || oErrMessage == null || oErrMessage == "null")
                 return true;
@@ -609,6 +643,7 @@ namespace UAS.MES
         /// <param name="iErrCode"></param>
         /// <param name="oErrMessage"></param>
         /// <returns></returns>
+        [Description("调用过站方法")]
         public bool SetPcbaData(string iSN, string iResCode, string iOperator, string iResult, string iErrCode, out string oErrMessage)
         {
             if (iSN == "")
@@ -629,6 +664,7 @@ namespace UAS.MES
                 return false;
         }
 
+        [Description("序列号归属工单")]
         public bool GoMo(string iMO, string iSN, string iResCode, out string oErrMessage)
         {
             if (iSN == "")
@@ -1043,7 +1079,7 @@ namespace UAS.MES
             }
         }
         /// <summary>
-        /// 获取序列号所有的信息
+        /// 获取序列号全部信息
         /// </summary>
         /// <param name="iSN"></param>
         /// <param name="oMakeCode"></param>
@@ -1066,9 +1102,14 @@ namespace UAS.MES
         /// <param name="oID1"></param>
         /// <param name="oID2"></param>
         /// <param name="oID3"></param>
+        /// <param name="oItem1"></param>
+        /// <param name="oItem2"></param>
+        /// <param name="oItem3"></param>
+        /// <param name="oItem4"></param>
         /// <param name="oErrMessage"></param>
         /// <returns></returns>
-        public bool GetSNAllInfo(string iSN, out string oMakeCode, out string oSaleCode, out string oProdType, out string oSoftVersion1, out string oSoftVersion2, out string oSoftVersion3, out string oMaterialCode1, out string oMaterialCode2, out string oMaterialCode3, out string oMAC, out string oBT, out string oIMEI1, out string oIMEI2, out string oIMEI3, out string oMEID, out string oNetCode, out string oPSN, out string oID1, out string oID2, out string oID3, out string oErrMessage)
+        [Description("获取SN信息")]
+        public bool GetSNAllInfo(string iSN, out string oMakeCode, out string oSaleCode, out string oProdType, out string oSoftVersion1, out string oSoftVersion2, out string oSoftVersion3, out string oMaterialCode1, out string oMaterialCode2, out string oMaterialCode3, out string oMaterialCode4, out string oMaterialCode5, out string oMAC, out string oBT, out string oIMEI1, out string oIMEI2, out string oIMEI3, out string oMEID, out string oNetCode, out string oPSN, out string oID1, out string oID2, out string oID3, out string oItem1, out string oItem2, out string oItem3, out string oItem4, out string oErrMessage)
         {
             oMakeCode = "";
             oSaleCode = "";
@@ -1079,6 +1120,8 @@ namespace UAS.MES
             oMaterialCode1 = "";
             oMaterialCode2 = "";
             oMaterialCode3 = "";
+            oMaterialCode4 = "";
+            oMaterialCode5 = "";
             oMAC = "";
             oBT = "";
             oIMEI1 = "";
@@ -1090,6 +1133,10 @@ namespace UAS.MES
             oID1 = "";
             oID2 = "";
             oID3 = "";
+            oItem1 = "";
+            oItem2 = "";
+            oItem3 = "";
+            oItem4 = "";
             oErrMessage = "";
             if (iSN == "")
             {
@@ -1097,8 +1144,8 @@ namespace UAS.MES
                 return false;
             }
             oErrMessage = "";
-            string[] param = new string[] { iSN, oMakeCode,oSaleCode,oProdType,oSoftVersion1,oSoftVersion2,oSoftVersion3,oMaterialCode1,oMaterialCode2,oMaterialCode3, oMAC, oBT, oIMEI1,oIMEI2,oIMEI3,oMEID,oNetCode,oPSN,oID1,oID2,oID3, oErrMessage };
-            string[] ParamName = new string[] { "v_i_sncode", "v_o_makecode", "v_o_salecode", "v_o_prodtype", "v_o_softverision1", "v_o_softverision2", "v_o_softverision3", "v_o_materialcode1", "v_o_materialcode2", "v_o_materialcode3", "v_o_mac", "v_o_bt", "v_o_imei1", "v_o_imei2", "v_o_imei3", "v_o_meid", "v_o_netcode", "v_o_psn", "v_o_id1", "v_o_id2", "v_o_id3", "v_o_errmsg" };
+            string[] param = new string[] { iSN, oMakeCode, oSaleCode, oProdType, oSoftVersion1, oSoftVersion2, oSoftVersion3, oMaterialCode1, oMaterialCode2, oMaterialCode3, oMAC, oBT, oIMEI1, oIMEI2, oIMEI3, oMEID, oNetCode, oPSN, oID1, oID2, oID3, oItem1, oItem2, oItem3, oItem4, oErrMessage, oMaterialCode4, oMaterialCode5 };
+            string[] ParamName = new string[] { "v_i_sncode", "v_o_makecode", "v_o_salecode", "v_o_prodtype", "v_o_softverision1", "v_o_softverision2", "v_o_softverision3", "v_o_materialcode1", "v_o_materialcode2", "v_o_materialcode3", "v_o_mac", "v_o_bt", "v_o_imei1", "v_o_imei2", "v_o_imei3", "v_o_meid", "v_o_netcode", "v_o_psn", "v_o_id1", "v_o_id2", "v_o_id3", "v_o_item1", "v_o_item2", "v_o_item3", "v_o_item4", "v_o_errmsg", "v_o_materialcode4", "v_o_materialcode5" };
             CallProcedure("CS_DLLGETSNINFO", ParamName, ref param);
             oMakeCode = param[1];
             oSaleCode = param[2];
@@ -1120,7 +1167,13 @@ namespace UAS.MES
             oID1 = param[18];
             oID2 = param[19];
             oID3 = param[20];
-            oErrMessage = param[21];
+            oItem1 = param[21];
+            oItem2 = param[22];
+            oItem3 = param[23];
+            oItem4 = param[24];
+            oErrMessage = param[25];
+            oMaterialCode4 = param[26];
+            oMaterialCode5 = param[27];
             if (oErrMessage == "" || oErrMessage == null || oErrMessage == "null")
                 return true;
             else