Browse Source

Merge branch 'master' of repos.ubtob.net:usoft/mes-client

callm 3 years ago
parent
commit
10350103d1
98 changed files with 3519 additions and 980 deletions
  1. 2 2
      UAS_MES_DN/App.config
  2. 8 8
      UAS_MES_DN/CustomControl/CustomCheckBox/ReSetCheckBox.cs
  3. 67 0
      UAS_MES_DN/DataOperate/ExcelHandler.cs
  4. 1 1
      UAS_MES_DN/FunctionCode/Make/Make_ColorBoxLoadPrint.cs
  5. 1 1
      UAS_MES_DN/FunctionCode/Make/Make_ColorBoxLoadPrintBZ.cs
  6. 3 2
      UAS_MES_DN/FunctionCode/Make/Make_Decompose.cs
  7. 3 2
      UAS_MES_DN/FunctionCode/Make/Make_Decompose_Ex.cs
  8. 15 4
      UAS_MES_DN/FunctionCode/Make/Make_FeedingCollection.Designer.cs
  9. 4 2
      UAS_MES_DN/FunctionCode/Make/Make_FeedingCollection.cs
  10. 3 0
      UAS_MES_DN/FunctionCode/Make/Make_FeedingCollection.resx
  11. 1 1
      UAS_MES_DN/FunctionCode/Make/Make_FeedingCollectionCombineFix.cs
  12. 1 1
      UAS_MES_DN/FunctionCode/Make/Make_PreFeedingCollection.cs
  13. 25 11
      UAS_MES_DN/FunctionCode/Make/Make_TestCollection.cs
  14. 1 1
      UAS_MES_DN/FunctionCode/Make/Make_TestCollectionBad.cs
  15. 173 0
      UAS_MES_DN/FunctionCode/Special/Special_GetSNLog.Designer.cs
  16. 79 0
      UAS_MES_DN/FunctionCode/Special/Special_GetSNLog.cs
  17. 165 0
      UAS_MES_DN/FunctionCode/Special/Special_GetSNLog.resx
  18. 2 1
      UAS_MES_DN/Login.cs
  19. 4 4
      UAS_MES_DN/Properties/Settings.settings
  20. 12 12
      UAS_MES_DN/Properties/Settings1.Designer.cs
  21. 6 0
      UAS_MES_DN/PublicMethod/BaseUtil.cs
  22. 6 1
      UAS_MES_DN/PublicMethod/LogicHandler.cs
  23. 66 14
      UAS_MES_DN/PublicMethod/ftpOperater.cs
  24. 12 3
      UAS_MES_DN/UAS_MES_DN.csproj
  25. 1 1
      UAS_MES_JH/App.config
  26. 1 1
      UAS_MES_JH/DataOperate/ExcelHandler.cs
  27. 28 4
      UAS_MES_JH/FunctionCode/Make/Make_ColorBoxLabelPrint.cs
  28. 0 17
      UAS_MES_JH/FunctionCode/Make/Make_TestCollection.Designer.cs
  29. 12 12
      UAS_MES_JH/FunctionCode/Make/Make_TestCollection.cs
  30. 69 69
      UAS_MES_JH/FunctionCode/Query/Query_ExeProgress.Designer.cs
  31. 2 1
      UAS_MES_JH/FunctionCode/Special/Special_Reset.cs
  32. 38 2
      UAS_MES_JH/FunctionCode/Special/Special_SmtLocation.cs
  33. 2 2
      UAS_MES_JH/Login.cs
  34. 2 2
      UAS_MES_JH/Properties/Settings.Designer.cs
  35. 1 1
      UAS_MES_JH/Properties/Settings.settings
  36. 9 0
      UAS_MES_JH/PublicMethod/LogicHandler.cs
  37. 1 1
      UAS_MES_JH/PublicMethod/Print.cs
  38. 1 1
      UAS_MES_LT/App.config
  39. 4 4
      UAS_MES_LT/CustomControl/RichText/RichTextAutoBottom.cs
  40. 9 6
      UAS_MES_LT/FunctionCode/Make/Make_ColorBoxLabelPrint.cs
  41. 4 4
      UAS_MES_LT/FunctionCode/Make/Make_ColorBoxLoadPrint.cs
  42. 27 24
      UAS_MES_LT/FunctionCode/Make/Make_ColorBoxWeigh.Designer.cs
  43. 38 16
      UAS_MES_LT/FunctionCode/Make/Make_ColorBoxWeigh.cs
  44. 3 3
      UAS_MES_LT/FunctionCode/Make/Make_Decompose.Designer.cs
  45. 47 0
      UAS_MES_LT/FunctionCode/Make/Make_Decompose.cs
  46. 1 0
      UAS_MES_LT/FunctionCode/Make/Make_Decompose_Ex.Designer.cs
  47. 0 72
      UAS_MES_LT/FunctionCode/Make/Make_Decompose_Ex.resx
  48. 5 5
      UAS_MES_LT/FunctionCode/Make/Make_FeedingCollection.Designer.cs
  49. 47 22
      UAS_MES_LT/FunctionCode/Make/Make_FeedingCollection.cs
  50. 8 5
      UAS_MES_LT/FunctionCode/Make/Make_FuselageLabelPrint.cs
  51. 88 73
      UAS_MES_LT/FunctionCode/Make/Make_RePrintLabel.Designer.cs
  52. 53 4
      UAS_MES_LT/FunctionCode/Make/Make_RePrintLabel.cs
  53. 172 183
      UAS_MES_LT/FunctionCode/Make/Make_Repair.Designer.cs
  54. 32 1
      UAS_MES_LT/FunctionCode/Make/Make_Repair.cs
  55. 50 0
      UAS_MES_LT/FunctionCode/Make/Make_Repair.resx
  56. 1 1
      UAS_MES_LT/FunctionCode/Make/Make_SeqTransformPrint.cs
  57. 1 0
      UAS_MES_LT/FunctionCode/Make/Make_TestCollection.Designer.cs
  58. 47 47
      UAS_MES_LT/FunctionCode/Make/Make_TestCollection.cs
  59. 3 1
      UAS_MES_LT/FunctionCode/Make/Make_TestCollectionBad.Designer.cs
  60. 18 18
      UAS_MES_LT/FunctionCode/Make/Make_TestCollectionBad.cs
  61. 30 15
      UAS_MES_LT/FunctionCode/Packing/Packing_PackageCollection.cs
  62. 35 18
      UAS_MES_LT/FunctionCode/Packing/Packing_PackageCollectionWeigh.cs
  63. 9 9
      UAS_MES_LT/FunctionCode/Packing/Packing_PalletCollection.Designer.cs
  64. 44 9
      UAS_MES_LT/FunctionCode/Packing/Packing_PalletCollection.cs
  65. 22 6
      UAS_MES_LT/FunctionCode/Packing/Packing_PalletWightCollection.cs
  66. 208 0
      UAS_MES_LT/FunctionCode/Special/Special_GetBad.Designer.cs
  67. 131 0
      UAS_MES_LT/FunctionCode/Special/Special_GetBad.cs
  68. 197 0
      UAS_MES_LT/FunctionCode/Special/Special_GetBad.resx
  69. 13 0
      UAS_MES_LT/FunctionCode/Special/Special_Reset.Designer.cs
  70. 4 0
      UAS_MES_LT/FunctionCode/Special/Special_Reset.cs
  71. 7 6
      UAS_MES_LT/Login.cs
  72. 2 2
      UAS_MES_LT/Properties/Settings.Designer.cs
  73. 1 1
      UAS_MES_LT/Properties/Settings.settings
  74. 4 9
      UAS_MES_LT/PublicMethod/BaseUtil.cs
  75. 1 1
      UAS_MES_LT/PublicMethod/LogicHandler.cs
  76. 198 85
      UAS_MES_LT/PublicMethod/Print.cs
  77. BIN
      UAS_MES_LT/Resources/Sound/FAIL.wav
  78. BIN
      UAS_MES_LT/Resources/Sound/PASS.wav
  79. 21 14
      UAS_MES_LT/UAS_MES_LT.csproj
  80. 1 1
      UAS_MES_WEIP/App.config
  81. 64 2
      UAS_MES_WEIP/DataOperate/ExcelHandler.cs
  82. 181 0
      UAS_MES_WEIP/FunctionCode/Make/Make_NewPo.Designer.cs
  83. 89 0
      UAS_MES_WEIP/FunctionCode/Make/Make_NewPo.cs
  84. 147 0
      UAS_MES_WEIP/FunctionCode/Make/Make_NewPo.resx
  85. 22 0
      UAS_MES_WEIP/FunctionCode/Make/Make_PositionStock.Designer.cs
  86. 7 0
      UAS_MES_WEIP/FunctionCode/Make/Make_PositionStock.cs
  87. 17 2
      UAS_MES_WEIP/FunctionCode/Make/Make_Repair.Designer.cs
  88. 64 1
      UAS_MES_WEIP/FunctionCode/Make/Make_Repair.cs
  89. 0 12
      UAS_MES_WEIP/FunctionCode/Make/Make_Repair.resx
  90. 64 5
      UAS_MES_WEIP/FunctionCode/Make/Make_SMTBind.Designer.cs
  91. 59 0
      UAS_MES_WEIP/FunctionCode/Make/Make_SMTBind.cs
  92. 94 0
      UAS_MES_WEIP/FunctionCode/Make/Make_SMTBind.resx
  93. 177 92
      UAS_MES_WEIP/FunctionCode/Make/Make_TestCollection.Designer.cs
  94. 92 0
      UAS_MES_WEIP/FunctionCode/Make/Make_TestCollection.cs
  95. 3 0
      UAS_MES_WEIP/FunctionCode/Make/Make_TestCollection.resx
  96. 14 14
      UAS_MES_WEIP/FunctionCode/Special/Special_SmtLocation.Designer.cs
  97. 3 2
      UAS_MES_WEIP/Login.cs
  98. 9 0
      UAS_MES_WEIP/UAS_MES_WEIP.csproj

+ 2 - 2
UAS_MES_DN/App.config

@@ -39,7 +39,7 @@
         <value />
       </setting>
       <setting name="FTPAddress" serializeAs="String">
-        <value>ftp://10.8.0.82|vsftpd|vsftpd</value>
+        <value>ftp://192.168.11.188|vsftpd|vsftpd</value>
       </setting>
     </UAS_MES_NEW.Properties.Settings>
     <UAS_MES.Properties.Settings>
@@ -72,7 +72,7 @@
   <applicationSettings>
     <UAS_MES_NEW.Properties.Settings>
       <setting name="MES" serializeAs="String">
-        <value>Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.11.188)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));</value>
+        <value>Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=usoft.f3322.net)(PORT=11636)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));</value>
       </setting>
     </UAS_MES_NEW.Properties.Settings>
   </applicationSettings>

+ 8 - 8
UAS_MES_DN/CustomControl/CustomCheckBox/ReSetCheckBox.cs

@@ -17,14 +17,14 @@ namespace UAS_MES_NEW.CustomControl.CustomCheckBox
         {
             if (dh != null)
             {
-                if (dh.getFieldDataByCondition("Step", "st_ifreset", "st_code='" + User.CurrentStepCode + "'").ToString() == "-1")
-                {
-                    Checked = true;
-                }
-                else
-                {
-                    Checked = false;
-                }
+                //if (dh.getFieldDataByCondition("Step", "st_ifreset", "st_code='" + User.CurrentStepCode + "'").ToString() == "-1")
+                //{
+                //    Checked = true;
+                //}
+                //else
+                //{
+                //    Checked = false;
+                //}
             }
         }
     }

+ 67 - 0
UAS_MES_DN/DataOperate/ExcelHandler.cs

@@ -55,6 +55,73 @@ namespace UAS_MES_NEW.DataOperate
             return filePath;
         }
 
+
+        /// <summary>
+        /// 将CSV文件中内容读取到DataTable中
+        /// </summary>
+        /// <param name="path">CSV文件路径</param>
+        /// <param name="hasTitle">是否将CSV文件的第一行读取为DataTable的列名</param>
+        /// <returns></returns>
+        public static DataTable ReadFromCSV(string path, bool hasTitle = true)
+        {
+            DataTable dt = new DataTable();           //要输出的数据表
+            StreamReader sr = new StreamReader(path, System.Text.Encoding.GetEncoding("GB2312")); //文件读入流
+            bool bFirst = true;                       //指示是否第一次读取数据
+
+            //逐行读取
+            string line;
+            while ((line = sr.ReadLine()) != null)
+            {
+                if (line.EndsWith(","))
+                {
+                    line = line.Substring(0, line.Length - 1);
+                }
+                string[] elements = line.Replace("\r", "").Replace("\n", "").Replace("\t", "").Split(',');
+                string[] ele;
+                if (elements.Length > 1)
+                {
+                    ele = new string[] { elements[0], elements[1] };
+                }
+                else {
+                     ele = new string[] { };
+                }
+                //第一次读取数据时,要创建数据列
+                if (bFirst)
+                {
+                    for (int i = 0; i < 2; i++)
+                    {
+                        dt.Columns.Add();
+                    }
+                    bFirst = false;
+                }
+
+                //有标题行时,第一行当做标题行处理
+                if (hasTitle)
+                {
+                    for (int i = 0; i < dt.Columns.Count && i < ele.Length; i++)
+                    {
+                        dt.Columns[i].ColumnName = ele[i];
+                    }
+                    hasTitle = false;
+                }
+                else //读取一行数据
+                {
+                    if (ele.Length == 2)
+                    {
+                        dt.Rows.Add(ele);
+                    }
+                    else
+                    {
+                        //throw new Exception("CSV格式错误:表格各行列数不一致");
+                    }
+                }
+            }
+            sr.Close();
+
+            return dt;
+        }
+
+
         /// <summary>
         /// 导入Excel
         /// </summary>

+ 1 - 1
UAS_MES_DN/FunctionCode/Make/Make_ColorBoxLoadPrint.cs

@@ -177,7 +177,7 @@ namespace UAS_MES_NEW.Make
                             string sp_barcoderule = dt1.Rows[RemainIndex]["sp_barcoderule"].ToString();
                             string sp_checkbarcode = dt1.Rows[RemainIndex]["sp_checkbarcode"].ToString();
                             string sp_checksalecode = dt1.Rows[RemainIndex]["sp_checksalecode"].ToString();
-                            if (LogicHandler.CheckSNBeforeLoad(ma_code.Text, code.Text, sp_fsoncode, sp_soncode, sp_barcoderule, sp_prefix, length, sp_ifrepeat, sp_checksalecode, out ErrorMessage))
+                            if (LogicHandler.CheckSNBeforeLoad(ma_code.Text, code.Text, sp_fsoncode, sp_soncode, sp_barcoderule, sp_prefix, length, sp_ifrepeat, sp_checksalecode,"", out ErrorMessage))
                             {
                                 //判断采集的条码和本次采集的也不能重复
                                 if (CollectData.Contains(code.Text) && sp_ifrepeat != "-1")

+ 1 - 1
UAS_MES_DN/FunctionCode/Make/Make_ColorBoxLoadPrintBZ.cs

@@ -176,7 +176,7 @@ namespace UAS_MES_NEW.Make
                             string sp_barcoderule = dt1.Rows[RemainIndex]["sp_barcoderule"].ToString();
                             string sp_checkbarcode = dt1.Rows[RemainIndex]["sp_checkbarcode"].ToString();
                             string sp_checksalecode = dt1.Rows[RemainIndex]["sp_checksalecode"].ToString();
-                            if (LogicHandler.CheckSNBeforeLoad(ma_code.Text, code.Text, sp_fsoncode, sp_soncode, sp_barcoderule, sp_prefix, length, sp_ifrepeat, sp_checksalecode, out ErrorMessage))
+                            if (LogicHandler.CheckSNBeforeLoad(ma_code.Text, code.Text, sp_fsoncode, sp_soncode, sp_barcoderule, sp_prefix, length, sp_ifrepeat, sp_checksalecode,"", out ErrorMessage))
                             {
                                 //判断采集的条码和本次采集的也不能重复
                                 if (CollectData.Contains(code.Text) && sp_ifrepeat != "-1")

+ 3 - 2
UAS_MES_DN/FunctionCode/Make/Make_Decompose.cs

@@ -261,7 +261,7 @@ namespace UAS_MES_NEW.Make
                             sql.Clear();
                             sql.Append("select max(sp_id)sp_id,max(sp_detno)sp_detno,min(sp_ifrepeat)sp_ifrepeat,sp_fsoncode,max(sp_barcoderule)");
                             sql.Append("sp_barcoderule, min(sp_checksalecode)sp_checksalecode,sp_tracekind,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,replace(wm_concat(sp_prefix),',','|')sp_prefix,max(sp_regex)");
+                            sql.Append("sp_ifforsn,max(sp_length)sp_length,max(sp_description)sp_description,max(sp_type)sp_type,replace(wm_concat(sp_prefix),',','|')sp_prefix,max(sp_regex)");
                             sql.Append("sp_regex,max(substr(pr_spec,0,20))pr_detail from stepproduct left join product on pr_code=sp_fsoncode where ");
                             sql.Append("sp_bomversion='" + ma_bomversion + "' and  sp_craftcode='" + LabelDataGridView.Rows[i].Cells["cm_craftcode"].Value + "'and sp_mothercode ='" + LabelDataGridView.Rows[i].Cells["cm_maprodcode"].Value + "'");
                             sql.Append(" group by sp_fsoncode,sp_tracekind  order by SP_DETNO asc");
@@ -279,10 +279,11 @@ namespace UAS_MES_NEW.Make
                                 string sp_ifrepeat = dtbar.Rows[0]["sp_ifrepeat"].ToString();
                                 string sp_barcoderule = dtbar.Rows[0]["sp_barcoderule"].ToString();
                                 string sp_checksalecode = dtbar.Rows[0]["sp_checksalecode"].ToString();
+                                string sp_description = dtbar.Rows[0]["sp_description"].ToString();
                                 if (sp_tracekind == "1")
                                 {
                                     //上料校验规则判断
-                                    if (!LogicHandler.CheckSNBeforeLoad(LabelDataGridView.Rows[i].Cells["cm_makecode"].Value.ToString(), LabelDataGridView.Rows[i].Cells["New_BarCode"].Value.ToString(), sp_fsoncode, sp_soncode, sp_barcoderule, sp_prefix, length, sp_ifrepeat, sp_checksalecode, out ErrorMessage))
+                                    if (!LogicHandler.CheckSNBeforeLoad(LabelDataGridView.Rows[i].Cells["cm_makecode"].Value.ToString(), LabelDataGridView.Rows[i].Cells["New_BarCode"].Value.ToString(), sp_fsoncode, sp_soncode, sp_barcoderule, sp_prefix, length, sp_ifrepeat, sp_checksalecode, sp_description, out ErrorMessage))
                                     {
                                         OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
                                         LoadData(sncode_1, sender, new KeyEventArgs(Keys.Enter));

+ 3 - 2
UAS_MES_DN/FunctionCode/Make/Make_Decompose_Ex.cs

@@ -261,7 +261,7 @@ namespace UAS_MES_NEW.Make
                             sql.Clear();
                             sql.Append("select max(sp_id)sp_id,max(sp_detno)sp_detno,min(sp_ifrepeat)sp_ifrepeat,min(sp_iflabelcheck)sp_iflabelcheck,sp_fsoncode,max(sp_barcoderule)");
                             sql.Append("sp_barcoderule, min(sp_checksalecode)sp_checksalecode,sp_tracekind,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,replace(wm_concat(sp_prefix),',','|')sp_prefix,max(sp_regex)");
+                            sql.Append("sp_ifforsn,max(sp_length)sp_length,max(sp_description)sp_description,max(sp_type)sp_type,replace(wm_concat(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 + "' and  sp_craftcode='" + LabelDataGridView.Rows[i].Cells["cm_craftcode"].Value + "'and sp_mothercode ='" + LabelDataGridView.Rows[i].Cells["cm_maprodcode"].Value + "'");
                             sql.Append(" group by sp_fsoncode,sp_tracekind  order by SP_DETNO asc");
@@ -280,10 +280,11 @@ namespace UAS_MES_NEW.Make
                                 string sp_barcoderule = dtbar.Rows[0]["sp_barcoderule"].ToString();
                                 string sp_checksalecode = dtbar.Rows[0]["sp_checksalecode"].ToString();
                                 string sp_iflabelcheck = dtbar.Rows[0]["sp_iflabelcheck"].ToString();
+                                string sp_description = dtbar.Rows[0]["sp_description"].ToString();
                                 if (sp_tracekind == "1")
                                 {
                                     //上料校验规则判断
-                                    if (!LogicHandler.CheckSNBeforeLoad(LabelDataGridView.Rows[i].Cells["cm_makecode"].Value.ToString(), LabelDataGridView.Rows[i].Cells["New_BarCode"].Value.ToString(), sp_fsoncode, sp_soncode, sp_barcoderule, sp_prefix, length, sp_ifrepeat, sp_checksalecode, out ErrorMessage))
+                                    if (!LogicHandler.CheckSNBeforeLoad(LabelDataGridView.Rows[i].Cells["cm_makecode"].Value.ToString(), LabelDataGridView.Rows[i].Cells["New_BarCode"].Value.ToString(), sp_fsoncode, sp_soncode, sp_barcoderule, sp_prefix, length, sp_ifrepeat, sp_checksalecode, sp_description, out ErrorMessage))
                                     {
                                         OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
                                         LoadData(sncode_1, sender, new KeyEventArgs(Keys.Enter));

+ 15 - 4
UAS_MES_DN/FunctionCode/Make/Make_FeedingCollection.Designer.cs

@@ -76,6 +76,7 @@
             this.cm_makecode = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pr_detail_ = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.cm_soncode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.sp_description = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.cm_barcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.BarCode = new System.Windows.Forms.DataGridViewTextBoxColumn();
             ((System.ComponentModel.ISupportInitialize)(this.ClearSn_code)).BeginInit();
@@ -294,7 +295,7 @@
             this.NoteForChange.AutoSize = true;
             this.NoteForChange.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.NoteForChange.Location = new System.Drawing.Point(11, 39);
-            this.NoteForChange.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.NoteForChange.Margin = new System.Windows.Forms.Padding(2);
             this.NoteForChange.Name = "NoteForChange";
             this.NoteForChange.Size = new System.Drawing.Size(99, 21);
             this.NoteForChange.TabIndex = 192;
@@ -311,6 +312,7 @@
             this.cm_makecode,
             this.pr_detail_,
             this.cm_soncode,
+            this.sp_description,
             this.cm_barcode,
             this.BarCode});
             this.LabelDataGridView.Location = new System.Drawing.Point(18, 108);
@@ -396,7 +398,7 @@
             // 
             this.StepCount.LineCode = null;
             this.StepCount.Location = new System.Drawing.Point(460, 344);
-            this.StepCount.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.StepCount.Margin = new System.Windows.Forms.Padding(2);
             this.StepCount.Name = "StepCount";
             this.StepCount.Size = new System.Drawing.Size(80, 22);
             this.StepCount.Source = null;
@@ -411,7 +413,7 @@
             this.ma_code.DBTitle = null;
             this.ma_code.FormName = null;
             this.ma_code.Location = new System.Drawing.Point(96, 13);
-            this.ma_code.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.ma_code.Margin = new System.Windows.Forms.Padding(2);
             this.ma_code.Name = "ma_code";
             this.ma_code.Power = null;
             this.ma_code.ReturnData = null;
@@ -430,7 +432,7 @@
             this.LockMakeCode.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.LockMakeCode.LeaveEvent = false;
             this.LockMakeCode.Location = new System.Drawing.Point(248, 15);
-            this.LockMakeCode.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.LockMakeCode.Margin = new System.Windows.Forms.Padding(2);
             this.LockMakeCode.Name = "LockMakeCode";
             this.LockMakeCode.Size = new System.Drawing.Size(51, 21);
             this.LockMakeCode.TabIndex = 140;
@@ -642,6 +644,14 @@
             this.cm_soncode.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
             this.cm_soncode.Width = 60;
             // 
+            // sp_description
+            // 
+            this.sp_description.DataPropertyName = "sp_description";
+            this.sp_description.HeaderText = "包含";
+            this.sp_description.MinimumWidth = 60;
+            this.sp_description.Name = "sp_description";
+            this.sp_description.Width = 60;
+            // 
             // cm_barcode
             // 
             this.cm_barcode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader;
@@ -765,6 +775,7 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn cm_makecode;
         private System.Windows.Forms.DataGridViewTextBoxColumn pr_detail_;
         private System.Windows.Forms.DataGridViewTextBoxColumn cm_soncode;
+        private System.Windows.Forms.DataGridViewTextBoxColumn sp_description;
         private System.Windows.Forms.DataGridViewTextBoxColumn cm_barcode;
         private System.Windows.Forms.DataGridViewTextBoxColumn BarCode;
     }

+ 4 - 2
UAS_MES_DN/FunctionCode/Make/Make_FeedingCollection.cs

@@ -159,7 +159,9 @@ namespace UAS_MES_NEW.Make
                             string sp_barcoderule = dt1.Rows[RemainIndex]["sp_barcoderule"].ToString();
                             string sp_checkbarcode = dt1.Rows[RemainIndex]["sp_checkbarcode"].ToString();
                             string sp_checksalecode = dt1.Rows[RemainIndex]["sp_checksalecode"].ToString();
-                            if (LogicHandler.CheckSNBeforeLoad(ma_code.Text, code.Text, sp_fsoncode, sp_soncode, sp_barcoderule, sp_prefix, length, sp_ifrepeat, sp_checksalecode, out ErrorMessage))
+                            string sp_description = dt1.Rows[RemainIndex]["sp_description"].ToString();
+                            //sp_description
+                            if (LogicHandler.CheckSNBeforeLoad(ma_code.Text, code.Text, sp_fsoncode, sp_soncode, sp_barcoderule, sp_prefix, length, sp_ifrepeat, sp_checksalecode, sp_description, out ErrorMessage))
                             {
                                 //判断采集的条码和本次采集的也不能重复
                                 if (CollectData.Contains(code.Text) && sp_ifrepeat != "-1")
@@ -374,7 +376,7 @@ namespace UAS_MES_NEW.Make
             sql.Append("select max(sp_id)sp_id,max(sp_detno)sp_detno,min(sp_ifrepeat)sp_ifrepeat,max(sp_checkbarcode)sp_checkbarcode,min(sp_checksalecode)sp_checksalecode,");
             sql.Append("sp_fsoncode,max(sp_barcoderule)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,replace(wm_concat(sp_prefix),',','|')sp_prefix,max(sp_regex)");
-            sql.Append("sp_regex,max(pr_detail)pr_detail,max(substr(pr_spec,0,20))pr_spec from stepproduct left join product on pr_code=sp_fsoncode where ");
+            sql.Append("sp_regex,max(pr_detail)pr_detail,max(sp_description) sp_description,max(substr(pr_spec,0,20))pr_spec 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("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=");

+ 3 - 0
UAS_MES_DN/FunctionCode/Make/Make_FeedingCollection.resx

@@ -129,6 +129,9 @@
   <metadata name="cm_soncode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
+  <metadata name="sp_description.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
   <metadata name="cm_barcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>

+ 1 - 1
UAS_MES_DN/FunctionCode/Make/Make_FeedingCollectionCombineFix.cs

@@ -239,7 +239,7 @@ namespace UAS_MES_NEW.Make
                                             string sp_checkbarcode = dt1.Rows[RemainIndex]["sp_checkbarcode"].ToString();
                                             string sp_checksalecode = dt1.Rows[RemainIndex]["sp_checksalecode"].ToString();
                                             string sp_ifbeforhandle = dt1.Rows[RemainIndex]["sp_ifbeforhandle"].ToString();
-                                            if (LogicHandler.CheckSNBeforeLoad(ma_code.Text, code.Text, sp_fsoncode, sp_soncode, sp_barcoderule, sp_prefix, length, sp_ifrepeat, sp_checksalecode, out ErrorMessage))
+                                            if (LogicHandler.CheckSNBeforeLoad(ma_code.Text, code.Text, sp_fsoncode, sp_soncode, sp_barcoderule, sp_prefix, length, sp_ifrepeat, sp_checksalecode,"", out ErrorMessage))
                                             {
                                                 if (sp_ifbeforhandle == "是")
                                                 {

+ 1 - 1
UAS_MES_DN/FunctionCode/Make/Make_PreFeedingCollection.cs

@@ -171,7 +171,7 @@ namespace UAS_MES_NEW.Make
                                 set.ShowDialog();
                                 return;
                             }
-                            if (LogicHandler.CheckSNBeforeLoad(ma_code.Text, code.Text, sp_fsoncode, sp_soncode, sp_barcoderule, sp_prefix, length, sp_ifrepeat, sp_checksalecode, out ErrorMessage))
+                            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 + "'"))

+ 25 - 11
UAS_MES_DN/FunctionCode/Make/Make_TestCollection.cs

@@ -20,6 +20,7 @@ namespace UAS_MES_NEW.Make
         DataHelper dh = null;
         DataTable dt = null;
         //当前工序的名称
+        ftpOperater ftp = null;
 
         string ErrorMessage = "";
         //用于保存是否之前输入的ms_sncode
@@ -72,14 +73,15 @@ namespace UAS_MES_NEW.Make
             ma_code.SetLockCheckBox(LockMakeCode);
             ControlLockTimer.Tick += ControlLockTimer_Tick;
             ControlLockTimer.Interval = 100;
-
+            ftp = new ftpOperater();
             labelname = System.Windows.Forms.Application.StartupPath + @"\badsn.lab";
 
             thread = new Thread(NewPrint);
             SetLoadingWindow stw = new SetLoadingWindow(thread, "初始化打印程序");
             BaseUtil.SetFormCenter(stw);
             stw.ShowDialog();
-
+            if (User.CurrentStepCode == "BZ_TEST")
+                AutoBadCode.Checked = true;
             //工单号放大镜配置
             ma_code.TableName = "make left join product on ma_prodcode=pr_code";
             ma_code.SelectField = "ma_code # 工单号,ma_prodcode # 产品编号,ma_qty # 工单数量,pr_spec # 产品规格,ma_softversion # 软件版本,ma_salecode # 销售单号,pr_sendchecktype # 产品送检方式";
@@ -373,18 +375,30 @@ namespace UAS_MES_NEW.Make
                     }
                     else
                     {
-                        if (AutoBadCode.Checked)
+                        if (this.AutoBadCode.Checked)
                         {
-                            string str = BaseUtil.GetDataFromDevice("DEVICES");
-                            str = str.Replace("LIST OF DEVICES ATTACHED", "").Replace("\n", "");
-                            if (!(str.Length == 0))
+                            if (BaseUtil.GetDataFromDevice("DEVICES").Replace("LIST OF DEVICES ATTACHED", "").Replace("\n", "").Length > 0U)
                             {
-                                Console.WriteLine("有链接");
+                                if (BaseUtil.GetDataFromDevice("GETFILE").Contains("ERROR"))
+                                {
+                                    OperateResult.AppendText(">>获取测试日志失败,请重试\n", Color.Red, (Control)this.ms_sncode);
+                                    return;
+                                }
+                                DataTable dataTable = ExcelHandler.ReadFromCSV("C:\\UAS_MES\\unknown_Fail.csv");
+                                for (int index = 0; index < 13; ++index)
+                                {
+                                    if (dataTable.Rows[index]["TestResult"].ToString() == "NG")
+                                    {
+                                        this.OperateResult.AppendText(">>测试日志出现NG项,无法通过\n", Color.Red, (Control)this.ms_sncode);
+                                        return;
+                                    }
+                                }
+                                ftp.UpLoadFile("C:\\UAS_MES", "unknown_Fail.csv", "/log/", this.ms_sncode.Text + ".csv");
                                 BaseUtil.GetDataFromDevice("RESET");
                             }
                             else
                             {
-                                OperateResult.AppendText(">>无设备链接,无法恢复出厂设置,采集失败\n", Color.Red, ms_sncode);
+                                this.OperateResult.AppendText(">>无设备链接,无法恢复出厂设置,采集失败\n", Color.Red, (Control)this.ms_sncode);
                                 return;
                             }
                         }
@@ -853,15 +867,15 @@ namespace UAS_MES_NEW.Make
             if (!PrintFile.Exists)
             {
                 MessageBox.Show("打印文件不存在");
-                return ;
+                return;
             }
             doc = lbl.Documents.Open(labelname, true);
             if (doc == null)
             {
                 MessageBox.Show("标签文件打开失败");
-                return ;
+                return;
             }
-            for (int j = 1; j < doc.Variables.FormVariables.Count+1; j++)
+            for (int j = 1; j < doc.Variables.FormVariables.Count + 1; j++)
             {
                 switch (doc.Variables.FormVariables.Item(j).Name)
                 {

+ 1 - 1
UAS_MES_DN/FunctionCode/Make/Make_TestCollectionBad.cs

@@ -548,7 +548,7 @@ namespace UAS_MES_NEW.Make
                 }
                 //不良信息采集,mb_status<>0的是之前维修保存的,不能删除
                 dh.ExecuteSql("delete from makebad where mb_sncode='" + ms_sncode.Text + "' and mb_makecode='" + ma_code.Text + "' and nvl(mb_status,0)=0", "delete");
-                //normalButton1_Click(this, e);
+                normalButton1_Click(this, e);
                 if (LogicHandler.SetTestNGDetail(ms_sncode.Text, ma_code.Text, User.UserCode, User.UserSourceCode, "检查未通过", bgcode, bccode, bgname, bcname, bcremark, out ErrorMessage))
                 {
                     //存在的不良代码和

+ 173 - 0
UAS_MES_DN/FunctionCode/Special/Special_GetSNLog.Designer.cs

@@ -0,0 +1,173 @@
+namespace UAS_MES_NEW.Special
+{
+    partial class Special_GetSNLog
+    {
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows Form Designer generated code
+
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Special_GetSNLog));
+            this.Pallet_label = new System.Windows.Forms.Label();
+            this.button1 = new System.Windows.Forms.Button();
+            this.OperatResult = new UAS_MES_NEW.CustomControl.RichText.RichTextAutoBottom();
+            this.SNCODE = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.Split = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
+            this.dataGridView1 = new System.Windows.Forms.DataGridView();
+            this.TestResult = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.button2 = new System.Windows.Forms.Button();
+            ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
+            this.SuspendLayout();
+            // 
+            // Pallet_label
+            // 
+            this.Pallet_label.AutoSize = true;
+            this.Pallet_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.Pallet_label.Location = new System.Drawing.Point(18, 131);
+            this.Pallet_label.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.Pallet_label.Name = "Pallet_label";
+            this.Pallet_label.Size = new System.Drawing.Size(48, 21);
+            this.Pallet_label.TabIndex = 1;
+            this.Pallet_label.Text = "SN号";
+            // 
+            // button1
+            // 
+            this.button1.Location = new System.Drawing.Point(267, 207);
+            this.button1.Name = "button1";
+            this.button1.Size = new System.Drawing.Size(75, 23);
+            this.button1.TabIndex = 4;
+            this.button1.Text = "button1";
+            this.button1.UseVisualStyleBackColor = true;
+            this.button1.Visible = false;
+            this.button1.Click += new System.EventHandler(this.button1_Click);
+            // 
+            // OperatResult
+            // 
+            this.OperatResult.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.OperatResult.Location = new System.Drawing.Point(378, 60);
+            this.OperatResult.Margin = new System.Windows.Forms.Padding(2);
+            this.OperatResult.Name = "OperatResult";
+            this.OperatResult.Size = new System.Drawing.Size(204, 310);
+            this.OperatResult.TabIndex = 3;
+            this.OperatResult.Text = "";
+            // 
+            // SNCODE
+            // 
+            this.SNCODE.AllPower = null;
+            this.SNCODE.BackColor = System.Drawing.Color.White;
+            this.SNCODE.ID = null;
+            this.SNCODE.Location = new System.Drawing.Point(91, 133);
+            this.SNCODE.Margin = new System.Windows.Forms.Padding(2);
+            this.SNCODE.Name = "SNCODE";
+            this.SNCODE.Power = null;
+            this.SNCODE.Size = new System.Drawing.Size(148, 21);
+            this.SNCODE.Str = null;
+            this.SNCODE.Str1 = null;
+            this.SNCODE.Str2 = null;
+            this.SNCODE.TabIndex = 2;
+            // 
+            // Split
+            // 
+            this.Split.AllPower = null;
+            this.Split.BackColor = System.Drawing.Color.Transparent;
+            this.Split.DownImage = ((System.Drawing.Image)(resources.GetObject("Split.DownImage")));
+            this.Split.Image = null;
+            this.Split.IsShowBorder = true;
+            this.Split.Location = new System.Drawing.Point(267, 133);
+            this.Split.Margin = new System.Windows.Forms.Padding(2);
+            this.Split.MoveImage = ((System.Drawing.Image)(resources.GetObject("Split.MoveImage")));
+            this.Split.Name = "Split";
+            this.Split.NormalImage = ((System.Drawing.Image)(resources.GetObject("Split.NormalImage")));
+            this.Split.Power = null;
+            this.Split.Size = new System.Drawing.Size(56, 22);
+            this.Split.TabIndex = 0;
+            this.Split.Text = "获取";
+            this.Split.UseVisualStyleBackColor = false;
+            this.Split.Click += new System.EventHandler(this.Split_Click);
+            // 
+            // dataGridView1
+            // 
+            this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+            this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
+            this.TestResult});
+            this.dataGridView1.Location = new System.Drawing.Point(22, 299);
+            this.dataGridView1.Name = "dataGridView1";
+            this.dataGridView1.RowTemplate.Height = 23;
+            this.dataGridView1.Size = new System.Drawing.Size(341, 201);
+            this.dataGridView1.TabIndex = 5;
+            this.dataGridView1.Visible = false;
+            // 
+            // TestResult
+            // 
+            this.TestResult.DataPropertyName = "TestResult";
+            this.TestResult.HeaderText = "TestResult";
+            this.TestResult.Name = "TestResult";
+            // 
+            // button2
+            // 
+            this.button2.Location = new System.Drawing.Point(41, 207);
+            this.button2.Name = "button2";
+            this.button2.Size = new System.Drawing.Size(75, 23);
+            this.button2.TabIndex = 6;
+            this.button2.Text = "button2";
+            this.button2.UseVisualStyleBackColor = true;
+            this.button2.Visible = false;
+            this.button2.Click += new System.EventHandler(this.button2_Click);
+            // 
+            // Special_GetSNLog
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(692, 527);
+            this.Controls.Add(this.button2);
+            this.Controls.Add(this.dataGridView1);
+            this.Controls.Add(this.button1);
+            this.Controls.Add(this.OperatResult);
+            this.Controls.Add(this.SNCODE);
+            this.Controls.Add(this.Pallet_label);
+            this.Controls.Add(this.Split);
+            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
+            this.Margin = new System.Windows.Forms.Padding(2);
+            this.Name = "Special_GetSNLog";
+            this.Tag = "Special!GetSNLog";
+            this.Text = "获取LOG文件";
+            this.Load += new System.EventHandler(this.Special_BoxSplit_Load);
+            ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private CustomControl.ButtonUtil.NormalButton Split;
+        private System.Windows.Forms.Label Pallet_label;
+        private CustomControl.TextBoxWithIcon.EnterTextBox SNCODE;
+        private CustomControl.RichText.RichTextAutoBottom OperatResult;
+        private System.Windows.Forms.Button button1;
+        private System.Windows.Forms.DataGridView dataGridView1;
+        private System.Windows.Forms.Button button2;
+        private System.Windows.Forms.DataGridViewTextBoxColumn TestResult;
+    }
+}

+ 79 - 0
UAS_MES_DN/FunctionCode/Special/Special_GetSNLog.cs

@@ -0,0 +1,79 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+using UAS_MES_NEW.DataOperate;
+using UAS_MES_NEW.Entity;
+using UAS_MES_NEW.PublicMethod;
+
+namespace UAS_MES_NEW.Special
+{
+    public partial class Special_GetSNLog : Form
+    {
+        DataHelper dh;
+        ftpOperater ftp = null;
+        LogStringBuilder sql = new LogStringBuilder();
+
+        public Special_GetSNLog()
+        {
+            InitializeComponent();
+        }
+
+        private void Special_BoxSplit_Load(object sender, EventArgs e)
+        {
+            dh = SystemInf.dh;
+             ftp = new ftpOperater();
+        }
+
+        private void Split_Click(object sender, EventArgs e)
+        {
+            if (!dh.CheckExist("makeserial", "ms_sncode = '" + SNCODE.Text + "' or MS_FIRSTSN = '" + SNCODE.Text + "'"))
+            {
+                OperatResult.AppendText(">>SN号" + SNCODE.Text + "不存在\n", Color.Red, SNCODE);
+                return;
+            }
+            try
+            {
+                string sn = dh.getFieldDataByCondition("makeserial", "ms_firstsn", "ms_sncode = '" + SNCODE.Text + "' or MS_FIRSTSN = '" + SNCODE.Text + "'").ToString();
+                string address = ftp.Download(sn+".csv");
+                if (address.Length == 0)
+                {
+                    OperatResult.AppendText(">>SN号" + SNCODE.Text + "不存在LOG文件\n", Color.Red, SNCODE);
+                    return;
+                }
+                OperatResult.AppendText(">>SN号" + SNCODE.Text + "LOG文件下载至"+ address + "\n", Color.Green, SNCODE);
+                return;
+            }
+            catch (Exception ex)
+            {
+                OperatResult.AppendText(ex.Message+"\n", Color.Red, SNCODE);
+                return;
+            }
+        }
+
+        private void button1_Click(object sender, EventArgs e)
+        {
+            ftp.UpLoadFile(Environment.GetEnvironmentVariable("windir").Substring(0, 1) + @":\" + @"SNLog", "1.csv","/log/", SNCODE.Text +".csv");
+            MessageBox.Show("OK");
+        }
+
+        private void button2_Click(object sender, EventArgs e)
+        {
+           DataTable dt =  ExcelHandler.ReadFromCSV(@"C:\UAS_MES\unknown_Fail.csv", true);
+            for (int i = 0; i < 13; i++)
+            {
+                if (dt.Rows[i]["TestResult"].ToString() == "NG")
+                {
+                    MessageBox.Show("NG");
+                    break;
+                }
+            }
+            MessageBox.Show("OK");
+            BaseUtil.FillDgvWithDataTable(dataGridView1, dt);
+        }
+    }
+}

+ 165 - 0
UAS_MES_DN/FunctionCode/Special/Special_GetSNLog.resx

@@ -0,0 +1,165 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+  <data name="Split.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="Split.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="Split.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>
+  <metadata name="TestResult.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="TestResult.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+</root>

+ 2 - 1
UAS_MES_DN/Login.cs

@@ -93,7 +93,8 @@ namespace UAS_MES_NEW
             //设置选中数据库的链接
             string DBUser = DB.SelectedValue.ToString().Split('#')[0];
             string Address = DB.SelectedValue.ToString().Split('#')[1];
-            DataHelper.DBConnectionString = "Password=select!#%*(;User ID=" + DBUser + ";Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=" + Address + ")(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+            DataHelper.DBConnectionString = "Password=select!#%*(;User ID=" + DBUser + ";Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=usoft.f3322.net)(PORT=11636)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+            //DataHelper.DBConnectionString = "Password=select!#%*(;User ID=" + DBUser + ";Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=" + Address + ")(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
             SystemInf.CurrentDB = DBUser;
             //设置屏幕的宽高信息
             SystemInf.ScreenWidth = Screen.PrimaryScreen.WorkingArea.Width;

+ 4 - 4
UAS_MES_DN/Properties/Settings.settings

@@ -23,11 +23,11 @@
     <Setting Name="BaudRate" Type="System.String" Scope="User">
       <Value Profile="(Default)" />
     </Setting>
-    <Setting Name="FTPAddress" Type="System.String" Scope="User">
-      <Value Profile="(Default)">ftp://10.8.0.82|vsftpd|vsftpd</Value>
-    </Setting>
     <Setting Name="MES" Type="System.String" Scope="Application">
-      <Value Profile="(Default)">Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.11.188)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));</Value>
+      <Value Profile="(Default)">Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=usoft.f3322.net)(PORT=11636)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));</Value>
+    </Setting>
+    <Setting Name="FTPAddress" Type="System.String" Scope="User">
+      <Value Profile="(Default)">ftp://192.168.11.188|vsftpd|vsftpd</Value>
     </Setting>
   </Settings>
 </SettingsFile>

+ 12 - 12
UAS_MES_DN/Properties/Settings.Designer.cs → UAS_MES_DN/Properties/Settings1.Designer.cs

@@ -107,9 +107,20 @@ namespace UAS_MES_NEW.Properties {
             }
         }
         
+        [global::System.Configuration.ApplicationScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=MES;Pooling=false" +
+            ";Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=usoft.f3322" +
+            ".net)(PORT=11636)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));")]
+        public string MES {
+            get {
+                return ((string)(this["MES"]));
+            }
+        }
+        
         [global::System.Configuration.UserScopedSettingAttribute()]
         [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-        [global::System.Configuration.DefaultSettingValueAttribute("ftp://10.8.0.82|vsftpd|vsftpd")]
+        [global::System.Configuration.DefaultSettingValueAttribute("ftp://192.168.11.188|vsftpd|vsftpd")]
         public string FTPAddress {
             get {
                 return ((string)(this["FTPAddress"]));
@@ -118,16 +129,5 @@ namespace UAS_MES_NEW.Properties {
                 this["FTPAddress"] = value;
             }
         }
-        
-        [global::System.Configuration.ApplicationScopedSettingAttribute()]
-        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-        [global::System.Configuration.DefaultSettingValueAttribute("Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=MES;Pooling=false" +
-            ";Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.11." +
-            "188)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));")]
-        public string MES {
-            get {
-                return ((string)(this["MES"]));
-            }
-        }
     }
 }

+ 6 - 0
UAS_MES_DN/PublicMethod/BaseUtil.cs

@@ -1484,6 +1484,12 @@ namespace UAS_MES_NEW.PublicMethod
                     value = p.StandardOutput.ReadToEnd().Replace(":", "").ToUpper();
                     p.Close();
                     break;
+                case "GETFILE":
+                    p.StartInfo.Arguments = @"pull /sdcard/factory/unknown_Fail.csv C:\UAS_MES ";
+                    p.Start();
+                    value = p.StandardOutput.ReadToEnd().Replace(":", "").ToUpper();
+                    p.Close();
+                    break;
                 default:
                     break;
             }

+ 6 - 1
UAS_MES_DN/PublicMethod/LogicHandler.cs

@@ -1059,7 +1059,7 @@ namespace UAS_MES_NEW.PublicMethod
             return param[4];
         }
 
-        public static bool CheckSNBeforeLoad(string iMakeCode, string iSN, string iFSonCode, string iSonCode, string iRule, string iPrefix, string iLength, string iIfRepeat, string iChecksalecode, out string ErrMessage)
+        public static bool CheckSNBeforeLoad(string iMakeCode, string iSN, string iFSonCode, string iSonCode, string iRule, string iPrefix, string iLength, string iIfRepeat, string iChecksalecode,string sp_description, out string ErrMessage)
         {
             DataTable dt;
             ErrMessage = "";
@@ -1142,6 +1142,11 @@ namespace UAS_MES_NEW.PublicMethod
                             return false;
                         }
                     }
+                    if (sp_description.Length > 0 && !iSN.Contains(sp_description))
+                    {
+                        ErrMessage = "条码" + iSN + "包含值不匹配";
+                        return false;
+                    }
                     int sp_length = int.Parse(iLength != "" ? iLength : "0");
                     //若有多个,以|分割
                     string[] pres = iPrefix.Split('|');

+ 66 - 14
UAS_MES_DN/PublicMethod/ftpOperater.cs

@@ -13,7 +13,7 @@ namespace UAS_MES_NEW.PublicMethod
         //从配置文件读取FTP信息
         public static string FTPAddress = Properties.Settings.Default.Properties["FTPAddress"].DefaultValue.ToString().Split('|')[0];
 
-        public static string DownLoadTo = Environment.GetEnvironmentVariable("windir").Substring(0, 1) + @":\" + @"打印标签\";
+        public static string DownLoadTo = Environment.GetEnvironmentVariable("windir").Substring(0, 1) + @":\" + @"SNLog";
 
         private string FTPInf;
         private string ftpServerIP;
@@ -34,22 +34,70 @@ namespace UAS_MES_NEW.PublicMethod
         }
 
         #region
-        public void UpLoadFile(string filepath, string filename, string UploadFolder)
+        public void UpLoadFile(string filepath, string filename, string UploadFolder,string upfilename)
         {
-            //上传之前判断文件是否存在
-            string[] filelist = GetFileList();
-            if (filelist != null)
-                for (int i = 0; i < filelist.Length; i++)
+            ////上传之前判断文件是否存在
+            //string[] filelist = GetFileList();
+            //if (filelist != null)
+            //    for (int i = 0; i < filelist.Length; i++)
+            //    {
+            //        if (filelist[i] == filename)
+            //        {
+            //            string upload = MessageBox.Show("已存在同名文件,是否覆盖", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
+            //            if (upload.ToString() != "Yes")
+            //            {
+            //                return;
+            //            }
+            //        }
+            //    }
+            FtpWebRequest reqFTP;
+            FtpCheckDirectoryExist(UploadFolder);
+            reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri(ftpServerIP + UploadFolder + upfilename));
+            reqFTP.UseBinary = true;
+            reqFTP.Credentials = new NetworkCredential(ftpUser, ftpPwd);
+            reqFTP.Method = WebRequestMethods.Ftp.UploadFile;
+            FileInfo file = new FileInfo(filepath + "/" + filename);
+            const int BufferSize = 2048;
+            byte[] content = new byte[BufferSize - 1 + 1];
+            int dataRead;
+            using (FileStream fs = file.OpenRead())
+            {
+                //把上传的文件写入流
+                using (Stream rs = reqFTP.GetRequestStream())
                 {
-                    if (filelist[i] == filename)
+                    do
                     {
-                        string upload = MessageBox.Show("已存在同名文件,是否覆盖", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
-                        if (upload.ToString() != "Yes")
-                        {
-                            return;
-                        }
-                    }
+                        //每次读文件流的2KB
+                        dataRead = fs.Read(content, 0, BufferSize);
+                        rs.Write(content, 0, dataRead);
+                    } while (!(dataRead < BufferSize));
+                    rs.Close();
                 }
+                fs.Close();
+            }
+            Thread.Sleep(1000);
+            File.Delete(filepath + "/" + filename);
+        }
+
+
+
+
+        public void UpLoadFile(string filepath, string filename, string UploadFolder)
+        {
+            ////上传之前判断文件是否存在
+            //string[] filelist = GetFileList();
+            //if (filelist != null)
+            //    for (int i = 0; i < filelist.Length; i++)
+            //    {
+            //        if (filelist[i] == filename)
+            //        {
+            //            string upload = MessageBox.Show("已存在同名文件,是否覆盖", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
+            //            if (upload.ToString() != "Yes")
+            //            {
+            //                return;
+            //            }
+            //        }
+            //    }
             FtpWebRequest reqFTP;
             FtpCheckDirectoryExist(UploadFolder);
             reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri(ftpServerIP + UploadFolder + filename));
@@ -310,8 +358,11 @@ namespace UAS_MES_NEW.PublicMethod
             FtpWebRequest reqFTP;
             try
             {
+                //不存在文件的话进行创建
+                if (!Directory.Exists(DownLoadTo))
+                    Directory.CreateDirectory(DownLoadTo);
                 FileStream outputStream = new FileStream(DownLoadTo + @"\" + fileName, FileMode.Create);
-                reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri(ftpServerIP + "/" + fileName));
+                reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri(ftpServerIP + "/log/" + fileName));
                 reqFTP.Method = WebRequestMethods.Ftp.DownloadFile;
                 reqFTP.UseBinary = true;
                 reqFTP.Credentials = new NetworkCredential(ftpUser, ftpPwd);
@@ -337,6 +388,7 @@ namespace UAS_MES_NEW.PublicMethod
             catch (Exception ex)
             {
                 MessageBox.Show(ex.Message);
+                File.Delete(DownLoadTo + @"\" + fileName);
                 return "";
             }
         }

+ 12 - 3
UAS_MES_DN/UAS_MES_DN.csproj

@@ -4,7 +4,7 @@
   <PropertyGroup>
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
     <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <ProjectGuid>{4F7963D5-1759-4789-A36A-CFE93E56D2B3}</ProjectGuid>
+    <ProjectGuid>{7D83E695-236B-4B35-85CB-D82670F4CFC7}</ProjectGuid>
     <OutputType>WinExe</OutputType>
     <AppDesignerFolder>Properties</AppDesignerFolder>
     <RootNamespace>UAS_MES_NEW</RootNamespace>
@@ -982,6 +982,12 @@
     <Compile Include="FunctionCode\SMT\SMT_WaringSetting.Designer.cs">
       <DependentUpon>SMT_WaringSetting.cs</DependentUpon>
     </Compile>
+    <Compile Include="FunctionCode\Special\Special_GetSNLog.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="FunctionCode\Special\Special_GetSNLog.Designer.cs">
+      <DependentUpon>Special_GetSNLog.cs</DependentUpon>
+    </Compile>
     <Compile Include="FunctionCode\Special\Special_BoxSplit.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -1151,7 +1157,7 @@
       <DesignTime>True</DesignTime>
       <DependentUpon>Resources.resx</DependentUpon>
     </Compile>
-    <Compile Include="Properties\Settings.Designer.cs">
+    <Compile Include="Properties\Settings1.Designer.cs">
       <AutoGen>True</AutoGen>
       <DesignTimeSharedInput>True</DesignTimeSharedInput>
       <DependentUpon>Settings.settings</DependentUpon>
@@ -1555,6 +1561,9 @@
     <EmbeddedResource Include="FunctionCode\SMT\SMT_WaringSetting.resx">
       <DependentUpon>SMT_WaringSetting.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="FunctionCode\Special\Special_GetSNLog.resx">
+      <DependentUpon>Special_GetSNLog.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="FunctionCode\Special\Special_BoxSplit.resx">
       <DependentUpon>Special_BoxSplit.cs</DependentUpon>
     </EmbeddedResource>
@@ -1652,7 +1661,7 @@
     <None Include="packages.config" />
     <None Include="Properties\Settings.settings">
       <Generator>SettingsSingleFileGenerator</Generator>
-      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
+      <LastGenOutput>Settings1.Designer.cs</LastGenOutput>
     </None>
   </ItemGroup>
   <ItemGroup>

+ 1 - 1
UAS_MES_JH/App.config

@@ -72,7 +72,7 @@
   <applicationSettings>
     <UAS_MES_NEW.Properties.Settings>
       <setting name="MES" serializeAs="String">
-        <value>Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=joyhong.tpddns.cn)(PORT=1522)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));</value>
+        <value>Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.5)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));</value>
       </setting>
     </UAS_MES_NEW.Properties.Settings>
   </applicationSettings>

+ 1 - 1
UAS_MES_JH/DataOperate/ExcelHandler.cs

@@ -57,7 +57,7 @@ namespace UAS_MES_NEW.DataOperate
         {
             DataTable dt = new DataTable();
             dt.TableName = TableName;
-            if (FolderPath.Contains(".xls") || FolderPath.Contains(".xlsx"))
+            if (FolderPath.Contains(".xls") || FolderPath.Contains(".xlsx") || FolderPath.Contains(".XLS") || FolderPath.Contains(".XLSX"))
             {
                 using (FileStream file = new FileStream(FolderPath, FileMode.Open, FileAccess.Read))
                 {

+ 28 - 4
UAS_MES_JH/FunctionCode/Make/Make_ColorBoxLabelPrint.cs

@@ -81,6 +81,13 @@ namespace UAS_MES_NEW.Make
             StepCount.LineCode = User.UserLineCode;
             StepCount.Dh = dh;
             StepCount.Start();
+
+            if (dh.getFieldDataByCondition("employee", "em_type", "em_code = '" + User.UserCode + "'").ToString() != "admin")
+            {
+                    sncode.Visible = false;
+
+            }
+
         }
 
         private void US_SKU_DbChange(object sender, EventArgs e)
@@ -259,14 +266,31 @@ namespace UAS_MES_NEW.Make
                                 if (ErrorMessage.Contains("AFTERSUCCESS"))
                                     OperateResult.AppendText(">>" + ErrorMessage + "\n");
                                 // doc = lbl.Documents.Open(PrintLabel.Text);
-                                if (Print.CodeSoft(Tag.ToString(), ref lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, sncode.Text, int.Parse(PrintNum.Text), oMakeCode, pr_code.Text, "彩盒标", "0", out ErrorMessage))
+                                if (dh.CheckExist("makeserial", "ms_sncode = '" + sncode.Text + "' and ms_makecode = '" + ma_code.Text + "' and ms_printcount>0"))
                                 {
-                                    //提示用户打印成功
-                                    OperateResult.AppendText(">>序列号:" + sncode.Text + "打印结束\n", Color.Green);
+                                    if (Print.CodeSoft(Tag.ToString(), ref lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, sncode.Text, int.Parse(PrintNum.Text), oMakeCode, pr_code.Text, "彩盒标", "0", out ErrorMessage))
+                                    {
+                                        //提示用户打印成功
+                                        OperateResult.AppendText(">>序列号:" + sncode.Text + "打印结束\n", Color.Green);
+                                        dh.ExecuteSql("update makeserial set ms_printcount = ms_printcount +1 where ms_sncode = '" + sncode.Text + "' and ms_makecode = '" + ma_code.Text + "' ", "update");
+                                    }
+                                    else
+                                    {
+                                        OperateResult.AppendText(ErrorMessage + "\n", Color.Red);
+                                    }
                                 }
                                 else
                                 {
-                                    OperateResult.AppendText(ErrorMessage + "\n", Color.Red);
+                                    if (Print.CodeSoft(Tag.ToString(), ref lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, sncode.Text, int.Parse(PrintNum.Text), oMakeCode, pr_code.Text, "彩盒标", "-1", out ErrorMessage))
+                                    {
+                                        //提示用户打印成功
+                                        OperateResult.AppendText(">>序列号:" + sncode.Text + "打印结束\n", Color.Green);
+                                        dh.ExecuteSql("update makeserial set ms_printcount = ms_printcount +1 where ms_sncode = '" + sncode.Text + "' and ms_makecode = '" + ma_code.Text + "' ", "update");
+                                    }
+                                    else
+                                    {
+                                        OperateResult.AppendText(ErrorMessage + "\n", Color.Red);
+                                    }
                                 }
                                 string skureset = dh.GetConfig("skureset", "sys").ToString();
                                 if (US_SKU.Text != ""&& skureset =="1")

+ 0 - 17
UAS_MES_JH/FunctionCode/Make/Make_TestCollection.Designer.cs

@@ -72,7 +72,6 @@
             this.pr_detail_label = new System.Windows.Forms.Label();
             this.ma_softversion_label = new System.Windows.Forms.Label();
             this.BadInfSource = new System.Windows.Forms.BindingSource(this.components);
-            this.NoteForChange = new System.Windows.Forms.CheckBox();
             this.ControlLockTimer = new System.Windows.Forms.Timer(this.components);
             this.Lock_label = new System.Windows.Forms.Label();
             this.ma_salecode = new System.Windows.Forms.Label();
@@ -540,20 +539,6 @@
             this.ma_softversion_label.TabIndex = 72;
             this.ma_softversion_label.Text = "软件版本";
             // 
-            // NoteForChange
-            // 
-            this.NoteForChange.AutoSize = true;
-            this.NoteForChange.Checked = true;
-            this.NoteForChange.CheckState = System.Windows.Forms.CheckState.Checked;
-            this.NoteForChange.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.NoteForChange.Location = new System.Drawing.Point(290, 112);
-            this.NoteForChange.Margin = new System.Windows.Forms.Padding(2);
-            this.NoteForChange.Name = "NoteForChange";
-            this.NoteForChange.Size = new System.Drawing.Size(99, 21);
-            this.NoteForChange.TabIndex = 75;
-            this.NoteForChange.Text = "切换工单提示";
-            this.NoteForChange.UseVisualStyleBackColor = true;
-            // 
             // Lock_label
             // 
             this.Lock_label.AutoSize = true;
@@ -891,7 +876,6 @@
             this.Controls.Add(this.ma_salecode);
             this.Controls.Add(this.Lock_label);
             this.Controls.Add(this.Filter);
-            this.Controls.Add(this.NoteForChange);
             this.Controls.Add(this.ma_softversion);
             this.Controls.Add(this.ma_softversion_label);
             this.Controls.Add(this.panel1);
@@ -1002,7 +986,6 @@
         private System.Windows.Forms.ColumnHeader columnHeader9;
         private System.Windows.Forms.ColumnHeader columnHeader10;
         private System.Windows.Forms.BindingSource BadInfSource;
-        private System.Windows.Forms.CheckBox NoteForChange;
         private CustomControl.TextBoxWithIcon.TextBoxWithPlaceHolder Filter;
         private System.Windows.Forms.Timer ControlLockTimer;
         private System.Windows.Forms.Label Lock_label;

+ 12 - 12
UAS_MES_JH/FunctionCode/Make/Make_TestCollection.cs

@@ -185,20 +185,20 @@ namespace UAS_MES_NEW.Make
                 ChoosedList.Clear();
                 if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out ErrorMessage))
                 {
-                    bool NoteAlready = LogicHandler.CheckDiffMakeCodeBeforeStepCheck(ms_sncode.Text, ma_code.Text, NoteForChange.Checked, out oMakeCode, out ErrorMessage);
-                    if (!NoteAlready)
-                    {
-                        OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, ms_sncode);
-                        return;
-                    }
-                    if (LogicHandler.CheckStepSNAndMacode(oMakeCode, User.UserSourceCode, ms_sncode.Text, User.UserCode, out oMakeCode, out oMSID, out ErrorMessage))
+                    //bool NoteAlready = LogicHandler.CheckDiffMakeCodeBeforeStepCheck(ms_sncode.Text, ma_code.Text, NoteForChange.Checked, out oMakeCode, out ErrorMessage);
+                    //if (!NoteAlready)
+                    //{
+                    //    OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, ms_sncode);
+                    //    return;
+                    //}
+                    if (LogicHandler.CheckStepSNAndMacode(ma_code.Text, User.UserSourceCode, ms_sncode.Text, User.UserCode, out oMakeCode, out oMSID, out ErrorMessage))
                     {
                         //是否提示过工单切换框,检测前后执行
-                        if (!LogicHandler.CheckDiffMakeCodeAfterStepCheck(ms_sncode.Text, oMakeCode, NoteForChange.Checked, NoteAlready, ma_code, out ErrorMessage))
-                        {
-                            OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, ms_sncode);
-                            return;
-                        }
+                        //if (!LogicHandler.CheckDiffMakeCodeAfterStepCheck(ms_sncode.Text, oMakeCode, NoteForChange.Checked, NoteAlready, ma_code, out ErrorMessage))
+                        //{
+                        //    OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, ms_sncode);
+                        //    return;
+                        //}
                         if (ma_code.Text != oMakeCode && oMakeCode != null)
                         {
                             dt = (DataTable)dh.ExecuteSql("select ma_code,ma_prodcode,ma_softversion,ma_salecode,pr_spec,nvl(pr_sendchecktype,'LineCode')pr_sendchecktype,ma_qty from make left join product on ma_prodcode=pr_code where ma_code='" + oMakeCode + "'", "select");

+ 69 - 69
UAS_MES_JH/FunctionCode/Query/Query_ExeProgress.Designer.cs

@@ -39,6 +39,14 @@
             this.ms_checkno = new System.Windows.Forms.TextBox();
             this.label7 = new System.Windows.Forms.Label();
             this.CraftmaterialData = new UAS_MES_NEW.CustomControl.DataGrid_View.DataGridViewWithSerialNum();
+            this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.dataGridViewTextBoxColumn3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.dataGridViewTextBoxColumn4 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.dataGridViewTextBoxColumn5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.dataGridViewTextBoxColumn6 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.dataGridViewTextBoxColumn7 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.dataGridViewTextBoxColumn8 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.CraftInfDgv = new UAS_MES_NEW.CustomControl.DataGrid_View.DataGridViewWithSerialNum();
             this.mp_sncode = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.mp_makecode = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -64,14 +72,6 @@
             this.ma_colorcode = new System.Windows.Forms.TextBox();
             this.barcode = new System.Windows.Forms.TextBox();
             this.label9 = new System.Windows.Forms.Label();
-            this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.dataGridViewTextBoxColumn3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.dataGridViewTextBoxColumn4 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.dataGridViewTextBoxColumn5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.dataGridViewTextBoxColumn6 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.dataGridViewTextBoxColumn7 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.dataGridViewTextBoxColumn8 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             ((System.ComponentModel.ISupportInitialize)(this.CraftmaterialData)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.CraftInfDgv)).BeginInit();
             this.groupBoxWithBorder1.SuspendLayout();
@@ -100,7 +100,7 @@
             this.SerialPanel.Location = new System.Drawing.Point(14, 106);
             this.SerialPanel.Margin = new System.Windows.Forms.Padding(2);
             this.SerialPanel.Name = "SerialPanel";
-            this.SerialPanel.Size = new System.Drawing.Size(947, 179);
+            this.SerialPanel.Size = new System.Drawing.Size(1013, 179);
             this.SerialPanel.TabIndex = 194;
             this.SerialPanel.Scroll += new System.Windows.Forms.ScrollEventHandler(this.SerialPanel_Scroll);
             this.SerialPanel.Paint += new System.Windows.Forms.PaintEventHandler(this.SerialPanel_Paint);
@@ -196,9 +196,65 @@
             this.CraftmaterialData.Margin = new System.Windows.Forms.Padding(2);
             this.CraftmaterialData.Name = "CraftmaterialData";
             this.CraftmaterialData.RowTemplate.Height = 27;
-            this.CraftmaterialData.Size = new System.Drawing.Size(948, 160);
+            this.CraftmaterialData.Size = new System.Drawing.Size(1014, 160);
             this.CraftmaterialData.TabIndex = 201;
             // 
+            // dataGridViewTextBoxColumn1
+            // 
+            this.dataGridViewTextBoxColumn1.DataPropertyName = "cm_makecode";
+            this.dataGridViewTextBoxColumn1.HeaderText = "工单号";
+            this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1";
+            this.dataGridViewTextBoxColumn1.Width = 120;
+            // 
+            // dataGridViewTextBoxColumn2
+            // 
+            this.dataGridViewTextBoxColumn2.DataPropertyName = "cm_soncode";
+            this.dataGridViewTextBoxColumn2.HeaderText = "子件编号";
+            this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2";
+            this.dataGridViewTextBoxColumn2.Width = 120;
+            // 
+            // dataGridViewTextBoxColumn3
+            // 
+            this.dataGridViewTextBoxColumn3.DataPropertyName = "pr_detail";
+            this.dataGridViewTextBoxColumn3.HeaderText = "子件名称";
+            this.dataGridViewTextBoxColumn3.Name = "dataGridViewTextBoxColumn3";
+            this.dataGridViewTextBoxColumn3.Width = 120;
+            // 
+            // dataGridViewTextBoxColumn4
+            // 
+            this.dataGridViewTextBoxColumn4.DataPropertyName = "cm_barcode";
+            this.dataGridViewTextBoxColumn4.HeaderText = "子件批次号";
+            this.dataGridViewTextBoxColumn4.Name = "dataGridViewTextBoxColumn4";
+            this.dataGridViewTextBoxColumn4.Width = 120;
+            // 
+            // dataGridViewTextBoxColumn5
+            // 
+            this.dataGridViewTextBoxColumn5.DataPropertyName = "cm_stepcode";
+            this.dataGridViewTextBoxColumn5.HeaderText = "工序编号";
+            this.dataGridViewTextBoxColumn5.Name = "dataGridViewTextBoxColumn5";
+            this.dataGridViewTextBoxColumn5.Width = 130;
+            // 
+            // dataGridViewTextBoxColumn6
+            // 
+            this.dataGridViewTextBoxColumn6.DataPropertyName = "cm_stepname";
+            this.dataGridViewTextBoxColumn6.HeaderText = "工序名称";
+            this.dataGridViewTextBoxColumn6.Name = "dataGridViewTextBoxColumn6";
+            this.dataGridViewTextBoxColumn6.Width = 120;
+            // 
+            // dataGridViewTextBoxColumn7
+            // 
+            this.dataGridViewTextBoxColumn7.DataPropertyName = "cm_status";
+            this.dataGridViewTextBoxColumn7.HeaderText = "上料状态";
+            this.dataGridViewTextBoxColumn7.Name = "dataGridViewTextBoxColumn7";
+            this.dataGridViewTextBoxColumn7.Width = 120;
+            // 
+            // dataGridViewTextBoxColumn8
+            // 
+            this.dataGridViewTextBoxColumn8.DataPropertyName = "cm_indate";
+            this.dataGridViewTextBoxColumn8.HeaderText = "上料时间";
+            this.dataGridViewTextBoxColumn8.Name = "dataGridViewTextBoxColumn8";
+            this.dataGridViewTextBoxColumn8.Width = 120;
+            // 
             // CraftInfDgv
             // 
             this.CraftInfDgv.AllowUserToAddRows = false;
@@ -220,7 +276,7 @@
             this.CraftInfDgv.Margin = new System.Windows.Forms.Padding(2);
             this.CraftInfDgv.Name = "CraftInfDgv";
             this.CraftInfDgv.RowTemplate.Height = 27;
-            this.CraftInfDgv.Size = new System.Drawing.Size(957, 162);
+            this.CraftInfDgv.Size = new System.Drawing.Size(1023, 162);
             this.CraftInfDgv.TabIndex = 193;
             // 
             // mp_sncode
@@ -309,7 +365,7 @@
             this.groupBoxWithBorder1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.groupBoxWithBorder1.Name = "groupBoxWithBorder1";
             this.groupBoxWithBorder1.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2);
-            this.groupBoxWithBorder1.Size = new System.Drawing.Size(950, 40);
+            this.groupBoxWithBorder1.Size = new System.Drawing.Size(1016, 40);
             this.groupBoxWithBorder1.TabIndex = 192;
             this.groupBoxWithBorder1.TabStop = false;
             this.groupBoxWithBorder1.Text = "颜色说明";
@@ -449,67 +505,11 @@
             this.label9.TabIndex = 206;
             this.label9.Text = "部件号";
             // 
-            // dataGridViewTextBoxColumn1
-            // 
-            this.dataGridViewTextBoxColumn1.DataPropertyName = "cm_makecode";
-            this.dataGridViewTextBoxColumn1.HeaderText = "工单号";
-            this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1";
-            this.dataGridViewTextBoxColumn1.Width = 120;
-            // 
-            // dataGridViewTextBoxColumn2
-            // 
-            this.dataGridViewTextBoxColumn2.DataPropertyName = "cm_soncode";
-            this.dataGridViewTextBoxColumn2.HeaderText = "子件编号";
-            this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2";
-            this.dataGridViewTextBoxColumn2.Width = 120;
-            // 
-            // dataGridViewTextBoxColumn3
-            // 
-            this.dataGridViewTextBoxColumn3.DataPropertyName = "pr_detail";
-            this.dataGridViewTextBoxColumn3.HeaderText = "子件名称";
-            this.dataGridViewTextBoxColumn3.Name = "dataGridViewTextBoxColumn3";
-            this.dataGridViewTextBoxColumn3.Width = 120;
-            // 
-            // dataGridViewTextBoxColumn4
-            // 
-            this.dataGridViewTextBoxColumn4.DataPropertyName = "cm_barcode";
-            this.dataGridViewTextBoxColumn4.HeaderText = "子件批次号";
-            this.dataGridViewTextBoxColumn4.Name = "dataGridViewTextBoxColumn4";
-            this.dataGridViewTextBoxColumn4.Width = 120;
-            // 
-            // dataGridViewTextBoxColumn5
-            // 
-            this.dataGridViewTextBoxColumn5.DataPropertyName = "cm_stepcode";
-            this.dataGridViewTextBoxColumn5.HeaderText = "工序编号";
-            this.dataGridViewTextBoxColumn5.Name = "dataGridViewTextBoxColumn5";
-            this.dataGridViewTextBoxColumn5.Width = 130;
-            // 
-            // dataGridViewTextBoxColumn6
-            // 
-            this.dataGridViewTextBoxColumn6.DataPropertyName = "cm_stepname";
-            this.dataGridViewTextBoxColumn6.HeaderText = "工序名称";
-            this.dataGridViewTextBoxColumn6.Name = "dataGridViewTextBoxColumn6";
-            this.dataGridViewTextBoxColumn6.Width = 120;
-            // 
-            // dataGridViewTextBoxColumn7
-            // 
-            this.dataGridViewTextBoxColumn7.DataPropertyName = "cm_status";
-            this.dataGridViewTextBoxColumn7.HeaderText = "上料状态";
-            this.dataGridViewTextBoxColumn7.Name = "dataGridViewTextBoxColumn7";
-            this.dataGridViewTextBoxColumn7.Width = 120;
-            // 
-            // dataGridViewTextBoxColumn8
-            // 
-            this.dataGridViewTextBoxColumn8.DataPropertyName = "cm_indate";
-            this.dataGridViewTextBoxColumn8.HeaderText = "上料时间";
-            this.dataGridViewTextBoxColumn8.Name = "dataGridViewTextBoxColumn8";
-            this.dataGridViewTextBoxColumn8.Width = 120;
-            // 
             // Query_ExeProgress
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(972, 621);
+            this.ClientSize = new System.Drawing.Size(1038, 621);
             this.Controls.Add(this.barcode);
             this.Controls.Add(this.label9);
             this.Controls.Add(this.ma_colorcode);

+ 2 - 1
UAS_MES_JH/FunctionCode/Special/Special_Reset.cs

@@ -51,8 +51,9 @@ namespace UAS_MES_NEW.Special
         private void ReSN(string sncode, string stepcode)
         {
             string stname = dh.getFieldDataByCondition("step", "st_name", "st_code = '" + stepcode +  "'").ToString();
-            dh.ExecuteSql("update makeserial set ms_status=1,ms_outboxcode='',ms_nextstepcode= '"+ stepcode + "' where ms_sncode='" + sncode + "'", "update");
+            dh.ExecuteSql("update makeserial set ms_status=1,ms_outboxcode='',ms_printcount = 0, ms_nextstepcode= '" + stepcode + "' where ms_sncode='" + sncode + "'", "update");
             dh.ExecuteSql("delete makebad where mb_sncode = '" + sncode + "' and mb_status = 0", "delete");
+            //dh.ExecuteSql("delete labelprintlog where lpl_value = '" + sncode + "' ", "delete");
             sql.Clear();
             sql.Append("update craftmaterial set cm_status=-1,cm_lastdeco=-1,cm_dropman='" + User.UserCode + "',");
             sql.Append("cm_dropdate =sysdate,CM_REMARK = '重置站点拆解',cm_dropstep='" + User.CurrentStepCode + "',");

+ 38 - 2
UAS_MES_JH/FunctionCode/Special/Special_SmtLocation.cs

@@ -61,17 +61,53 @@ namespace UAS_MES_NEW.Special
             {
                 BaseUtil.FillDgvWithDataTable(LabelDataGridView, dt);
 
+                int number = 0;
+
+                List<string> snlist = new List<string>();
+                List<string> imei1list = new List<string>();
+                List<string> imei2list = new List<string>();
+                List<string> btlist = new List<string>();
+                List<string> wifilist = new List<string>();
+
                 for (int i = 0; i < dt.Rows.Count; i++)
                 {
-                    dh.ExecuteSql("MERGE INTO SNIMEI a USING ( SELECT '" + dt.Rows[i]["SN"].ToString() + "' as SN FROM dual ) b ON (a.SN = b.SN) WHEN MATCHED THEN UPDATE SET a.IMEI1 = '" + dt.Rows[i]["IMEI1"].ToString() + "', a.IMEI2 = '" + dt.Rows[i]["IMEI2"].ToString() + "',a.BT = '" + dt.Rows[i]["BT"].ToString() + "', a.WIFI = '" + dt.Rows[i]["WIFI"].ToString() + "' WHEN NOT MATCHED THEN INSERT (a.SN, a.IMEI1, a.IMEI2,a.BT, a.WIFI) VALUES ('" + dt.Rows[i]["SN"].ToString() + "', '" + dt.Rows[i]["IMEI1"].ToString() + "', '" + dt.Rows[i]["IMEI2"].ToString() + "','" + dt.Rows[i]["BT"].ToString() + "','" + dt.Rows[i]["WIFI"].ToString() + "')", "insert");
+
+                    if ( dt.Rows[i]["SN"].ToString().Trim().Length > 2 && dt.Rows[i]["IMEI1"].ToString().Trim().Length > 2 )
+                    {
+                        snlist.Add(dt.Rows[i]["SN"].ToString().Trim());
+                        imei1list.Add(dt.Rows[i]["IMEI1"].ToString().Trim());
+                        imei2list.Add(dt.Rows[i]["IMEI2"].ToString().Trim());
+                        btlist.Add(dt.Rows[i]["BT"].ToString().Trim());
+                        wifilist.Add(dt.Rows[i]["WIFI"].ToString().Trim());                
+                        number++;
+                    }
+                  
+
+                   
+                    // dh.ExecuteSql("MERGE INTO SNIMEI a USING ( SELECT '" + dt.Rows[i]["SN"].ToString() + "' as SN FROM dual ) b ON (a.SN = b.SN) WHEN MATCHED THEN UPDATE SET a.IMEI1 = '" + dt.Rows[i]["IMEI1"].ToString() + "', a.IMEI2 = '" + dt.Rows[i]["IMEI2"].ToString() + "',a.BT = '" + dt.Rows[i]["BT"].ToString() + "', a.WIFI = '" + dt.Rows[i]["WIFI"].ToString() + "' WHEN NOT MATCHED THEN INSERT (a.SN, a.IMEI1, a.IMEI2,a.BT, a.WIFI) VALUES ('" + dt.Rows[i]["SN"].ToString() + "', '" + dt.Rows[i]["IMEI1"].ToString() + "', '" + dt.Rows[i]["IMEI2"].ToString() + "','" + dt.Rows[i]["BT"].ToString() + "','" + dt.Rows[i]["WIFI"].ToString() + "')", "insert");
                 }
+
+                sql.Clear();
+                sql.Append("insert into SNIMEI_TEMP(ST_SN,ST_IMEI1,ST_IMEI2,ST_BT,ST_WIFI)");
+                sql.Append("values(:sn,:imei1,:imei2,:bt,:wifi)");
+
+                dh.BatchInsert(sql.GetString(), new string[] { "sn", "imei1", "imei2", "bt", "wifi" }, snlist.ToArray(), imei1list.ToArray(), imei2list.ToArray(), btlist.ToArray(), wifilist.ToArray());
+
+
+                sql.Clear();
+                sql.Append("merge  into SNIMEI using SNIMEI_TEMP  on (ST_SN = SN) when  MATCHED then UPDATE set IMEI1 = ST_IMEI1,IMEI2=ST_IMEI2,BT=ST_BT,WIFI=ST_WIFI,SDATE = SYSDATE when not MATCHED then insert  (SN, IMEI1, IMEI2,BT, WIFI,SDATE)");
+                sql.Append(" values (ST_SN,ST_IMEI1,ST_IMEI2,ST_BT,ST_WIFI,SYSDATE)");
+                dh.ExecuteSql(sql.GetString(), "insert");
+
+                dh.ExecuteSql("delete SNIMEI_TEMP", "delete");
+                MessageBox.Show("导入成功!记录:" + dt.Rows.Count + "行");
             }
             catch (Exception ex)
             {
                 MessageBox.Show(ex.Message);
             }
 
-            MessageBox.Show("导入成功!记录:" + dt.Rows.Count+"行");
+          
         }
 
         private void normalButton3_Click(object sender, EventArgs e)

+ 2 - 2
UAS_MES_JH/Login.cs

@@ -88,8 +88,8 @@ namespace UAS_MES_NEW
             //设置选中数据库的链接
             string DBUser = DB.SelectedValue.ToString().Split('#')[0];
             string Address = DB.SelectedValue.ToString().Split('#')[1];
-            //DataHelper.DBConnectionString = "Password=select!#%*(;User ID=" + DBUser + ";Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST="+ Address + ")(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
-            DataHelper.DBConnectionString = "Password=select!#%*(;User ID=" + DBUser + ";Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=joyhong.tpddns.cn)(PORT=1522)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+            DataHelper.DBConnectionString = "Password=select!#%*(;User ID=" + DBUser + ";Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST="+ Address + ")(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+            //DataHelper.DBConnectionString = "Password=select!#%*(;User ID=" + DBUser + ";Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=joyhong.tpddns.cn)(PORT=1522)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
             SystemInf.CurrentDB = DBUser;
             //设置屏幕的宽高信息
             SystemInf.ScreenWidth = Screen.PrimaryScreen.WorkingArea.Width;

+ 2 - 2
UAS_MES_JH/Properties/Settings.Designer.cs

@@ -122,8 +122,8 @@ namespace UAS_MES_NEW.Properties {
         [global::System.Configuration.ApplicationScopedSettingAttribute()]
         [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
         [global::System.Configuration.DefaultSettingValueAttribute("Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=MES;Pooling=false" +
-            ";Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=joyhong.tpd" +
-            "dns.cn)(PORT=1522)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));")]
+            ";Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.5" +
+            ")(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));")]
         public string MES {
             get {
                 return ((string)(this["MES"]));

+ 1 - 1
UAS_MES_JH/Properties/Settings.settings

@@ -27,7 +27,7 @@
       <Value Profile="(Default)">\\172.16.66.51\lable</Value>
     </Setting>
     <Setting Name="MES" Type="System.String" Scope="Application">
-      <Value Profile="(Default)">Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=joyhong.tpddns.cn)(PORT=1522)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));</Value>
+      <Value Profile="(Default)">Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.5)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));</Value>
     </Setting>
   </Settings>
 </SettingsFile>

+ 9 - 0
UAS_MES_JH/PublicMethod/LogicHandler.cs

@@ -1126,6 +1126,15 @@ namespace UAS_MES_NEW.PublicMethod
                             return false;
                         }
                     }
+                    if (iSN.StartsWith("http"))
+                    {
+                        dt = (DataTable)dh.ExecuteSql("select 1 from dual where  REGEXP_LIKE (substr('"+ iSN + "', length('"+ iSN + "') - 9) ,'[^a-zA-Z0-9]') and '"+ iSN + "' like '%http%'", "select");
+                        if (dt.Rows.Count > 0)
+                        {
+                            ErrMessage = "条码" + iSN + "后10位非数字英文";
+                            return false;
+                        }
+                    }
                     int sp_length = int.Parse(iLength != "" ? iLength : "0");
                     //若有多个,以|分割
                     string[] pres = iPrefix.Split('|');

+ 1 - 1
UAS_MES_JH/PublicMethod/Print.cs

@@ -124,7 +124,7 @@ namespace UAS_MES_NEW.PublicMethod
                 if (dh.getFieldDataByCondition("employee", "em_type", "em_code = '" + User.UserCode + "'").ToString() != "admin")
                 {
                     //如果已经打印过了,则不允许再打印
-                    if (dt.Rows.Count > 0&&LabelType != "彩盒标")
+                    if (dt.Rows.Count > 0)
                     {
                         ErrorMessage = SnCode + LabelType + "已打印";
                         return false;

+ 1 - 1
UAS_MES_LT/App.config

@@ -72,7 +72,7 @@
   <applicationSettings>
     <UAS_MES_NEW.Properties.Settings>
       <setting name="MES" serializeAs="String">
-        <value>Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=LIANT;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.11.201)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));</value>
+        <value>Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=LIANT;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.83.235)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));</value>
       </setting>
     </UAS_MES_NEW.Properties.Settings>
   </applicationSettings>

+ 4 - 4
UAS_MES_LT/CustomControl/RichText/RichTextAutoBottom.cs

@@ -36,7 +36,7 @@ namespace UAS_MES_NEW.CustomControl.RichText
             //如果颜色是红色则进行提示音
             if (color == Color.Red && Entity.SystemInf.CheckAudioEnable)
             {
-                FileName = Application.StartupPath + @"\Resources\Sound\5185.wav";
+                FileName = Application.StartupPath + @"\Resources\Sound\FAIL.wav";
                 thread.Start();
                 thread = new Thread(PlaySound);
 
@@ -44,7 +44,7 @@ namespace UAS_MES_NEW.CustomControl.RichText
             else if (color == Color.Green && Entity.SystemInf.CheckAudioEnable)
             {
                 //颜色是绿色,进行正确提示音
-                FileName = Application.StartupPath + @"\Resources\Sound\8378.wav";
+                FileName = Application.StartupPath + @"\Resources\Sound\PASS.wav";
                 thread.Start();
                 thread = new Thread(PlaySound);
             }
@@ -72,14 +72,14 @@ namespace UAS_MES_NEW.CustomControl.RichText
             //如果颜色是红色则进行提示音
             if (color == Color.Red && Entity.SystemInf.CheckAudioEnable)
             {
-                FileName = Application.StartupPath + @"\Resources\Sound\5185.wav";
+                FileName = Application.StartupPath + @"\Resources\Sound\FAIL.wav";
                 thread.Start();
                 thread = new Thread(PlaySound);
             }
             else if (color == Color.Green && Entity.SystemInf.CheckAudioEnable)
             {
                 //颜色是绿色,进行正确提示音
-                FileName = Application.StartupPath + @"\Resources\Sound\8378.wav";
+                FileName = Application.StartupPath + @"\Resources\Sound\PASS.wav";
                 thread.Start();
                 thread = new Thread(PlaySound);
             }

+ 9 - 6
UAS_MES_LT/FunctionCode/Make/Make_ColorBoxLabelPrint.cs

@@ -10,7 +10,7 @@ using LabelManager2;
 using System.Threading;
 using UAS_MES_NEW.PublicForm;
 using System.Web.UI.WebControls;
-using Seagull.BarTender.Print;
+//using Seagull.BarTender.Print;
 
 namespace UAS_MES_NEW.Make
 {
@@ -35,7 +35,7 @@ namespace UAS_MES_NEW.Make
         Thread InitPrint;
         ApplicationClass lbl;
 
-        Engine engine;
+        BarTender.Application engine;
 
         DataTable Dbfind;
 
@@ -91,11 +91,11 @@ namespace UAS_MES_NEW.Make
         {
             try
             {
-                engine = new Engine(true);
+                engine = new BarTender.Application();
             }
-            catch (Exception)
+            catch (Exception ex)
             {
-                OperateResult.AppendText("未正确安装CodeSoft软件\n", Color.Red);
+                OperateResult.AppendText(ex.Message+"未正确安装CodeSoft软件\n", Color.Red);
             }
         }
 
@@ -231,7 +231,7 @@ namespace UAS_MES_NEW.Make
 
                                     for (int i = 0; i < _dt.Rows.Count; i++)
                                     {
-                                        if (Print.BarTender(Tag.ToString(), ref engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, sncode.Text, int.Parse(PrintNum.Text), oMakeCode, pr_code.Text, "彩盒标", "0", out ErrorMessage))
+                                        if (Print.SinglePrint(Tag.ToString(),  engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, sncode.Text, int.Parse(PrintNum.Text), oMakeCode, pr_code.Text, "彩盒标", "0", out ErrorMessage))
                                         {
                                             //提示用户打印成功
                                             OperateResult.AppendText(">>序列号:" + sncode.Text + "打印结束\n", Color.Green);
@@ -318,6 +318,9 @@ namespace UAS_MES_NEW.Make
         private void Make_ColorBoxLabelPrint_FormClosing(object sender, FormClosingEventArgs e)
         {
             BaseUtil.ClosePrint(lbl);
+            if (engine != null)
+                engine.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges);
+            dh.Dispose();
         }
 
         private void Make_ColorBoxLabelPrint_SizeChanged(object sender, EventArgs e)

+ 4 - 4
UAS_MES_LT/FunctionCode/Make/Make_ColorBoxLoadPrint.cs

@@ -12,13 +12,13 @@ using System.Collections.Generic;
 using UAS_MES_NEW.PublicForm;
 using LabelManager2;
 using System.Threading;
-using Seagull.BarTender.Print;
+//using Seagull.BarTender.Print;
 
 namespace UAS_MES_NEW.Make
 {
     public partial class Make_ColorBoxLoadPrint : Form
     {
-        Engine engine;
+        BarTender.Application engine;
         //MakeSerial表主键
         string ms_id;
         //制造单号                                                                             
@@ -74,7 +74,7 @@ namespace UAS_MES_NEW.Make
         {
             try
             {
-                engine = new Engine(true);
+                engine = new BarTender.Application();
                 BaseUtil.WriteLbl();
             }
             catch (Exception)
@@ -508,7 +508,7 @@ namespace UAS_MES_NEW.Make
                     //刷新数据
                     EventArgs e = new EventArgs();
                     object sender = null;
-                    if (!Print.BarTender(Tag.ToString(), ref engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, ms_sncode, int.Parse(PrintNum.Text), ma_code, ma_prodcode.Text, "SN标签", "0", out ErrorMessage))
+                    if (!Print.SinglePrint(Tag.ToString(),  engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, ms_sncode, int.Parse(PrintNum.Text), ma_code, ma_prodcode.Text, "SN标签", "0", out ErrorMessage))
                     {
                         OperateResult.AppendText(ErrorMessage + "\n", Color.Red);
                     }

+ 27 - 24
UAS_MES_LT/FunctionCode/Make/Make_ColorBoxWeigh.Designer.cs

@@ -35,7 +35,7 @@
             this.pr_colorboxunit = new System.Windows.Forms.Label();
             this.weight_label = new System.Windows.Forms.Label();
             this.panel4 = new UAS_MES_NEW.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
-            this.weight = new System.Windows.Forms.TextBox();
+            this.weight = new System.Windows.Forms.Label();
             this.label15 = new System.Windows.Forms.Label();
             this.pr_detail_label = new System.Windows.Forms.Label();
             this.ma_qty_label = new System.Windows.Forms.Label();
@@ -56,7 +56,6 @@
             this.mcd_remainqty_label = new System.Windows.Forms.Label();
             this.CollectRemark = new System.Windows.Forms.CheckBox();
             this.locksalecode = new System.Windows.Forms.CheckBox();
-            this.Remark = new UAS_MES_NEW.CustomControl.RichText.RichTextAutoBottom();
             this.mcd_remainqty = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
             this.mcd_inqty = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
             this.StepCount = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SourceStepCount();
@@ -87,6 +86,7 @@
             this.OperateResult = new UAS_MES_NEW.CustomControl.RichText.RichTextAutoBottom();
             this.LockMakeCode = new UAS_MES_NEW.CustomControl.CustomCheckBox.LockCheckBox();
             this.ma_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.MaCodeSearchTextBox();
+            this.Remark = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.panel4.SuspendLayout();
             this.groupBoxWithBorder2.SuspendLayout();
             this.SuspendLayout();
@@ -122,7 +122,6 @@
             this.pr_colorboxunit.Size = new System.Drawing.Size(50, 25);
             this.pr_colorboxunit.TabIndex = 42;
             this.pr_colorboxunit.Text = "千克";
-            this.pr_colorboxunit.Visible = false;
             // 
             // weight_label
             // 
@@ -135,7 +134,6 @@
             this.weight_label.Size = new System.Drawing.Size(50, 25);
             this.weight_label.TabIndex = 20;
             this.weight_label.Text = "重量";
-            this.weight_label.Visible = false;
             // 
             // panel4
             // 
@@ -156,13 +154,13 @@
             // 
             // weight
             // 
-            this.weight.Font = new System.Drawing.Font("微软雅黑", 40F);
-            this.weight.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));
-            this.weight.Location = new System.Drawing.Point(71, 34);
-            this.weight.Margin = new System.Windows.Forms.Padding(2);
+            this.weight.AutoSize = true;
+            this.weight.Font = new System.Drawing.Font("微软雅黑", 35F);
+            this.weight.ForeColor = System.Drawing.Color.DarkGreen;
+            this.weight.Location = new System.Drawing.Point(72, 24);
             this.weight.Name = "weight";
-            this.weight.Size = new System.Drawing.Size(211, 78);
-            this.weight.TabIndex = 43;
+            this.weight.Size = new System.Drawing.Size(0, 60);
+            this.weight.TabIndex = 181;
             // 
             // label15
             // 
@@ -339,7 +337,7 @@
             this.CollectRemark.Name = "CollectRemark";
             this.CollectRemark.Size = new System.Drawing.Size(84, 24);
             this.CollectRemark.TabIndex = 195;
-            this.CollectRemark.Text = "采集备注";
+            this.CollectRemark.Text = "数据核对";
             this.CollectRemark.UseVisualStyleBackColor = true;
             // 
             // locksalecode
@@ -354,16 +352,6 @@
             this.locksalecode.Text = "当前订单锁定";
             this.locksalecode.UseVisualStyleBackColor = true;
             // 
-            // Remark
-            // 
-            this.Remark.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.Remark.Location = new System.Drawing.Point(768, 202);
-            this.Remark.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
-            this.Remark.Name = "Remark";
-            this.Remark.Size = new System.Drawing.Size(240, 80);
-            this.Remark.TabIndex = 194;
-            this.Remark.Text = "";
-            // 
             // mcd_remainqty
             // 
             this.mcd_remainqty.AutoSize = true;
@@ -770,16 +758,31 @@
             this.ma_code.TableName = null;
             this.ma_code.TextBoxEnable = true;
             // 
+            // Remark
+            // 
+            this.Remark.AllPower = null;
+            this.Remark.BackColor = System.Drawing.Color.White;
+            this.Remark.ID = null;
+            this.Remark.Location = new System.Drawing.Point(774, 217);
+            this.Remark.Name = "Remark";
+            this.Remark.Power = null;
+            this.Remark.Size = new System.Drawing.Size(241, 21);
+            this.Remark.Str = null;
+            this.Remark.Str1 = null;
+            this.Remark.Str2 = null;
+            this.Remark.TabIndex = 207;
+            this.Remark.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Remark_KeyDown);
+            // 
             // Make_ColorBoxWeigh
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(1027, 594);
+            this.Controls.Add(this.Remark);
             this.Controls.Add(this.LockMakeCode);
             this.Controls.Add(this.ma_code);
             this.Controls.Add(this.locksalecode);
             this.Controls.Add(this.CollectRemark);
-            this.Controls.Add(this.Remark);
             this.Controls.Add(this.mcd_remainqty);
             this.Controls.Add(this.mcd_remainqty_label);
             this.Controls.Add(this.mcd_inqty);
@@ -886,12 +889,12 @@
         private System.Windows.Forms.Label mcd_inqty_label;
         private CustomControl.ValueLabel.ValueLabel mcd_remainqty;
         private System.Windows.Forms.Label mcd_remainqty_label;
-        private CustomControl.RichText.RichTextAutoBottom Remark;
         private System.Windows.Forms.CheckBox CollectRemark;
         private System.Windows.Forms.CheckBox locksalecode;
         public System.Windows.Forms.Label ob_checkno;
         private CustomControl.CustomCheckBox.LockCheckBox LockMakeCode;
         private CustomControl.TextBoxWithIcon.MaCodeSearchTextBox ma_code;
-        private System.Windows.Forms.TextBox weight;
+        private System.Windows.Forms.Label weight;
+        private CustomControl.TextBoxWithIcon.EnterTextBox Remark;
     }
 }

+ 38 - 16
UAS_MES_LT/FunctionCode/Make/Make_ColorBoxWeigh.cs

@@ -14,7 +14,7 @@ using UAS_MES_NEW.PublicForm;
 using System.Net.Sockets;
 using System.Collections.Generic;
 using System.Net;
-using Seagull.BarTender.Print;
+//using Seagull.BarTender.Print;
 
 namespace UAS_MES_NEW.Make
 {
@@ -29,7 +29,7 @@ namespace UAS_MES_NEW.Make
         Thread thread;
         SerialPort serialPort1 = new SerialPort();
         //称量的标准重量
-        Double Weight;
+        Double Weight1;
         //最大重量
         Double MaxWeight;
         //最小重量
@@ -45,7 +45,7 @@ namespace UAS_MES_NEW.Make
         string ErrorMessage;
 
         Thread InitPrint;
-        Engine engine;
+        BarTender.Application engine;
 
         private bool AutoCut;
 
@@ -104,7 +104,7 @@ namespace UAS_MES_NEW.Make
         {
             try
             {
-                engine = new Engine();
+                engine = new BarTender.Application();
                 //lbl = new ApplicationClass();
                 //BaseUtil.WriteLbl();
             }
@@ -147,7 +147,7 @@ namespace UAS_MES_NEW.Make
                             string ma_salecode_text = dt.Rows[0]["ma_salecode"].ToString();
                             string PR_CHECKCOLORBOXW = dt.Rows[0]["PR_CHECKCOLORBOXW"].ToString();
                             //赋值重量单位
-                            Weight = double.Parse(_weight == "" ? "0" : _weight);
+                            Weight1 = double.Parse(_weight == "" ? "0" : _weight);
                             MaxWeight = double.Parse(_maxweight == "" ? "0" : _maxweight);
                             MinWeight = double.Parse(_minweight == "" ? "0" : _minweight);
                             if (locksalecode.Checked && ma_salecode.Text != "" && ma_salecode.Text != ma_salecode_text)
@@ -157,13 +157,22 @@ namespace UAS_MES_NEW.Make
                             }
                             ma_salecode.Text = dt.Rows[0]["ma_salecode"].ToString();
                             BaseUtil.SetFormValue(this.Controls, dt);
-                            if (Weight - MinWeight == MaxWeight - Weight)
-                                pr_colorboxgw.Text = Weight + "±" + (MaxWeight - Weight) + dt.Rows[0]["pr_colorboxunit"].ToString();
+                            if (Weight1 - MinWeight == MaxWeight - Weight1)
+                                pr_colorboxgw.Text = Weight1 + "±" + (MaxWeight - Weight1) + dt.Rows[0]["pr_colorboxunit"].ToString();
                             else
                                 pr_colorboxgw.Text = MinWeight + "-" + MaxWeight + dt.Rows[0]["pr_colorboxunit"].ToString();
 
                             //重量信息若需要检测则必须符合检测要求才更新
                             double ActualWeight = double.Parse(weight.Text == "" ? "0" : weight.Text.Replace("kg", "").Replace("g", "").Trim());
+
+                            if (CollectRemark.Checked && (Remark.Text == ""|| Remark.Text.Trim()!= sncode.Text))
+                            {
+                                OperateResult.AppendText(">>标签核对,SN与录入信息不一致\n", Color.Red);
+                                Remark.Focus();
+                                Remark.SelectAll();
+                                return;
+                            }
+
                             if (PR_CHECKCOLORBOXW != "0")
                             {
                                 if (MinWeight == 0 || MaxWeight == 0)
@@ -217,12 +226,13 @@ namespace UAS_MES_NEW.Make
                                 }
                             }
                             else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
-                            if (CollectRemark.Checked && Remark.Text != "")
-                            {
-                                LogicHandler.CollectRemarkInf(sncode.Text, "", "", oMakeCode, pr_code.Text, Remark.Text);
-                            }
                             LoadCollectedNum();
                             sncode.Clear();
+                            Remark.Clear();
+                            if (CollectRemark.Checked)
+                                Remark.Focus();
+                            else
+                                sncode.Focus();
                         }
                         else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, sncode);
                     }
@@ -282,7 +292,7 @@ namespace UAS_MES_NEW.Make
         //关闭窗口的时候停止进程读取串口数据
         private void 彩盒称重_FormClosing(object sender, FormClosingEventArgs e)
         {
-            BaseUtil.ClosePrint(engine);
+            BaseUtil.ClosePrint(lbl);
             StopWeight.PerformClick();
             InitPrint.Abort();
             if (serialPort1.IsOpen)
@@ -292,6 +302,9 @@ namespace UAS_MES_NEW.Make
                 SystemInf.OpenPort.Remove(serialPort1.PortName);
                 thread.Interrupt();
             }
+            if (engine != null)
+                engine.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges);
+            dh.Dispose();
             //thread.Abort();
         }
 
@@ -301,7 +314,7 @@ namespace UAS_MES_NEW.Make
             {
                 string oErrorMessage;
 
-                if (Print.BarTender(Tag.ToString(),ref engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrinterList.Text, sncode.Text, int.Parse(PrintNum.Text), ma_code.Text, pr_code.Text, "彩盒标", "0", out oErrorMessage))
+                if (Print.SinglePrint(Tag.ToString(), engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrinterList.Text, sncode.Text, int.Parse(PrintNum.Text), ma_code.Text, pr_code.Text, "彩盒标", "0", out oErrorMessage))
                 {
                     OperateResult.AppendText(">>打印彩盒" + sncode.Text + "\n", Color.Black);
                 }
@@ -547,11 +560,11 @@ namespace UAS_MES_NEW.Make
                 string _maxweight = dt.Rows[0]["pr_colorboxmaxw"].ToString();
                 string _minweight = dt.Rows[0]["pr_colorboxminw"].ToString();
                 //赋值重量单位
-                Weight = double.Parse(_weight == "" ? "0" : _weight);
+                Weight1 = double.Parse(_weight == "" ? "0" : _weight);
                 MaxWeight = double.Parse(_maxweight == "" ? "0" : _maxweight);
                 MinWeight = double.Parse(_minweight == "" ? "0" : _minweight);
-                if (Weight - MinWeight == MaxWeight - Weight)
-                    pr_colorboxgw.Text = Weight + "±" + (MaxWeight - Weight) + dt.Rows[0]["pr_colorboxunit"].ToString();
+                if (Weight1 - MinWeight == MaxWeight - Weight1)
+                    pr_colorboxgw.Text = Weight1 + "±" + (MaxWeight - Weight1) + dt.Rows[0]["pr_colorboxunit"].ToString();
                 else
                     pr_colorboxgw.Text = MinWeight + "-" + MaxWeight + dt.Rows[0]["pr_colorboxunit"].ToString();
             }
@@ -562,5 +575,14 @@ namespace UAS_MES_NEW.Make
             dt = (DataTable)dh.ExecuteSql("select mcd_inqty,ma_qty-mcd_inqty mcd_remainqty from make left join makecraftdetail_view on mcd_macode=ma_code where ma_code='" + ma_code.Text + "' and mcd_stepcode='" + User.CurrentStepCode + "'", "select");
             BaseUtil.SetFormValue(Controls, dt);
         }
+
+        private void Remark_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.KeyCode == Keys.Enter)
+            {
+                sncode.Focus();
+                sncode.SelectAll();
+            }
+        }
     }
 }

+ 3 - 3
UAS_MES_LT/FunctionCode/Make/Make_Decompose.Designer.cs

@@ -107,7 +107,7 @@
             // 
             this.pa_makecode_label.AutoSize = true;
             this.pa_makecode_label.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pa_makecode_label.Location = new System.Drawing.Point(33, 529);
+            this.pa_makecode_label.Location = new System.Drawing.Point(33, 517);
             this.pa_makecode_label.Name = "pa_makecode_label";
             this.pa_makecode_label.Size = new System.Drawing.Size(72, 27);
             this.pa_makecode_label.TabIndex = 173;
@@ -761,7 +761,7 @@
             this.Decompose.DownImage = ((System.Drawing.Image)(resources.GetObject("Decompose.DownImage")));
             this.Decompose.Image = ((System.Drawing.Image)(resources.GetObject("Decompose.Image")));
             this.Decompose.IsShowBorder = true;
-            this.Decompose.Location = new System.Drawing.Point(533, 533);
+            this.Decompose.Location = new System.Drawing.Point(533, 521);
             this.Decompose.MoveImage = ((System.Drawing.Image)(resources.GetObject("Decompose.MoveImage")));
             this.Decompose.Name = "Decompose";
             this.Decompose.NormalImage = ((System.Drawing.Image)(resources.GetObject("Decompose.NormalImage")));
@@ -777,7 +777,7 @@
             this.sn_code.AllPower = null;
             this.sn_code.BackColor = System.Drawing.Color.White;
             this.sn_code.ID = null;
-            this.sn_code.Location = new System.Drawing.Point(147, 535);
+            this.sn_code.Location = new System.Drawing.Point(147, 523);
             this.sn_code.Name = "sn_code";
             this.sn_code.Power = null;
             this.sn_code.Size = new System.Drawing.Size(196, 21);

+ 47 - 0
UAS_MES_LT/FunctionCode/Make/Make_Decompose.cs

@@ -37,6 +37,8 @@ namespace UAS_MES_NEW.Make
 
         int rowindex;
 
+        string replacestring = "";
+
         Make_NewBadCode_DE badcode;
 
         //记录当前输入框的值
@@ -279,6 +281,7 @@ namespace UAS_MES_NEW.Make
                                 string sp_ifrepeat = dtbar.Rows[0]["sp_ifrepeat"].ToString();
                                 string sp_barcoderule = dtbar.Rows[0]["sp_barcoderule"].ToString();
                                 string sp_checksalecode = dtbar.Rows[0]["sp_checksalecode"].ToString();
+                                string sp_ifuseregex = dtbar.Rows[0]["sp_ifuseregex"].ToString();
                                 if (sp_tracekind == "1")
                                 {
                                     //上料校验规则判断
@@ -288,6 +291,16 @@ namespace UAS_MES_NEW.Make
                                         LoadData(sncode_1, sender, new KeyEventArgs(Keys.Enter));
                                         continue;
                                     }
+                                    if (sp_ifuseregex == "-1")
+                                    {
+                                        dt = (DataTable)dh.ExecuteSql("select SR_REPLACE from SPREPLACE where INSTR('" + LabelDataGridView.Rows[i].Cells["New_BarCode"].Value.ToString() + "',SR_CONTAIN)>0 AND LENGTH('" + LabelDataGridView.Rows[i].Cells["New_BarCode"].Value.ToString() + "') = SR_LENGTH", "select");
+                                        if (dt.Rows.Count == 0)
+                                        {
+                                            OperateResult.AppendText(">>条码" + LabelDataGridView.Rows[i].Cells["New_BarCode"].Value.ToString() + "属于特殊物料,但是并未找到对应特殊物料规则\n", Color.Red);
+                                            continue;
+                                        }
+                                        replacestring = dt.Rows[0]["SR_REPLACE"].ToString();
+                                    }
                                     dh.UpdateByCondition("makeserial", "ms_nextmacode='" + LabelDataGridView.Rows[i].Cells["cm_makecode"].Value.ToString() + "'", "ms_id=(select max(ms_id) from makeserial where ms_sncode='" + LabelDataGridView.Rows[i].Cells["New_BarCode"].Value.ToString() + "')");
                                 }
                                 else if (sp_tracekind == "2")
@@ -399,6 +412,37 @@ namespace UAS_MES_NEW.Make
                             decompose = true;
                             LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_makecode.Text, User.UserLineCode, User.UserSourceCode, "物料" + LabelDataGridView.Rows[i].Cells["cm_barcode"].Value + "拆解换料", "拆解换料成功", ms_sncode.Text, "");
                             LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_makecode.Text, User.UserLineCode, User.UserSourceCode, "物料" + LabelDataGridView.Rows[i].Cells["New_BarCode"].Value + "拆解换料上料", "拆解换料上料成功", ms_sncode.Text, "");
+
+                            dt = (DataTable)dh.ExecuteSql("select pr_relocation from product where pr_code = '" + ms_prodcode.Text + "' and pr_ifreplace = -1", "select");
+                            if (dt.Rows.Count > 0 && replacestring != "")
+                            {
+                                string newsncode = ms_sncode.Text.Remove(int.Parse(dt.Rows[0]["pr_relocation"].ToString()) - 1, 1);
+                                newsncode = newsncode.Insert(int.Parse(dt.Rows[0]["pr_relocation"].ToString()) - 1, replacestring);
+                                if (newsncode != ms_sncode.Text)
+                                {
+                                    string ms_firstsn = dh.getFieldDataByCondition("makeserial", "ms_firstsn", "ms_sncode = '" + ms_sncode.Text + "' and ms_makecode  = '" + ms_makecode.Text + "'").ToString();
+                                    if (dh.CheckExist("MAKESNRELATION", "FIRSTSN = '" + ms_firstsn + "' AND MAKECODE = '" + ms_makecode.Text + "'"))
+                                    {
+                                        dh.ExecuteSql("update MAKESNRELATION set sn = '" + newsncode + "' where FIRSTSN = '" + ms_firstsn + "' AND MAKECODE = '" + ms_makecode.Text + "'", "update");
+                                    }
+                                    else
+                                    {
+                                        dh.ExecuteSql("insert into MAKESNRELATION(beforesn,sn,firstsn,makecode,msr_indate,msr_inman) values('" + ms_firstsn + "','" + newsncode + "','" + ms_firstsn + "','" + ms_makecode.Text + "',sysdate,'" + User.UserName + "')", "insert");
+                                    }
+                                    List<string> SQLS = new List<string>();
+                                    SQLS.Add("update makeserial set ms_sncode = '" + newsncode + "' where ms_sncode = '" + ms_sncode.Text + "' and ms_makecode = '" + ms_makecode.Text + "'");
+                                    SQLS.Add("update commandlog set cl_sncode = '"+newsncode+"' where cl_sncode = '"+ ms_sncode.Text + "' and cl_makecode = '"+ ms_makecode.Text + "'");
+                                    SQLS.Add("update makeprocess set mp_sncode = '" + newsncode + "' where mp_sncode = '" + ms_sncode.Text + "' and mp_makecode = '" + ms_makecode.Text + "'");
+                                    SQLS.Add("update makebad set mb_sncode = '" + newsncode + "' where mb_sncode = '" + ms_sncode.Text + "' and mb_makecode = '" + ms_makecode.Text + "'");
+                                    SQLS.Add("update MAKEBADREASON set mbr_sncode = '" + newsncode + "' where mbr_sncode = '" + ms_sncode.Text + "' and mbr_makecode = '" + ms_makecode.Text + "'");
+                                    dh.ExecuteSQLTran(SQLS.ToArray());
+                                    LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_makecode.Text, User.UserLineCode, User.UserSourceCode, "拆解处理特殊SN替换", "SN" + ms_sncode.Text + "更新为" + newsncode, newsncode, "");
+                                    OperateResult.AppendText("SN" + ms_sncode.Text + "更新为" + newsncode + "\n");
+                                   // sn_code.Text = newsncode;
+                                    ms_sncode.Text = newsncode;
+                                }
+                            }
+                            replacestring = "";
                         }
                         else if (nochange.Checked)
                         {
@@ -461,10 +505,13 @@ namespace UAS_MES_NEW.Make
                 sn_code.Focus();
                 count++;
                 deccount.Text = count + "";
+                replacestring = "";
+                sncode_1 = sn_code.Text;
                 LoadData(sncode_1, sender, new KeyEventArgs(Keys.Enter));
             }
             else
             {
+                replacestring = "";
                 OperateResult.AppendText("没有成功拆解项\n", Color.Red);
             }
         }

+ 1 - 0
UAS_MES_LT/FunctionCode/Make/Make_Decompose_Ex.Designer.cs

@@ -409,6 +409,7 @@
             this.nochange.TabStop = true;
             this.nochange.Text = "拆解";
             this.nochange.UseVisualStyleBackColor = true;
+            this.nochange.Visible = false;
             // 
             // dataGridViewCheckBoxColumn1
             // 

+ 0 - 72
UAS_MES_LT/FunctionCode/Make/Make_Decompose_Ex.resx

@@ -189,78 +189,6 @@
   <metadata name="cm_sncode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
-  <metadata name="cm_status.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="cm_spid.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="cm_firstsn.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="cm_wccode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="cm_fsoncode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="cm_stepcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="cm_stepname.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="cm_craftname.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="cm_craftcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="cm_id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="pr_detail.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="mb_bgcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="mb_badcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="AddBad.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="cm_makecode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="pr_detail_.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="cm_soncode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="cm_barcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="New_BarCode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="cm_status_1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="cm_maid.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="cm_materialtype.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="cm_maprodcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="cm_sncode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
   <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
   <data name="Decompose.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>

+ 5 - 5
UAS_MES_LT/FunctionCode/Make/Make_FeedingCollection.Designer.cs

@@ -294,7 +294,7 @@
             this.NoteForChange.AutoSize = true;
             this.NoteForChange.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.NoteForChange.Location = new System.Drawing.Point(11, 39);
-            this.NoteForChange.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.NoteForChange.Margin = new System.Windows.Forms.Padding(2);
             this.NoteForChange.Name = "NoteForChange";
             this.NoteForChange.Size = new System.Drawing.Size(99, 21);
             this.NoteForChange.TabIndex = 192;
@@ -396,7 +396,7 @@
             // 
             this.StepCount.LineCode = null;
             this.StepCount.Location = new System.Drawing.Point(460, 344);
-            this.StepCount.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.StepCount.Margin = new System.Windows.Forms.Padding(2);
             this.StepCount.Name = "StepCount";
             this.StepCount.Size = new System.Drawing.Size(80, 22);
             this.StepCount.Source = null;
@@ -411,7 +411,7 @@
             this.ma_code.DBTitle = null;
             this.ma_code.FormName = null;
             this.ma_code.Location = new System.Drawing.Point(96, 13);
-            this.ma_code.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.ma_code.Margin = new System.Windows.Forms.Padding(2);
             this.ma_code.Name = "ma_code";
             this.ma_code.Power = null;
             this.ma_code.ReturnData = null;
@@ -430,7 +430,7 @@
             this.LockMakeCode.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.LockMakeCode.LeaveEvent = false;
             this.LockMakeCode.Location = new System.Drawing.Point(248, 15);
-            this.LockMakeCode.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.LockMakeCode.Margin = new System.Windows.Forms.Padding(2);
             this.LockMakeCode.Name = "LockMakeCode";
             this.LockMakeCode.Size = new System.Drawing.Size(51, 21);
             this.LockMakeCode.TabIndex = 140;
@@ -625,7 +625,7 @@
             // pr_detail_
             // 
             this.pr_detail_.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCellsExceptHeader;
-            this.pr_detail_.DataPropertyName = "pr_spec";
+            this.pr_detail_.DataPropertyName = "pr_detail";
             this.pr_detail_.HeaderText = "上料名称";
             this.pr_detail_.MinimumWidth = 100;
             this.pr_detail_.Name = "pr_detail_";

+ 47 - 22
UAS_MES_LT/FunctionCode/Make/Make_FeedingCollection.cs

@@ -9,7 +9,6 @@ using UAS_MES_NEW.PublicMethod;
 using System.Drawing;
 using System.Text.RegularExpressions;
 using System.Collections.Generic;
-using UAS_MES_NEW.PublicForm;
 
 namespace UAS_MES_NEW.Make
 {
@@ -59,6 +58,8 @@ namespace UAS_MES_NEW.Make
 
         List<string> SPID = new List<string>();
 
+        string replacestring = "";
+
         public Make_FeedingCollection()
         {
             InitializeComponent();
@@ -71,10 +72,10 @@ namespace UAS_MES_NEW.Make
             ma_code.SetLockCheckBox(LockMakeCode);
             //工单号放大镜配置
             ma_code.TableName = "make left join product on ma_prodcode=pr_code";
-            ma_code.SelectField = "ma_code # 工单号,ma_prodcode # 产品编号,ma_qty # 工单数量,ma_craftcode # 途程编号,pr_spec # 产品名称,ma_bomversion # Bom版本,ma_softversion # 软件版本,ma_ecncode # ECN号";
+            ma_code.SelectField = "ma_code # 工单号,ma_prodcode # 产品编号,ma_qty # 工单数量,ma_craftcode # 途程编号,pr_spec # 产品规格,ma_bomversion # Bom版本,ma_softversion # 软件版本";
             ma_code.FormName = Name;
             ma_code.DBTitle = "工单查询";
-            ma_code.SetValueField = new string[] { "ma_code", "ma_prodcode", "ma_qty", "pr_spec", "ma_craftcode", "ma_bomversion", "ma_softversion", "ma_ecncode" };
+            ma_code.SetValueField = new string[] { "ma_code", "ma_prodcode", "ma_qty", "pr_spec", "ma_craftcode", "ma_bomversion", "ma_softversion" };
             ma_code.Condition = "ma_statuscode='STARTED'";
             ma_code.DbChange += Ma_code_DBChange;
             code.Focus();
@@ -143,7 +144,7 @@ namespace UAS_MES_NEW.Make
                             //索引超出长度表示内容均已提醒
                             if (RemainIndex >= RemainList.Length)
                             {
-                                OperateResult.AppendText(">>当前序列号" + sn_code.Text + "不在本道工序,请采集其它序列号\n", Color.Black);
+                                OperateResult.AppendText(">>当前序列号" + sn_code.Text + "不在本道工序,请采集其它序列号\n", Color.Red);
                                 sn_code.Text = "";
                                 code.Text = "";
                                 return;
@@ -159,6 +160,7 @@ namespace UAS_MES_NEW.Make
                             string sp_barcoderule = dt1.Rows[RemainIndex]["sp_barcoderule"].ToString();
                             string sp_checkbarcode = dt1.Rows[RemainIndex]["sp_checkbarcode"].ToString();
                             string sp_checksalecode = dt1.Rows[RemainIndex]["sp_checksalecode"].ToString();
+                            string sp_ifuseregex = dt1.Rows[RemainIndex]["sp_ifuseregex"].ToString();
                             if (LogicHandler.CheckSNBeforeLoad(ma_code.Text, code.Text, sp_fsoncode, sp_soncode, sp_barcoderule, sp_prefix, length, sp_ifrepeat, sp_checksalecode, out ErrorMessage))
                             {
                                 //判断采集的条码和本次采集的也不能重复
@@ -183,7 +185,17 @@ namespace UAS_MES_NEW.Make
                                         return;
                                     }
                                 }
-                                TSN.Add(code.Text.Substring(0, code.Text.Length > 80 ? 80 : code.Text.Length));
+                                if (sp_ifuseregex == "-1")
+                                {
+                                    dt = (DataTable)dh.ExecuteSql("select SR_REPLACE from SPREPLACE where INSTR('" + code.Text + "',SR_CONTAIN)>0 AND LENGTH('" + code.Text + "') = SR_LENGTH", "select");
+                                    if (dt.Rows.Count == 0)
+                                    {
+                                        OperateResult.AppendText(">>条码" + code.Text + "属于特殊物料,但是并未找到对应特殊物料规则\n", Color.Red, code);
+                                        return;
+                                    }
+                                    replacestring = dt.Rows[0]["SR_REPLACE"].ToString();
+                                }
+                                TSN.Add(code.Text);
                                 if (sp_barcoderule == "BARCODE")
                                 {
                                     sp_soncode = ErrorMessage;
@@ -191,12 +203,7 @@ namespace UAS_MES_NEW.Make
                                 Save_OtherCode(sp_fsoncode, sp_soncode, make_code, sn_code.Text, sp_id);
                             }
                             else
-                            {
                                 OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, code);
-                                SetCheck set = new SetCheck("NG", Color.Red);
-                                BaseUtil.SetFormCenter(set);
-                                set.ShowDialog();
-                            }
                         }
                     }
                     //勾选了下料的时候
@@ -322,7 +329,7 @@ namespace UAS_MES_NEW.Make
                                     {
                                         CollectDataSonCode.Add(sp_soncode);
                                         SPID.Add(sp_id);
-                                        CollectData.Add(code.Text.Substring(0, code.Text.Length > 80 ? 80 : code.Text.Length));
+                                        CollectData.Add(code.Text);
                                         sn_code.Text = code.Text;
                                         OperateResult.AppendText(">>序列号" + code.Text + ",物料" + sp_soncode + "上料成功\n", Color.Green);
                                         RemainIndex = RemainIndex + 1;
@@ -371,10 +378,10 @@ namespace UAS_MES_NEW.Make
             //单独用一个DataTable存储一个
             dt1 = new DataTable();
             sql.Clear();
-            sql.Append("select max(sp_id)sp_id,max(sp_detno)sp_detno,min(sp_ifrepeat)sp_ifrepeat,max(sp_checkbarcode)sp_checkbarcode,min(sp_checksalecode)sp_checksalecode,");
+            sql.Append("select max(sp_id)sp_id,max(sp_detno)sp_detno,min(sp_ifrepeat)sp_ifrepeat,min(sp_iflabelcheck) sp_iflabelcheck,max(sp_checkbarcode)sp_checkbarcode,min(sp_checksalecode)sp_checksalecode,");
             sql.Append("sp_fsoncode,max(sp_barcoderule)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,replace(wm_concat(sp_prefix),',','|')sp_prefix,max(sp_regex)");
-            sql.Append("sp_regex,max(pr_detail)pr_detail,max(substr(pr_spec,0,20))pr_spec from stepproduct left join product on pr_code=sp_fsoncode where ");
+            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("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=");
@@ -406,7 +413,8 @@ namespace UAS_MES_NEW.Make
             }
             else
             {
-                OperateResult.AppendText(">>序列号" + sn_code.Text + "不在本道工序,请采集其它序列号\n", Color.Black);
+                string nextstepcode = dh.getFieldDataByCondition("makeserial left join step on ms_nextstepcode = st_code", "st_name", "ms_sncode = '" + sn_code.Text + "'").ToString();
+                OperateResult.AppendText(">>序列号" + sn_code.Text + "已经上料完成,处于" + nextstepcode + "工序,请采集其它序列号\n", Color.Red);
                 if (!LogicHandler.SetStepResult(ma_code.Text, User.UserSourceCode, sn_code.Text, "上料采集", "上料成功", User.UserCode, out ErrorMessage))
                     OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
                 else
@@ -427,16 +435,16 @@ namespace UAS_MES_NEW.Make
             CollectDataSonCode.Add(sp_soncode);
             //采集成功提示
 
-            CollectData.Add(code.Text.Substring(0, code.Text.Length > 80 ? 80 : code.Text.Length));
+            CollectData.Add(code.Text);
             if (!CheckBarcode.ContainsKey(sp_fsoncode))
             {
-                CheckBarcode.Add(sp_fsoncode, code.Text.Substring(0, code.Text.Length > 80 ? 80 : code.Text.Length));
+                CheckBarcode.Add(sp_fsoncode, code.Text);
             }
             SPID.Add(sp_id);
             OperateResult.AppendText(">>物料" + sp_soncode + "采集成功,条码" + code.Text + "\n", Color.Green);
             LabelDataGridView.Rows[RemainIndex].Cells["BarCode"].Value = code.Text;
-            if (code.Text.Length > 80)
-                OperateResult.AppendText(">>采集条码" + code.Text + "程度超过长度限制80,内容截取前80位进行采集\n", Color.Red);
+            //if (code.Text.Length > 200)
+            //    OperateResult.AppendText(">>采集条码" + code.Text + "程度超过长度限制200,内容截取前200位进行采集\n", Color.Red);
             code.Clear();
             RemainIndex = RemainIndex + 1;
             //如果+1后不小于B序列的长度,则已采集完成,不需要进行提示了
@@ -494,6 +502,24 @@ namespace UAS_MES_NEW.Make
                 LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, oMakeCode, User.UserLineCode, User.UserSourceCode, "上料采集", "上料成功", sn_code.Text, "");
                 if (LogicHandler.SetStepResult(ma_code, User.UserSourceCode, sn_code.Text, "上料采集", "上料成功", User.UserCode, out ErrorMessage))
                 {
+                    //replacestring; ma_prodcode.Text
+                    dt = (DataTable)dh.ExecuteSql("select pr_relocation from product where pr_code = '" + ma_prodcode.Text + "' and pr_ifreplace = -1", "select");
+                    if (dt.Rows.Count > 0 && replacestring != "")
+                    {
+                        string newsncode = sn_code.Text.Remove(int.Parse(dt.Rows[0]["pr_relocation"].ToString())-1, 1);
+                        newsncode = newsncode.Insert(int.Parse(dt.Rows[0]["pr_relocation"].ToString())-1, replacestring);
+                        if (dh.CheckExist("MAKESNRELATION", "FIRSTSN = '" + ms_firstsn + "' AND MAKECODE = '"+ ma_code + "'"))
+                        {
+                            dh.ExecuteSql("update MAKESNRELATION set sn = '"+ newsncode + "' where FIRSTSN = '" + ms_firstsn + "' AND MAKECODE = '" + ma_code + "'", "update");
+                        }
+                        else
+                        {
+                            dh.ExecuteSql("insert into MAKESNRELATION(beforesn,sn,firstsn,makecode,msr_indate,msr_inman) values('"+ ms_firstsn + "','" + newsncode + "','" + ms_firstsn + "','" + ma_code + "',sysdate,'"+User.UserName+"')", "insert");
+                        }
+                        dh.ExecuteSql("update makeserial set ms_sncode = '"+newsncode+"' where ms_sncode = '"+sn_code.Text+"' and ms_makecode = '"+ma_code+"'", "update");
+                        LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, oMakeCode, User.UserLineCode, User.UserSourceCode, "上料采集特殊SN替换", "SN"+ sn_code.Text+"更新为"+ newsncode, newsncode, "");
+                        OperateResult.AppendText("SN" + sn_code.Text + "更新为" + newsncode + "\n");
+                    }
                     //提示正确返回时传递的信息
                     if (ErrorMessage.Contains("AFTERSUCCESS"))
                         OperateResult.AppendText(">>" + ErrorMessage + "\n");
@@ -501,12 +527,10 @@ namespace UAS_MES_NEW.Make
                     //刷新数据
                     EventArgs e = new EventArgs();
                     object sender = null;
+                    replacestring = "";
                     ma_code_UserControlTextChanged(sender, e);
                 }
-                else
-                {
-                    OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, code);
-                }
+                else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, code);
             }
         }
 
@@ -518,6 +542,7 @@ namespace UAS_MES_NEW.Make
             CheckBarcode.Clear();
             CollectData.Clear();
             CollectDataSonCode.Clear();
+            replacestring = "";
             if (dt1 != null)
                 BaseUtil.CleanDataTableData(dt1);
             RemainIndex = 0;

+ 8 - 5
UAS_MES_LT/FunctionCode/Make/Make_FuselageLabelPrint.cs

@@ -10,7 +10,7 @@ using LabelManager2;
 using System.IO;
 using System.Threading;
 using UAS_MES_NEW.PublicForm;
-using Seagull.BarTender.Print;
+//using Seagull.BarTender.Print;
 
 namespace UAS_MES_NEW.Make
 {
@@ -31,7 +31,7 @@ namespace UAS_MES_NEW.Make
 
         ApplicationClass lbl;
 
-        Engine engine;
+        BarTender.Application engine;
 
         string oMakeCode = "";
         string oMsId = "";
@@ -97,7 +97,7 @@ namespace UAS_MES_NEW.Make
         {
             try
             {
-                engine = new Engine();
+                engine = new BarTender.Application();
                 //lbl = new ApplicationClass();
                 //BaseUtil.WriteLbl();
             }
@@ -183,7 +183,7 @@ namespace UAS_MES_NEW.Make
                             OperateResult.AppendText("<<序列号:" + sncode.Text + "\n", Color.Black);
                             //按照打印张数打印
                             //doc = lbl.Documents.Open(PrintLabel.Text);
-                            if (Print.BarTender(Tag.ToString(), ref engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, sncode.Text, int.Parse(PrintNum.Text), oMakeCode, ma_prodcode.Text, "机身标", "0", out oErrorMessage))
+                            if (Print.SinglePrint(Tag.ToString(),  engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, sncode.Text, int.Parse(PrintNum.Text), oMakeCode, ma_prodcode.Text, "机身标", "0", out oErrorMessage))
                             {
                                 //提示用户打印成功
                                 OperateResult.AppendText(">>序列号:" + sncode.Text + "打印成功\n", Color.Green);
@@ -267,7 +267,10 @@ namespace UAS_MES_NEW.Make
 
         private void Make_FuselageLabelPrint_FormClosing(object sender, FormClosingEventArgs e)
         {
-            BaseUtil.ClosePrint(engine);
+            BaseUtil.ClosePrint(lbl);
+            if (engine != null)
+                engine.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges);
+            dh.Dispose();
         }
 
         private void Make_FuselageLabelPrint_SizeChanged(object sender, EventArgs e)

+ 88 - 73
UAS_MES_LT/FunctionCode/Make/Make_RePrintLabel.Designer.cs

@@ -30,10 +30,14 @@
         {
             this.components = new System.ComponentModel.Container();
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Make_RePrintLabel));
+            this.giftBox = new System.Windows.Forms.RadioButton();
+            this.CartonBox = new System.Windows.Forms.RadioButton();
+            this.fuselagel = new System.Windows.Forms.RadioButton();
             this.label = new System.Windows.Forms.Label();
             this.label3 = new System.Windows.Forms.Label();
             this.label111 = new System.Windows.Forms.Label();
             this.label5 = new System.Windows.Forms.Label();
+            this.PrintLabel = new UAS_MES_NEW.CustomControl.ComBoxWithFocus.ComboxWithTip(this.components);
             this.label6 = new System.Windows.Forms.Label();
             this.label7 = new System.Windows.Forms.Label();
             this.label8 = new System.Windows.Forms.Label();
@@ -42,19 +46,57 @@
             this.pr_code = new System.Windows.Forms.Label();
             this.ms_makecode = new System.Windows.Forms.Label();
             this.pr_detail = new System.Windows.Forms.Label();
-            this.groupBoxWithBorder1 = new UAS_MES_NEW.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
-            this.CartonBox = new System.Windows.Forms.RadioButton();
-            this.fuselagel = new System.Windows.Forms.RadioButton();
-            this.giftBox = new System.Windows.Forms.RadioButton();
             this.OperateResult = new UAS_MES_NEW.CustomControl.RichText.RichTextAutoBottom();
             this.printBtn = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
             this.printNum = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.NumOnlyTextBox();
             this.inputText = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SnCollectionBox();
-            this.PrintLabel = new UAS_MES_NEW.CustomControl.ComBoxWithFocus.ComboxWithTip(this.components);
             this.Printer = new UAS_MES_NEW.CustomControl.ComBoxWithFocus.PrinterCombox();
+            this.groupBoxWithBorder1 = new UAS_MES_NEW.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
+            this.jishen = new System.Windows.Forms.RadioButton();
             this.groupBoxWithBorder1.SuspendLayout();
             this.SuspendLayout();
             // 
+            // giftBox
+            // 
+            this.giftBox.AutoSize = true;
+            this.giftBox.Checked = true;
+            this.giftBox.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.giftBox.Location = new System.Drawing.Point(55, 35);
+            this.giftBox.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
+            this.giftBox.Name = "giftBox";
+            this.giftBox.Size = new System.Drawing.Size(92, 25);
+            this.giftBox.TabIndex = 1;
+            this.giftBox.Text = "彩标打印";
+            this.giftBox.UseVisualStyleBackColor = true;
+            this.giftBox.CheckedChanged += new System.EventHandler(this.radioButton_CheckedChange);
+            // 
+            // CartonBox
+            // 
+            this.CartonBox.AutoSize = true;
+            this.CartonBox.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.CartonBox.Location = new System.Drawing.Point(363, 35);
+            this.CartonBox.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
+            this.CartonBox.Name = "CartonBox";
+            this.CartonBox.Size = new System.Drawing.Size(112, 25);
+            this.CartonBox.TabIndex = 2;
+            this.CartonBox.Text = "Carton打印";
+            this.CartonBox.UseVisualStyleBackColor = true;
+            this.CartonBox.CheckedChanged += new System.EventHandler(this.radioButton_CheckedChange);
+            // 
+            // fuselagel
+            // 
+            this.fuselagel.AutoSize = true;
+            this.fuselagel.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.fuselagel.Location = new System.Drawing.Point(563, 35);
+            this.fuselagel.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
+            this.fuselagel.Name = "fuselagel";
+            this.fuselagel.Size = new System.Drawing.Size(108, 25);
+            this.fuselagel.TabIndex = 3;
+            this.fuselagel.Text = "栈板标打印";
+            this.fuselagel.UseVisualStyleBackColor = true;
+            this.fuselagel.Visible = false;
+            this.fuselagel.CheckedChanged += new System.EventHandler(this.radioButton_CheckedChange);
+            // 
             // label
             // 
             this.label.AutoSize = true;
@@ -99,6 +141,16 @@
             this.label5.TabIndex = 7;
             this.label5.Text = "名称";
             // 
+            // PrintLabel
+            // 
+            this.PrintLabel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.PrintLabel.FormattingEnabled = true;
+            this.PrintLabel.Location = new System.Drawing.Point(125, 179);
+            this.PrintLabel.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
+            this.PrintLabel.Name = "PrintLabel";
+            this.PrintLabel.Size = new System.Drawing.Size(149, 20);
+            this.PrintLabel.TabIndex = 189;
+            // 
             // label6
             // 
             this.label6.AutoSize = true;
@@ -182,64 +234,6 @@
             this.pr_detail.Size = new System.Drawing.Size(0, 21);
             this.pr_detail.TabIndex = 202;
             // 
-            // groupBoxWithBorder1
-            // 
-            this.groupBoxWithBorder1.BorderColor = System.Drawing.Color.Black;
-            this.groupBoxWithBorder1.Controls.Add(this.CartonBox);
-            this.groupBoxWithBorder1.Controls.Add(this.fuselagel);
-            this.groupBoxWithBorder1.Controls.Add(this.giftBox);
-            this.groupBoxWithBorder1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.groupBoxWithBorder1.Location = new System.Drawing.Point(29, 9);
-            this.groupBoxWithBorder1.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
-            this.groupBoxWithBorder1.Name = "groupBoxWithBorder1";
-            this.groupBoxWithBorder1.Padding = new System.Windows.Forms.Padding(2, 3, 2, 3);
-            this.groupBoxWithBorder1.Size = new System.Drawing.Size(756, 72);
-            this.groupBoxWithBorder1.TabIndex = 204;
-            this.groupBoxWithBorder1.TabStop = false;
-            this.groupBoxWithBorder1.Text = "打印类型";
-            this.groupBoxWithBorder1.TextColor = System.Drawing.Color.Black;
-            // 
-            // CartonBox
-            // 
-            this.CartonBox.AutoSize = true;
-            this.CartonBox.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.CartonBox.Location = new System.Drawing.Point(287, 35);
-            this.CartonBox.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
-            this.CartonBox.Name = "CartonBox";
-            this.CartonBox.Size = new System.Drawing.Size(112, 25);
-            this.CartonBox.TabIndex = 2;
-            this.CartonBox.Text = "Carton打印";
-            this.CartonBox.UseVisualStyleBackColor = true;
-            this.CartonBox.CheckedChanged += new System.EventHandler(this.radioButton_CheckedChange);
-            // 
-            // fuselagel
-            // 
-            this.fuselagel.AutoSize = true;
-            this.fuselagel.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.fuselagel.Location = new System.Drawing.Point(563, 35);
-            this.fuselagel.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
-            this.fuselagel.Name = "fuselagel";
-            this.fuselagel.Size = new System.Drawing.Size(108, 25);
-            this.fuselagel.TabIndex = 3;
-            this.fuselagel.Text = "栈板标打印";
-            this.fuselagel.UseVisualStyleBackColor = true;
-            this.fuselagel.CheckedChanged += new System.EventHandler(this.radioButton_CheckedChange);
-            // 
-            // giftBox
-            // 
-            this.giftBox.AutoSize = true;
-            this.giftBox.Checked = true;
-            this.giftBox.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.giftBox.Location = new System.Drawing.Point(55, 35);
-            this.giftBox.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
-            this.giftBox.Name = "giftBox";
-            this.giftBox.Size = new System.Drawing.Size(92, 25);
-            this.giftBox.TabIndex = 1;
-            this.giftBox.TabStop = true;
-            this.giftBox.Text = "彩标打印";
-            this.giftBox.UseVisualStyleBackColor = true;
-            this.giftBox.CheckedChanged += new System.EventHandler(this.radioButton_CheckedChange);
-            // 
             // OperateResult
             // 
             this.OperateResult.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
@@ -301,16 +295,6 @@
             this.inputText.TabIndex = 191;
             this.inputText.KeyDown += new System.Windows.Forms.KeyEventHandler(this.inputText_KeyDown);
             // 
-            // PrintLabel
-            // 
-            this.PrintLabel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
-            this.PrintLabel.FormattingEnabled = true;
-            this.PrintLabel.Location = new System.Drawing.Point(125, 179);
-            this.PrintLabel.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
-            this.PrintLabel.Name = "PrintLabel";
-            this.PrintLabel.Size = new System.Drawing.Size(149, 20);
-            this.PrintLabel.TabIndex = 189;
-            // 
             // Printer
             // 
             this.Printer.Location = new System.Drawing.Point(125, 145);
@@ -319,6 +303,36 @@
             this.Printer.Size = new System.Drawing.Size(148, 25);
             this.Printer.TabIndex = 186;
             // 
+            // groupBoxWithBorder1
+            // 
+            this.groupBoxWithBorder1.BorderColor = System.Drawing.Color.Black;
+            this.groupBoxWithBorder1.Controls.Add(this.jishen);
+            this.groupBoxWithBorder1.Controls.Add(this.CartonBox);
+            this.groupBoxWithBorder1.Controls.Add(this.fuselagel);
+            this.groupBoxWithBorder1.Controls.Add(this.giftBox);
+            this.groupBoxWithBorder1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.groupBoxWithBorder1.Location = new System.Drawing.Point(29, 9);
+            this.groupBoxWithBorder1.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
+            this.groupBoxWithBorder1.Name = "groupBoxWithBorder1";
+            this.groupBoxWithBorder1.Padding = new System.Windows.Forms.Padding(2, 3, 2, 3);
+            this.groupBoxWithBorder1.Size = new System.Drawing.Size(756, 72);
+            this.groupBoxWithBorder1.TabIndex = 204;
+            this.groupBoxWithBorder1.TabStop = false;
+            this.groupBoxWithBorder1.Text = "打印类型";
+            this.groupBoxWithBorder1.TextColor = System.Drawing.Color.Black;
+            // 
+            // jishen
+            // 
+            this.jishen.AutoSize = true;
+            this.jishen.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.jishen.Location = new System.Drawing.Point(200, 35);
+            this.jishen.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
+            this.jishen.Name = "jishen";
+            this.jishen.Size = new System.Drawing.Size(108, 25);
+            this.jishen.TabIndex = 4;
+            this.jishen.Text = "机身标打印";
+            this.jishen.UseVisualStyleBackColor = true;
+            // 
             // Make_RePrintLabel
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@@ -381,5 +395,6 @@
         private System.Windows.Forms.Label ms_makecode;
         private System.Windows.Forms.Label pr_detail;
         private CustomControl.GroupBoxWithBorder.GroupBoxWithBorder groupBoxWithBorder1;
+        private System.Windows.Forms.RadioButton jishen;
     }
 }

+ 53 - 4
UAS_MES_LT/FunctionCode/Make/Make_RePrintLabel.cs

@@ -21,6 +21,8 @@ namespace UAS_MES_NEW.Make
 
         LogStringBuilder sql = new LogStringBuilder();
 
+        public BarTender.Application engine;
+
         AutoSizeFormClass asc = new AutoSizeFormClass();
 
         ApplicationClass lbl;
@@ -73,6 +75,7 @@ namespace UAS_MES_NEW.Make
         {
             try
             {
+                engine = new BarTender.Application();
                 lbl = new ApplicationClass();
                 BaseUtil.WriteLbl();
             }
@@ -90,8 +93,12 @@ namespace UAS_MES_NEW.Make
 
         private void Make_RePrintLabel_FormClosing(object sender, FormClosingEventArgs e)
         {
+            if (engine != null)
+                engine.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges);
             //窗口关闭的时候
             BaseUtil.ClosePrint(lbl);
+            dh.Dispose();
+
         }
 
         private void radioButton_CheckedChange(object sender, EventArgs e)
@@ -113,6 +120,11 @@ namespace UAS_MES_NEW.Make
                 OperateResult.AppendText(">>请输入栈板号\n", Color.Black);
                 clearAll();
             }
+            else if (btn.Name == "jishen" && btn.Checked)
+            {
+                OperateResult.AppendText(">>请输入SN\n", Color.Black);
+                clearAll();
+            }
         }
 
         private void inputText_KeyDown(object sender, KeyEventArgs e)
@@ -127,7 +139,7 @@ namespace UAS_MES_NEW.Make
                 }
                 OperateResult.AppendText(">>" + inputText.Text + "\n", Color.Black);
                 //打印类型为彩盒或者机身标
-                if (giftBox.Checked)
+                if (giftBox.Checked||jishen.Checked)
                 {
                     //select max(ms_id)ms_id from makeserial where ms_sncode=? 
                     ms_id = dh.getFieldDataByCondition("makeserial", "max(ms_id) ms_id", "ms_sncode='" + inputText.Text + "'").ToString();
@@ -201,6 +213,8 @@ namespace UAS_MES_NEW.Make
                 type = "栈板标";
             else if (giftBox.Checked)
                 type = "彩盒标";
+            else if (jishen.Checked)
+                type = "机身标";
             else
                 type = "卡通箱标";
 
@@ -246,7 +260,42 @@ namespace UAS_MES_NEW.Make
                 //}
                 //判定通过进行打印 
                 //doc = lbl.Documents.Open(PrintLabel.Text);
-                if (Print.CodeSoft(Tag.ToString(), ref lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, inputValue.Text, int.Parse(printNum.Text), ms_makecode.Text, pr_code.Text, giftBox.Checked ? "彩盒标" : "机身标", "-1", out errorMessage))
+                if (Print.SinglePrint(Tag.ToString(), engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, inputValue.Text, int.Parse(printNum.Text), ms_makecode.Text, pr_code.Text, "彩盒标", "-1", out errorMessage))
+                {
+                    //按照打印张数打印
+                    OperateResult.AppendText("<<打印成功\n", Color.Green);
+                }
+                else
+                {
+                    OperateResult.AppendText(errorMessage + "\n", Color.Red);
+                }
+                //打印成功,记录日志commandlog , cl_operate彩盒或者机身标补打印,cl_result补打印成功
+                LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_makecode.Text, User.UserLineCode, User.UserSourceCode, giftBox.Checked ? "彩盒标补打印" : "机身标补打印", "补打印成功", inputValue.Text, "");
+                ////如果ms_downstatus<>0,则更新ms_downstatus=-1 where ms_id=?id,同时插入记录至表 MAKEDOWN
+                //if (mapB.Rows[0]["ms_downstatus"].ToString() == "0")
+                //{
+                //    dh.ExecuteSql("update makeserial set ms_downstatus='-1' where ms_id='" + ms_id + "'", "update");
+                //    //插入数据
+                //    putInfo2MakeDown();
+                //}
+            }else if (jishen.Checked)
+            {
+                mapB = (DataTable)dh.ExecuteSql("select ms_outboxcode, nvl(ms_downstatus,0) ms_downstatus from makeserial where ms_id='" + ms_id + "' and ms_sncode='" + inputValue.Text + "'", "select");
+                if (mapB.Rows.Count == 0)
+                {
+                    //无值提示用户序列号错误,不存在或者已经发生转号
+                    OperateResult.AppendText("<<序列号错误,不存在或已经发生转号\n", Color.Red);
+                    return;
+                }
+                ////如果ms_outboxcode 不为空,则提示用户,已经装箱不允许单独打印
+                //if (mapB.Rows[0]["ms_outboxcode"].ToString() != "")
+                //{
+                //    OperateResult.AppendText("<<SN:" + inputValue.Text + "已经装箱" + mapB.Rows[0]["ms_outboxcode"].ToString() + "不允许单独补打\n", Color.Red);
+                //    return;
+                //}
+                //判定通过进行打印 
+                //doc = lbl.Documents.Open(PrintLabel.Text);
+                if (Print.SinglePrint(Tag.ToString(), engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, inputValue.Text, int.Parse(printNum.Text), ms_makecode.Text, pr_code.Text, "机身标", "-1", out errorMessage))
                 {
                     //按照打印张数打印
                     OperateResult.AppendText("<<打印成功\n", Color.Green);
@@ -277,7 +326,7 @@ namespace UAS_MES_NEW.Make
                     return;
                 }
                 //doc = lbl.Documents.Open(PrintLabel.Text);
-                if (Print.CodeSoft(Tag.ToString(), ref lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, inputValue.Text, int.Parse(printNum.Text), ms_makecode.Text, pr_code.Text, "卡通箱标", "-1", out errorMessage))
+                if (Print.SinglePrint(Tag.ToString(), engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, inputValue.Text, int.Parse(printNum.Text), ms_makecode.Text, pr_code.Text, "卡通箱标", "-1", out errorMessage))
                 {
                     //判断通过,打印
                     OperateResult.AppendText("<<打印成功\n", Color.Green);
@@ -308,7 +357,7 @@ namespace UAS_MES_NEW.Make
                     return;
                 }
                 //doc = lbl.Documents.Open(PrintLabel.Text);
-                if (Print.CodeSoft(Tag.ToString(), ref lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, inputValue.Text, int.Parse(printNum.Text), ms_makecode.Text, pr_code.Text, "栈板标", "-1", out errorMessage))
+                if (Print.SinglePrint(Tag.ToString(), engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, inputValue.Text, int.Parse(printNum.Text), ms_makecode.Text, pr_code.Text, "栈板标", "-1", out errorMessage))
                 {
                     //判断通过,打印
                     OperateResult.AppendText("<<打印成功\n", Color.Green);

+ 172 - 183
UAS_MES_LT/FunctionCode/Make/Make_Repair.Designer.cs

@@ -95,6 +95,8 @@
             this.Clean = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
             this.NewBadCode = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
             this.SaveBadLocation = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
+            this.normalButton1 = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
+            this.checkBox1 = new System.Windows.Forms.CheckBox();
             ((System.ComponentModel.ISupportInitialize)(this.LocationSource)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.ComponentSource)).BeginInit();
             this.groupBoxWithBorder1.SuspendLayout();
@@ -107,10 +109,9 @@
             // 
             this.label14.AutoSize = true;
             this.label14.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label14.Location = new System.Drawing.Point(1308, 288);
-            this.label14.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label14.Location = new System.Drawing.Point(654, 144);
             this.label14.Name = "label14";
-            this.label14.Size = new System.Drawing.Size(146, 41);
+            this.label14.Size = new System.Drawing.Size(74, 21);
             this.label14.TabIndex = 46;
             this.label14.Text = "不良备注";
             // 
@@ -119,10 +120,9 @@
             this.bc_name_label.AutoSize = true;
             this.bc_name_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.bc_name_label.ForeColor = System.Drawing.Color.Black;
-            this.bc_name_label.Location = new System.Drawing.Point(812, 284);
-            this.bc_name_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.bc_name_label.Location = new System.Drawing.Point(406, 142);
             this.bc_name_label.Name = "bc_name_label";
-            this.bc_name_label.Size = new System.Drawing.Size(146, 41);
+            this.bc_name_label.Size = new System.Drawing.Size(74, 21);
             this.bc_name_label.TabIndex = 44;
             this.bc_name_label.Text = "不良代码";
             // 
@@ -130,10 +130,9 @@
             // 
             this.bg_name_label.AutoSize = true;
             this.bg_name_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.bg_name_label.Location = new System.Drawing.Point(326, 284);
-            this.bg_name_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.bg_name_label.Location = new System.Drawing.Point(163, 142);
             this.bg_name_label.Name = "bg_name_label";
-            this.bg_name_label.Size = new System.Drawing.Size(178, 41);
+            this.bg_name_label.Size = new System.Drawing.Size(90, 21);
             this.bg_name_label.TabIndex = 40;
             this.bg_name_label.Text = "不良代码组";
             // 
@@ -142,10 +141,9 @@
             this.mbr_brgcode_label.AutoSize = true;
             this.mbr_brgcode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.mbr_brgcode_label.ForeColor = System.Drawing.Color.Black;
-            this.mbr_brgcode_label.Location = new System.Drawing.Point(326, 374);
-            this.mbr_brgcode_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.mbr_brgcode_label.Location = new System.Drawing.Point(163, 187);
             this.mbr_brgcode_label.Name = "mbr_brgcode_label";
-            this.mbr_brgcode_label.Size = new System.Drawing.Size(178, 41);
+            this.mbr_brgcode_label.Size = new System.Drawing.Size(90, 21);
             this.mbr_brgcode_label.TabIndex = 93;
             this.mbr_brgcode_label.Text = "不良原因组";
             // 
@@ -154,10 +152,9 @@
             this.nr_name_label.AutoSize = true;
             this.nr_name_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.nr_name_label.ForeColor = System.Drawing.Color.Black;
-            this.nr_name_label.Location = new System.Drawing.Point(812, 374);
-            this.nr_name_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.nr_name_label.Location = new System.Drawing.Point(406, 187);
             this.nr_name_label.Name = "nr_name_label";
-            this.nr_name_label.Size = new System.Drawing.Size(146, 41);
+            this.nr_name_label.Size = new System.Drawing.Size(74, 21);
             this.nr_name_label.TabIndex = 95;
             this.nr_name_label.Text = "不良原因";
             // 
@@ -166,10 +163,9 @@
             this.mbr_dutycode_label.AutoSize = true;
             this.mbr_dutycode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.mbr_dutycode_label.ForeColor = System.Drawing.Color.Black;
-            this.mbr_dutycode_label.Location = new System.Drawing.Point(1308, 374);
-            this.mbr_dutycode_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.mbr_dutycode_label.Location = new System.Drawing.Point(654, 187);
             this.mbr_dutycode_label.Name = "mbr_dutycode_label";
-            this.mbr_dutycode_label.Size = new System.Drawing.Size(114, 41);
+            this.mbr_dutycode_label.Size = new System.Drawing.Size(58, 21);
             this.mbr_dutycode_label.TabIndex = 97;
             this.mbr_dutycode_label.Text = "责任别";
             // 
@@ -178,10 +174,9 @@
             this.mbc_component_label.AutoSize = true;
             this.mbc_component_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.mbc_component_label.ForeColor = System.Drawing.Color.Black;
-            this.mbc_component_label.Location = new System.Drawing.Point(326, 458);
-            this.mbc_component_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.mbc_component_label.Location = new System.Drawing.Point(163, 229);
             this.mbc_component_label.Name = "mbc_component_label";
-            this.mbc_component_label.Size = new System.Drawing.Size(146, 41);
+            this.mbc_component_label.Size = new System.Drawing.Size(74, 21);
             this.mbc_component_label.TabIndex = 99;
             this.mbc_component_label.Text = "不良组件";
             // 
@@ -190,10 +185,9 @@
             this.mbr_solution_label.AutoSize = true;
             this.mbr_solution_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.mbr_solution_label.ForeColor = System.Drawing.Color.Black;
-            this.mbr_solution_label.Location = new System.Drawing.Point(812, 456);
-            this.mbr_solution_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.mbr_solution_label.Location = new System.Drawing.Point(406, 228);
             this.mbr_solution_label.Name = "mbr_solution_label";
-            this.mbr_solution_label.Size = new System.Drawing.Size(146, 41);
+            this.mbr_solution_label.Size = new System.Drawing.Size(74, 21);
             this.mbr_solution_label.TabIndex = 101;
             this.mbr_solution_label.Text = "解决方案";
             // 
@@ -202,10 +196,9 @@
             this.mbl_loc_label.AutoSize = true;
             this.mbl_loc_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.mbl_loc_label.ForeColor = System.Drawing.Color.Black;
-            this.mbl_loc_label.Location = new System.Drawing.Point(326, 574);
-            this.mbl_loc_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.mbl_loc_label.Location = new System.Drawing.Point(163, 287);
             this.mbl_loc_label.Name = "mbl_loc_label";
-            this.mbl_loc_label.Size = new System.Drawing.Size(146, 41);
+            this.mbl_loc_label.Size = new System.Drawing.Size(74, 21);
             this.mbl_loc_label.TabIndex = 103;
             this.mbl_loc_label.Text = "不良位置";
             // 
@@ -214,10 +207,9 @@
             this.mbp_part_label.AutoSize = true;
             this.mbp_part_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.mbp_part_label.ForeColor = System.Drawing.Color.Black;
-            this.mbp_part_label.Location = new System.Drawing.Point(908, 574);
-            this.mbp_part_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.mbp_part_label.Location = new System.Drawing.Point(454, 287);
             this.mbp_part_label.Name = "mbp_part_label";
-            this.mbp_part_label.Size = new System.Drawing.Size(146, 41);
+            this.mbp_part_label.Size = new System.Drawing.Size(74, 21);
             this.mbp_part_label.TabIndex = 105;
             this.mbp_part_label.Text = "不良零件";
             // 
@@ -227,10 +219,9 @@
             | System.Windows.Forms.AnchorStyles.Left)));
             this.GetSNCode_Label.AutoSize = true;
             this.GetSNCode_Label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.GetSNCode_Label.Location = new System.Drawing.Point(326, 1066);
-            this.GetSNCode_Label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.GetSNCode_Label.Location = new System.Drawing.Point(163, 533);
             this.GetSNCode_Label.Name = "GetSNCode_Label";
-            this.GetSNCode_Label.Size = new System.Drawing.Size(114, 41);
+            this.GetSNCode_Label.Size = new System.Drawing.Size(58, 21);
             this.GetSNCode_Label.TabIndex = 113;
             this.GetSNCode_Label.Text = "序列号";
             // 
@@ -239,20 +230,19 @@
             this.label2.AutoSize = true;
             this.label2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label2.ForeColor = System.Drawing.Color.Black;
-            this.label2.Location = new System.Drawing.Point(16, 236);
-            this.label2.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label2.Location = new System.Drawing.Point(8, 118);
             this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(146, 42);
+            this.label2.Size = new System.Drawing.Size(74, 22);
             this.label2.TabIndex = 117;
             this.label2.Text = "不良信息";
             // 
             // BadCodeTree
             // 
             this.BadCodeTree.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.BadCodeTree.Location = new System.Drawing.Point(22, 288);
-            this.BadCodeTree.Margin = new System.Windows.Forms.Padding(4);
+            this.BadCodeTree.Location = new System.Drawing.Point(11, 144);
+            this.BadCodeTree.Margin = new System.Windows.Forms.Padding(2);
             this.BadCodeTree.Name = "BadCodeTree";
-            this.BadCodeTree.Size = new System.Drawing.Size(284, 848);
+            this.BadCodeTree.Size = new System.Drawing.Size(144, 426);
             this.BadCodeTree.TabIndex = 118;
             this.BadCodeTree.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.BadCodeTree_AfterSelect);
             this.BadCodeTree.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.BadCodeTree_NodeMouseClick);
@@ -262,10 +252,9 @@
             this.bc_code.AutoSize = true;
             this.bc_code.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.bc_code.ForeColor = System.Drawing.Color.Black;
-            this.bc_code.Location = new System.Drawing.Point(1724, 450);
-            this.bc_code.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.bc_code.Location = new System.Drawing.Point(862, 225);
             this.bc_code.Name = "bc_code";
-            this.bc_code.Size = new System.Drawing.Size(0, 41);
+            this.bc_code.Size = new System.Drawing.Size(0, 21);
             this.bc_code.TabIndex = 122;
             this.bc_code.Visible = false;
             // 
@@ -274,10 +263,9 @@
             this.bg_code.AutoSize = true;
             this.bg_code.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.bg_code.ForeColor = System.Drawing.Color.Black;
-            this.bg_code.Location = new System.Drawing.Point(1654, 450);
-            this.bg_code.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.bg_code.Location = new System.Drawing.Point(827, 225);
             this.bg_code.Name = "bg_code";
-            this.bg_code.Size = new System.Drawing.Size(0, 41);
+            this.bg_code.Size = new System.Drawing.Size(0, 21);
             this.bg_code.TabIndex = 123;
             this.bg_code.Visible = false;
             // 
@@ -286,10 +274,9 @@
             this.nrg_code.AutoSize = true;
             this.nrg_code.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.nrg_code.ForeColor = System.Drawing.Color.Black;
-            this.nrg_code.Location = new System.Drawing.Point(1598, 520);
-            this.nrg_code.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.nrg_code.Location = new System.Drawing.Point(799, 260);
             this.nrg_code.Name = "nrg_code";
-            this.nrg_code.Size = new System.Drawing.Size(0, 41);
+            this.nrg_code.Size = new System.Drawing.Size(0, 21);
             this.nrg_code.TabIndex = 136;
             this.nrg_code.Visible = false;
             // 
@@ -298,10 +285,9 @@
             this.so_code.AutoSize = true;
             this.so_code.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.so_code.ForeColor = System.Drawing.Color.Black;
-            this.so_code.Location = new System.Drawing.Point(1640, 526);
-            this.so_code.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.so_code.Location = new System.Drawing.Point(820, 263);
             this.so_code.Name = "so_code";
-            this.so_code.Size = new System.Drawing.Size(0, 41);
+            this.so_code.Size = new System.Drawing.Size(0, 21);
             this.so_code.TabIndex = 137;
             this.so_code.Visible = false;
             // 
@@ -310,10 +296,9 @@
             this.mbr_dutycode.AutoSize = true;
             this.mbr_dutycode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.mbr_dutycode.ForeColor = System.Drawing.Color.Black;
-            this.mbr_dutycode.Location = new System.Drawing.Point(1556, 526);
-            this.mbr_dutycode.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.mbr_dutycode.Location = new System.Drawing.Point(778, 263);
             this.mbr_dutycode.Name = "mbr_dutycode";
-            this.mbr_dutycode.Size = new System.Drawing.Size(0, 41);
+            this.mbr_dutycode.Size = new System.Drawing.Size(0, 21);
             this.mbr_dutycode.TabIndex = 138;
             this.mbr_dutycode.Visible = false;
             // 
@@ -333,20 +318,19 @@
             "FPC排线",
             "电池",
             "其他"});
-            this.mbc_component.Location = new System.Drawing.Point(524, 458);
-            this.mbc_component.Margin = new System.Windows.Forms.Padding(6);
+            this.mbc_component.Location = new System.Drawing.Point(262, 229);
             this.mbc_component.Name = "mbc_component";
-            this.mbc_component.Size = new System.Drawing.Size(238, 32);
+            this.mbc_component.Size = new System.Drawing.Size(121, 20);
             this.mbc_component.TabIndex = 139;
             // 
             // mbr_dutyname
             // 
             this.mbr_dutyname.Condition = null;
             this.mbr_dutyname.Field = null;
-            this.mbr_dutyname.Location = new System.Drawing.Point(1466, 378);
-            this.mbr_dutyname.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.mbr_dutyname.Location = new System.Drawing.Point(733, 189);
+            this.mbr_dutyname.Margin = new System.Windows.Forms.Padding(2);
             this.mbr_dutyname.Name = "mbr_dutyname";
-            this.mbr_dutyname.Size = new System.Drawing.Size(242, 35);
+            this.mbr_dutyname.Size = new System.Drawing.Size(121, 21);
             this.mbr_dutyname.TabIndex = 135;
             this.mbr_dutyname.TableName = null;
             this.mbr_dutyname.Value = null;
@@ -357,10 +341,10 @@
             // 
             this.so_name.Condition = null;
             this.so_name.Field = null;
-            this.so_name.Location = new System.Drawing.Point(1004, 458);
-            this.so_name.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.so_name.Location = new System.Drawing.Point(502, 229);
+            this.so_name.Margin = new System.Windows.Forms.Padding(2);
             this.so_name.Name = "so_name";
-            this.so_name.Size = new System.Drawing.Size(242, 35);
+            this.so_name.Size = new System.Drawing.Size(121, 21);
             this.so_name.TabIndex = 133;
             this.so_name.TableName = null;
             this.so_name.Value = null;
@@ -371,10 +355,10 @@
             // 
             this.nr_name.Condition = null;
             this.nr_name.Field = null;
-            this.nr_name.Location = new System.Drawing.Point(1004, 378);
-            this.nr_name.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.nr_name.Location = new System.Drawing.Point(502, 189);
+            this.nr_name.Margin = new System.Windows.Forms.Padding(2);
             this.nr_name.Name = "nr_name";
-            this.nr_name.Size = new System.Drawing.Size(242, 35);
+            this.nr_name.Size = new System.Drawing.Size(121, 21);
             this.nr_name.TabIndex = 132;
             this.nr_name.TableName = null;
             this.nr_name.Value = null;
@@ -385,10 +369,10 @@
             // 
             this.nrg_name.Condition = null;
             this.nrg_name.Field = null;
-            this.nrg_name.Location = new System.Drawing.Point(524, 378);
-            this.nrg_name.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.nrg_name.Location = new System.Drawing.Point(262, 189);
+            this.nrg_name.Margin = new System.Windows.Forms.Padding(2);
             this.nrg_name.Name = "nrg_name";
-            this.nrg_name.Size = new System.Drawing.Size(242, 35);
+            this.nrg_name.Size = new System.Drawing.Size(121, 21);
             this.nrg_name.TabIndex = 131;
             this.nrg_name.TableName = null;
             this.nrg_name.Value = null;
@@ -398,6 +382,7 @@
             // groupBoxWithBorder1
             // 
             this.groupBoxWithBorder1.BorderColor = System.Drawing.Color.Black;
+            this.groupBoxWithBorder1.Controls.Add(this.checkBox1);
             this.groupBoxWithBorder1.Controls.Add(this.cd_stepcode);
             this.groupBoxWithBorder1.Controls.Add(this.ms_reworkcheckno);
             this.groupBoxWithBorder1.Controls.Add(this.ms_makecode_label);
@@ -405,7 +390,6 @@
             this.groupBoxWithBorder1.Controls.Add(this.ms_checkno);
             this.groupBoxWithBorder1.Controls.Add(this.RepairComplete);
             this.groupBoxWithBorder1.Controls.Add(this.ms_sncode);
-            this.groupBoxWithBorder1.Controls.Add(this.Scrap);
             this.groupBoxWithBorder1.Controls.Add(this.nr_code);
             this.groupBoxWithBorder1.Controls.Add(this.st_rstepcode_label);
             this.groupBoxWithBorder1.Controls.Add(this.ma_craftcode_label);
@@ -416,11 +400,11 @@
             this.groupBoxWithBorder1.Controls.Add(this.ms_prodcode);
             this.groupBoxWithBorder1.Controls.Add(this.ms_makecode);
             this.groupBoxWithBorder1.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.groupBoxWithBorder1.Location = new System.Drawing.Point(18, 16);
-            this.groupBoxWithBorder1.Margin = new System.Windows.Forms.Padding(4);
+            this.groupBoxWithBorder1.Location = new System.Drawing.Point(9, 8);
+            this.groupBoxWithBorder1.Margin = new System.Windows.Forms.Padding(2);
             this.groupBoxWithBorder1.Name = "groupBoxWithBorder1";
-            this.groupBoxWithBorder1.Padding = new System.Windows.Forms.Padding(4);
-            this.groupBoxWithBorder1.Size = new System.Drawing.Size(1760, 204);
+            this.groupBoxWithBorder1.Padding = new System.Windows.Forms.Padding(2);
+            this.groupBoxWithBorder1.Size = new System.Drawing.Size(880, 102);
             this.groupBoxWithBorder1.TabIndex = 130;
             this.groupBoxWithBorder1.TabStop = false;
             this.groupBoxWithBorder1.Text = "工单信息";
@@ -434,14 +418,13 @@
             this.cd_stepcode.DBTitle = "回流工序";
             this.cd_stepcode.Font = new System.Drawing.Font("微软雅黑", 9F);
             this.cd_stepcode.FormName = null;
-            this.cd_stepcode.Location = new System.Drawing.Point(712, 138);
-            this.cd_stepcode.Margin = new System.Windows.Forms.Padding(6);
+            this.cd_stepcode.Location = new System.Drawing.Point(356, 69);
             this.cd_stepcode.Name = "cd_stepcode";
             this.cd_stepcode.Power = "ifspecial";
             this.cd_stepcode.ReturnData = null;
             this.cd_stepcode.SelectField = null;
             this.cd_stepcode.SetValueField = null;
-            this.cd_stepcode.Size = new System.Drawing.Size(300, 44);
+            this.cd_stepcode.Size = new System.Drawing.Size(150, 22);
             this.cd_stepcode.TabIndex = 68;
             this.cd_stepcode.TableName = null;
             this.cd_stepcode.Tag = "";
@@ -453,10 +436,9 @@
             | System.Windows.Forms.AnchorStyles.Left)));
             this.ms_reworkcheckno.AutoSize = true;
             this.ms_reworkcheckno.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_reworkcheckno.Location = new System.Drawing.Point(1582, 116);
-            this.ms_reworkcheckno.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.ms_reworkcheckno.Location = new System.Drawing.Point(792, 58);
             this.ms_reworkcheckno.Name = "ms_reworkcheckno";
-            this.ms_reworkcheckno.Size = new System.Drawing.Size(146, 41);
+            this.ms_reworkcheckno.Size = new System.Drawing.Size(74, 21);
             this.ms_reworkcheckno.TabIndex = 129;
             this.ms_reworkcheckno.Text = "返修批号";
             this.ms_reworkcheckno.Visible = false;
@@ -467,10 +449,9 @@
             | System.Windows.Forms.AnchorStyles.Left)));
             this.ms_makecode_label.AutoSize = true;
             this.ms_makecode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_makecode_label.Location = new System.Drawing.Point(404, 52);
-            this.ms_makecode_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.ms_makecode_label.Location = new System.Drawing.Point(202, 26);
             this.ms_makecode_label.Name = "ms_makecode_label";
-            this.ms_makecode_label.Size = new System.Drawing.Size(114, 41);
+            this.ms_makecode_label.Size = new System.Drawing.Size(58, 21);
             this.ms_makecode_label.TabIndex = 37;
             this.ms_makecode_label.Text = "工单号";
             // 
@@ -480,10 +461,9 @@
             | System.Windows.Forms.AnchorStyles.Left)));
             this.ms_sncode_label.AutoSize = true;
             this.ms_sncode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_sncode_label.Location = new System.Drawing.Point(28, 50);
-            this.ms_sncode_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.ms_sncode_label.Location = new System.Drawing.Point(14, 26);
             this.ms_sncode_label.Name = "ms_sncode_label";
-            this.ms_sncode_label.Size = new System.Drawing.Size(114, 41);
+            this.ms_sncode_label.Size = new System.Drawing.Size(58, 21);
             this.ms_sncode_label.TabIndex = 38;
             this.ms_sncode_label.Text = "序列号";
             // 
@@ -493,10 +473,9 @@
             | System.Windows.Forms.AnchorStyles.Left)));
             this.ms_checkno.AutoSize = true;
             this.ms_checkno.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_checkno.Location = new System.Drawing.Point(1578, 52);
-            this.ms_checkno.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.ms_checkno.Location = new System.Drawing.Point(790, 26);
             this.ms_checkno.Name = "ms_checkno";
-            this.ms_checkno.Size = new System.Drawing.Size(146, 41);
+            this.ms_checkno.Size = new System.Drawing.Size(74, 21);
             this.ms_checkno.TabIndex = 128;
             this.ms_checkno.Text = "送检批号";
             this.ms_checkno.Visible = false;
@@ -509,13 +488,12 @@
             this.RepairComplete.Font = new System.Drawing.Font("微软雅黑", 9F);
             this.RepairComplete.Image = null;
             this.RepairComplete.IsShowBorder = true;
-            this.RepairComplete.Location = new System.Drawing.Point(1072, 132);
-            this.RepairComplete.Margin = new System.Windows.Forms.Padding(6);
+            this.RepairComplete.Location = new System.Drawing.Point(536, 66);
             this.RepairComplete.MoveImage = ((System.Drawing.Image)(resources.GetObject("RepairComplete.MoveImage")));
             this.RepairComplete.Name = "RepairComplete";
             this.RepairComplete.NormalImage = ((System.Drawing.Image)(resources.GetObject("RepairComplete.NormalImage")));
             this.RepairComplete.Power = null;
-            this.RepairComplete.Size = new System.Drawing.Size(136, 48);
+            this.RepairComplete.Size = new System.Drawing.Size(68, 24);
             this.RepairComplete.TabIndex = 55;
             this.RepairComplete.Tag = "IfRead";
             this.RepairComplete.Text = "完成维修";
@@ -529,11 +507,10 @@
             this.ms_sncode.AutoSize = true;
             this.ms_sncode.CutLength = null;
             this.ms_sncode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_sncode.Location = new System.Drawing.Point(178, 52);
-            this.ms_sncode.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
-            this.ms_sncode.MaximumSize = new System.Drawing.Size(300, 0);
+            this.ms_sncode.Location = new System.Drawing.Point(90, 26);
+            this.ms_sncode.MaximumSize = new System.Drawing.Size(150, 0);
             this.ms_sncode.Name = "ms_sncode";
-            this.ms_sncode.Size = new System.Drawing.Size(0, 41);
+            this.ms_sncode.Size = new System.Drawing.Size(0, 21);
             this.ms_sncode.TabIndex = 126;
             // 
             // Scrap
@@ -544,17 +521,17 @@
             this.Scrap.Font = new System.Drawing.Font("微软雅黑", 9F);
             this.Scrap.Image = null;
             this.Scrap.IsShowBorder = true;
-            this.Scrap.Location = new System.Drawing.Point(1262, 132);
-            this.Scrap.Margin = new System.Windows.Forms.Padding(6);
+            this.Scrap.Location = new System.Drawing.Point(805, 249);
             this.Scrap.MoveImage = ((System.Drawing.Image)(resources.GetObject("Scrap.MoveImage")));
             this.Scrap.Name = "Scrap";
             this.Scrap.NormalImage = ((System.Drawing.Image)(resources.GetObject("Scrap.NormalImage")));
             this.Scrap.Power = null;
-            this.Scrap.Size = new System.Drawing.Size(136, 48);
+            this.Scrap.Size = new System.Drawing.Size(68, 24);
             this.Scrap.TabIndex = 56;
             this.Scrap.Tag = "IfRead";
             this.Scrap.Text = "报废";
             this.Scrap.UseVisualStyleBackColor = true;
+            this.Scrap.Visible = false;
             this.Scrap.Click += new System.EventHandler(this.Scrap_Click);
             // 
             // nr_code
@@ -562,10 +539,9 @@
             this.nr_code.AutoSize = true;
             this.nr_code.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.nr_code.ForeColor = System.Drawing.Color.Black;
-            this.nr_code.Location = new System.Drawing.Point(1678, 442);
-            this.nr_code.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.nr_code.Location = new System.Drawing.Point(840, 222);
             this.nr_code.Name = "nr_code";
-            this.nr_code.Size = new System.Drawing.Size(0, 41);
+            this.nr_code.Size = new System.Drawing.Size(0, 21);
             this.nr_code.TabIndex = 125;
             // 
             // st_rstepcode_label
@@ -574,10 +550,9 @@
             | System.Windows.Forms.AnchorStyles.Left)));
             this.st_rstepcode_label.AutoSize = true;
             this.st_rstepcode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.st_rstepcode_label.Location = new System.Drawing.Point(528, 128);
-            this.st_rstepcode_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.st_rstepcode_label.Location = new System.Drawing.Point(264, 64);
             this.st_rstepcode_label.Name = "st_rstepcode_label";
-            this.st_rstepcode_label.Size = new System.Drawing.Size(146, 41);
+            this.st_rstepcode_label.Size = new System.Drawing.Size(74, 21);
             this.st_rstepcode_label.TabIndex = 65;
             this.st_rstepcode_label.Text = "回流工序";
             // 
@@ -587,10 +562,9 @@
             | System.Windows.Forms.AnchorStyles.Left)));
             this.ma_craftcode_label.AutoSize = true;
             this.ma_craftcode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_craftcode_label.Location = new System.Drawing.Point(28, 128);
-            this.ma_craftcode_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.ma_craftcode_label.Location = new System.Drawing.Point(14, 64);
             this.ma_craftcode_label.Name = "ma_craftcode_label";
-            this.ma_craftcode_label.Size = new System.Drawing.Size(146, 41);
+            this.ma_craftcode_label.Size = new System.Drawing.Size(74, 21);
             this.ma_craftcode_label.TabIndex = 66;
             this.ma_craftcode_label.Text = "回流途程";
             // 
@@ -602,14 +576,13 @@
             this.cr_code.DBTitle = "回流途程";
             this.cr_code.Font = new System.Drawing.Font("微软雅黑", 9F);
             this.cr_code.FormName = null;
-            this.cr_code.Location = new System.Drawing.Point(182, 138);
-            this.cr_code.Margin = new System.Windows.Forms.Padding(6);
+            this.cr_code.Location = new System.Drawing.Point(91, 69);
             this.cr_code.Name = "cr_code";
             this.cr_code.Power = "ifspecial";
             this.cr_code.ReturnData = null;
             this.cr_code.SelectField = null;
             this.cr_code.SetValueField = null;
-            this.cr_code.Size = new System.Drawing.Size(300, 46);
+            this.cr_code.Size = new System.Drawing.Size(150, 23);
             this.cr_code.TabIndex = 67;
             this.cr_code.TableName = null;
             this.cr_code.Tag = "ma_craftcode";
@@ -622,10 +595,9 @@
             | System.Windows.Forms.AnchorStyles.Left)));
             this.pr_detail_label.AutoSize = true;
             this.pr_detail_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_detail_label.Location = new System.Drawing.Point(1272, 52);
-            this.pr_detail_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.pr_detail_label.Location = new System.Drawing.Point(636, 26);
             this.pr_detail_label.Name = "pr_detail_label";
-            this.pr_detail_label.Size = new System.Drawing.Size(146, 41);
+            this.pr_detail_label.Size = new System.Drawing.Size(74, 21);
             this.pr_detail_label.TabIndex = 61;
             this.pr_detail_label.Text = "产品名称";
             // 
@@ -635,10 +607,9 @@
             | System.Windows.Forms.AnchorStyles.Left)));
             this.ms_prodcode_label.AutoSize = true;
             this.ms_prodcode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_prodcode_label.Location = new System.Drawing.Point(814, 52);
-            this.ms_prodcode_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.ms_prodcode_label.Location = new System.Drawing.Point(408, 26);
             this.ms_prodcode_label.Name = "ms_prodcode_label";
-            this.ms_prodcode_label.Size = new System.Drawing.Size(146, 41);
+            this.ms_prodcode_label.Size = new System.Drawing.Size(74, 21);
             this.ms_prodcode_label.TabIndex = 62;
             this.ms_prodcode_label.Text = "产品编号";
             // 
@@ -649,11 +620,10 @@
             this.pr_detail.AutoSize = true;
             this.pr_detail.CutLength = null;
             this.pr_detail.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_detail.Location = new System.Drawing.Point(1464, 52);
-            this.pr_detail.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
-            this.pr_detail.MaximumSize = new System.Drawing.Size(300, 0);
+            this.pr_detail.Location = new System.Drawing.Point(732, 26);
+            this.pr_detail.MaximumSize = new System.Drawing.Size(150, 0);
             this.pr_detail.Name = "pr_detail";
-            this.pr_detail.Size = new System.Drawing.Size(0, 41);
+            this.pr_detail.Size = new System.Drawing.Size(0, 21);
             this.pr_detail.TabIndex = 82;
             // 
             // ms_prodcode
@@ -663,11 +633,10 @@
             this.ms_prodcode.AutoSize = true;
             this.ms_prodcode.CutLength = null;
             this.ms_prodcode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_prodcode.Location = new System.Drawing.Point(1006, 52);
-            this.ms_prodcode.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
-            this.ms_prodcode.MaximumSize = new System.Drawing.Size(300, 0);
+            this.ms_prodcode.Location = new System.Drawing.Point(504, 26);
+            this.ms_prodcode.MaximumSize = new System.Drawing.Size(150, 0);
             this.ms_prodcode.Name = "ms_prodcode";
-            this.ms_prodcode.Size = new System.Drawing.Size(0, 41);
+            this.ms_prodcode.Size = new System.Drawing.Size(0, 21);
             this.ms_prodcode.TabIndex = 20;
             this.ms_prodcode.TextChanged += new System.EventHandler(this.ms_prodcode_TextChanged);
             // 
@@ -678,19 +647,18 @@
             this.ms_makecode.AutoSize = true;
             this.ms_makecode.CutLength = null;
             this.ms_makecode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_makecode.Location = new System.Drawing.Point(564, 52);
-            this.ms_makecode.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
-            this.ms_makecode.MaximumSize = new System.Drawing.Size(300, 0);
+            this.ms_makecode.Location = new System.Drawing.Point(282, 26);
+            this.ms_makecode.MaximumSize = new System.Drawing.Size(150, 0);
             this.ms_makecode.Name = "ms_makecode";
-            this.ms_makecode.Size = new System.Drawing.Size(0, 41);
+            this.ms_makecode.Size = new System.Drawing.Size(0, 21);
             this.ms_makecode.TabIndex = 85;
             // 
             // mb_badremark
             // 
-            this.mb_badremark.Location = new System.Drawing.Point(1466, 286);
-            this.mb_badremark.Margin = new System.Windows.Forms.Padding(8);
+            this.mb_badremark.Location = new System.Drawing.Point(733, 143);
+            this.mb_badremark.Margin = new System.Windows.Forms.Padding(4);
             this.mb_badremark.Name = "mb_badremark";
-            this.mb_badremark.Size = new System.Drawing.Size(280, 42);
+            this.mb_badremark.Size = new System.Drawing.Size(140, 21);
             this.mb_badremark.TabIndex = 127;
             this.mb_badremark.TextAreaEnable = true;
             this.mb_badremark.TextBoxEnable = true;
@@ -702,14 +670,14 @@
             this.bd_soncode.Condition = null;
             this.bd_soncode.DBTitle = null;
             this.bd_soncode.FormName = null;
-            this.bd_soncode.Location = new System.Drawing.Point(1056, 576);
-            this.bd_soncode.Margin = new System.Windows.Forms.Padding(4);
+            this.bd_soncode.Location = new System.Drawing.Point(528, 288);
+            this.bd_soncode.Margin = new System.Windows.Forms.Padding(2);
             this.bd_soncode.Name = "bd_soncode";
             this.bd_soncode.Power = null;
             this.bd_soncode.ReturnData = null;
             this.bd_soncode.SelectField = null;
             this.bd_soncode.SetValueField = null;
-            this.bd_soncode.Size = new System.Drawing.Size(274, 42);
+            this.bd_soncode.Size = new System.Drawing.Size(137, 21);
             this.bd_soncode.TabIndex = 124;
             this.bd_soncode.TableName = null;
             this.bd_soncode.Tag = "bd_soncode";
@@ -723,11 +691,11 @@
             this.mbp_part1,
             this.DeleteCom,
             this.mbp_id});
-            this.mbp_partdgv.Location = new System.Drawing.Point(916, 650);
-            this.mbp_partdgv.Margin = new System.Windows.Forms.Padding(4);
+            this.mbp_partdgv.Location = new System.Drawing.Point(458, 325);
+            this.mbp_partdgv.Margin = new System.Windows.Forms.Padding(2);
             this.mbp_partdgv.Name = "mbp_partdgv";
             this.mbp_partdgv.RowTemplate.Height = 27;
-            this.mbp_partdgv.Size = new System.Drawing.Size(524, 304);
+            this.mbp_partdgv.Size = new System.Drawing.Size(262, 152);
             this.mbp_partdgv.TabIndex = 121;
             this.mbp_partdgv.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.mbp_partdgv_CellContentClick);
             // 
@@ -764,11 +732,11 @@
             this.mbl_loc1,
             this.DeletePos,
             this.mbl_id});
-            this.mbl_locdgv.Location = new System.Drawing.Point(332, 650);
-            this.mbl_locdgv.Margin = new System.Windows.Forms.Padding(4);
+            this.mbl_locdgv.Location = new System.Drawing.Point(166, 325);
+            this.mbl_locdgv.Margin = new System.Windows.Forms.Padding(2);
             this.mbl_locdgv.Name = "mbl_locdgv";
             this.mbl_locdgv.RowTemplate.Height = 27;
-            this.mbl_locdgv.Size = new System.Drawing.Size(524, 304);
+            this.mbl_locdgv.Size = new System.Drawing.Size(262, 152);
             this.mbl_locdgv.TabIndex = 120;
             this.mbl_locdgv.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.mbl_locdgv_CellContentClick);
             // 
@@ -800,11 +768,11 @@
             this.RefreshTreeView.AllPower = null;
             this.RefreshTreeView.Cursor = System.Windows.Forms.Cursors.Hand;
             this.RefreshTreeView.Image = global::UAS_MES_NEW.Properties.Resources.refresh;
-            this.RefreshTreeView.Location = new System.Drawing.Point(170, 236);
-            this.RefreshTreeView.Margin = new System.Windows.Forms.Padding(4);
+            this.RefreshTreeView.Location = new System.Drawing.Point(85, 118);
+            this.RefreshTreeView.Margin = new System.Windows.Forms.Padding(2);
             this.RefreshTreeView.Name = "RefreshTreeView";
             this.RefreshTreeView.Power = null;
-            this.RefreshTreeView.Size = new System.Drawing.Size(40, 40);
+            this.RefreshTreeView.Size = new System.Drawing.Size(20, 20);
             this.RefreshTreeView.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
             this.RefreshTreeView.TabIndex = 119;
             this.RefreshTreeView.TabStop = false;
@@ -817,11 +785,10 @@
             | System.Windows.Forms.AnchorStyles.Left)));
             this.GetSNCode.BackColor = System.Drawing.Color.White;
             this.GetSNCode.ID = null;
-            this.GetSNCode.Location = new System.Drawing.Point(488, 1068);
-            this.GetSNCode.Margin = new System.Windows.Forms.Padding(6);
+            this.GetSNCode.Location = new System.Drawing.Point(244, 534);
             this.GetSNCode.Name = "GetSNCode";
             this.GetSNCode.Power = null;
-            this.GetSNCode.Size = new System.Drawing.Size(372, 35);
+            this.GetSNCode.Size = new System.Drawing.Size(188, 21);
             this.GetSNCode.Str = null;
             this.GetSNCode.Str1 = null;
             this.GetSNCode.Str2 = null;
@@ -836,13 +803,12 @@
             this.NewRepairInf.DownImage = ((System.Drawing.Image)(resources.GetObject("NewRepairInf.DownImage")));
             this.NewRepairInf.Image = null;
             this.NewRepairInf.IsShowBorder = true;
-            this.NewRepairInf.Location = new System.Drawing.Point(584, 986);
-            this.NewRepairInf.Margin = new System.Windows.Forms.Padding(6);
+            this.NewRepairInf.Location = new System.Drawing.Point(277, 493);
             this.NewRepairInf.MoveImage = ((System.Drawing.Image)(resources.GetObject("NewRepairInf.MoveImage")));
             this.NewRepairInf.Name = "NewRepairInf";
             this.NewRepairInf.NormalImage = ((System.Drawing.Image)(resources.GetObject("NewRepairInf.NormalImage")));
             this.NewRepairInf.Power = null;
-            this.NewRepairInf.Size = new System.Drawing.Size(172, 48);
+            this.NewRepairInf.Size = new System.Drawing.Size(86, 24);
             this.NewRepairInf.TabIndex = 112;
             this.NewRepairInf.Tag = "IfRead";
             this.NewRepairInf.Text = "新增维修信息";
@@ -856,13 +822,12 @@
             this.SaveRepairInf.DownImage = ((System.Drawing.Image)(resources.GetObject("SaveRepairInf.DownImage")));
             this.SaveRepairInf.Image = null;
             this.SaveRepairInf.IsShowBorder = true;
-            this.SaveRepairInf.Location = new System.Drawing.Point(1312, 454);
-            this.SaveRepairInf.Margin = new System.Windows.Forms.Padding(6);
+            this.SaveRepairInf.Location = new System.Drawing.Point(656, 227);
             this.SaveRepairInf.MoveImage = ((System.Drawing.Image)(resources.GetObject("SaveRepairInf.MoveImage")));
             this.SaveRepairInf.Name = "SaveRepairInf";
             this.SaveRepairInf.NormalImage = ((System.Drawing.Image)(resources.GetObject("SaveRepairInf.NormalImage")));
             this.SaveRepairInf.Power = null;
-            this.SaveRepairInf.Size = new System.Drawing.Size(172, 48);
+            this.SaveRepairInf.Size = new System.Drawing.Size(86, 24);
             this.SaveRepairInf.TabIndex = 111;
             this.SaveRepairInf.Tag = "IfRead";
             this.SaveRepairInf.Text = "保存维修信息";
@@ -876,16 +841,15 @@
             this.DeleteRepairInf.DownImage = ((System.Drawing.Image)(resources.GetObject("DeleteRepairInf.DownImage")));
             this.DeleteRepairInf.Image = null;
             this.DeleteRepairInf.IsShowBorder = true;
-            this.DeleteRepairInf.Location = new System.Drawing.Point(842, 986);
-            this.DeleteRepairInf.Margin = new System.Windows.Forms.Padding(6);
+            this.DeleteRepairInf.Location = new System.Drawing.Point(502, 493);
             this.DeleteRepairInf.MoveImage = ((System.Drawing.Image)(resources.GetObject("DeleteRepairInf.MoveImage")));
             this.DeleteRepairInf.Name = "DeleteRepairInf";
             this.DeleteRepairInf.NormalImage = ((System.Drawing.Image)(resources.GetObject("DeleteRepairInf.NormalImage")));
             this.DeleteRepairInf.Power = null;
-            this.DeleteRepairInf.Size = new System.Drawing.Size(114, 48);
+            this.DeleteRepairInf.Size = new System.Drawing.Size(111, 24);
             this.DeleteRepairInf.TabIndex = 110;
             this.DeleteRepairInf.Tag = "IfRead";
-            this.DeleteRepairInf.Text = "删除";
+            this.DeleteRepairInf.Text = "删除不良原因";
             this.DeleteRepairInf.UseVisualStyleBackColor = true;
             this.DeleteRepairInf.Click += new System.EventHandler(this.DeleteRepairInf_Click);
             // 
@@ -896,11 +860,10 @@
             | System.Windows.Forms.AnchorStyles.Left)));
             this.mbl_loc.BackColor = System.Drawing.Color.White;
             this.mbl_loc.ID = null;
-            this.mbl_loc.Location = new System.Drawing.Point(524, 578);
-            this.mbl_loc.Margin = new System.Windows.Forms.Padding(6);
+            this.mbl_loc.Location = new System.Drawing.Point(262, 289);
             this.mbl_loc.Name = "mbl_loc";
             this.mbl_loc.Power = null;
-            this.mbl_loc.Size = new System.Drawing.Size(240, 35);
+            this.mbl_loc.Size = new System.Drawing.Size(122, 21);
             this.mbl_loc.Str = null;
             this.mbl_loc.Str1 = null;
             this.mbl_loc.Str2 = null;
@@ -916,11 +879,10 @@
             this.bc_name.BackColor = System.Drawing.Color.White;
             this.bc_name.Enabled = false;
             this.bc_name.ID = null;
-            this.bc_name.Location = new System.Drawing.Point(1004, 286);
-            this.bc_name.Margin = new System.Windows.Forms.Padding(6);
+            this.bc_name.Location = new System.Drawing.Point(502, 143);
             this.bc_name.Name = "bc_name";
             this.bc_name.Power = null;
-            this.bc_name.Size = new System.Drawing.Size(238, 35);
+            this.bc_name.Size = new System.Drawing.Size(121, 21);
             this.bc_name.Str = null;
             this.bc_name.Str1 = null;
             this.bc_name.Str2 = null;
@@ -936,11 +898,10 @@
             this.bg_name.Enabled = false;
             this.bg_name.ForeColor = System.Drawing.Color.Red;
             this.bg_name.ID = null;
-            this.bg_name.Location = new System.Drawing.Point(524, 288);
-            this.bg_name.Margin = new System.Windows.Forms.Padding(6);
+            this.bg_name.Location = new System.Drawing.Point(262, 144);
             this.bg_name.Name = "bg_name";
             this.bg_name.Power = null;
-            this.bg_name.Size = new System.Drawing.Size(238, 35);
+            this.bg_name.Size = new System.Drawing.Size(121, 21);
             this.bg_name.Str = null;
             this.bg_name.Str1 = null;
             this.bg_name.Str2 = null;
@@ -950,10 +911,9 @@
             // OperatResult
             // 
             this.OperatResult.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.OperatResult.Location = new System.Drawing.Point(1466, 574);
-            this.OperatResult.Margin = new System.Windows.Forms.Padding(6);
+            this.OperatResult.Location = new System.Drawing.Point(733, 287);
             this.OperatResult.Name = "OperatResult";
-            this.OperatResult.Size = new System.Drawing.Size(310, 496);
+            this.OperatResult.Size = new System.Drawing.Size(157, 250);
             this.OperatResult.TabIndex = 87;
             this.OperatResult.Text = "";
             // 
@@ -964,13 +924,12 @@
             this.Clean.DownImage = ((System.Drawing.Image)(resources.GetObject("Clean.DownImage")));
             this.Clean.Image = null;
             this.Clean.IsShowBorder = true;
-            this.Clean.Location = new System.Drawing.Point(1564, 1084);
-            this.Clean.Margin = new System.Windows.Forms.Padding(6);
+            this.Clean.Location = new System.Drawing.Point(782, 542);
             this.Clean.MoveImage = ((System.Drawing.Image)(resources.GetObject("Clean.MoveImage")));
             this.Clean.Name = "Clean";
             this.Clean.NormalImage = ((System.Drawing.Image)(resources.GetObject("Clean.NormalImage")));
             this.Clean.Power = null;
-            this.Clean.Size = new System.Drawing.Size(120, 48);
+            this.Clean.Size = new System.Drawing.Size(60, 24);
             this.Clean.TabIndex = 81;
             this.Clean.Tag = "IfRead";
             this.Clean.Text = "清除";
@@ -984,13 +943,12 @@
             this.NewBadCode.DownImage = ((System.Drawing.Image)(resources.GetObject("NewBadCode.DownImage")));
             this.NewBadCode.Image = null;
             this.NewBadCode.IsShowBorder = true;
-            this.NewBadCode.Location = new System.Drawing.Point(328, 986);
-            this.NewBadCode.Margin = new System.Windows.Forms.Padding(6);
+            this.NewBadCode.Location = new System.Drawing.Point(164, 493);
             this.NewBadCode.MoveImage = ((System.Drawing.Image)(resources.GetObject("NewBadCode.MoveImage")));
             this.NewBadCode.Name = "NewBadCode";
             this.NewBadCode.NormalImage = ((System.Drawing.Image)(resources.GetObject("NewBadCode.NormalImage")));
             this.NewBadCode.Power = null;
-            this.NewBadCode.Size = new System.Drawing.Size(172, 48);
+            this.NewBadCode.Size = new System.Drawing.Size(86, 24);
             this.NewBadCode.TabIndex = 60;
             this.NewBadCode.Tag = "IfRead";
             this.NewBadCode.Text = "新增不良代码";
@@ -1005,30 +963,60 @@
             this.SaveBadLocation.Enabled = false;
             this.SaveBadLocation.Image = null;
             this.SaveBadLocation.IsShowBorder = true;
-            this.SaveBadLocation.Location = new System.Drawing.Point(770, 574);
-            this.SaveBadLocation.Margin = new System.Windows.Forms.Padding(6);
+            this.SaveBadLocation.Location = new System.Drawing.Point(385, 287);
             this.SaveBadLocation.MoveImage = ((System.Drawing.Image)(resources.GetObject("SaveBadLocation.MoveImage")));
             this.SaveBadLocation.Name = "SaveBadLocation";
             this.SaveBadLocation.NormalImage = ((System.Drawing.Image)(resources.GetObject("SaveBadLocation.NormalImage")));
             this.SaveBadLocation.Power = null;
-            this.SaveBadLocation.Size = new System.Drawing.Size(92, 48);
+            this.SaveBadLocation.Size = new System.Drawing.Size(46, 24);
             this.SaveBadLocation.TabIndex = 59;
             this.SaveBadLocation.Tag = "IfRead";
             this.SaveBadLocation.Text = "保存";
             this.SaveBadLocation.UseVisualStyleBackColor = true;
             this.SaveBadLocation.Click += new System.EventHandler(this.SaveBadLocation_Click);
             // 
+            // normalButton1
+            // 
+            this.normalButton1.AllPower = "ifall";
+            this.normalButton1.BackColor = System.Drawing.Color.Transparent;
+            this.normalButton1.DownImage = ((System.Drawing.Image)(resources.GetObject("normalButton1.DownImage")));
+            this.normalButton1.Image = null;
+            this.normalButton1.IsShowBorder = true;
+            this.normalButton1.Location = new System.Drawing.Point(369, 493);
+            this.normalButton1.MoveImage = ((System.Drawing.Image)(resources.GetObject("normalButton1.MoveImage")));
+            this.normalButton1.Name = "normalButton1";
+            this.normalButton1.NormalImage = ((System.Drawing.Image)(resources.GetObject("normalButton1.NormalImage")));
+            this.normalButton1.Power = null;
+            this.normalButton1.Size = new System.Drawing.Size(111, 24);
+            this.normalButton1.TabIndex = 140;
+            this.normalButton1.Tag = "IfRead";
+            this.normalButton1.Text = "删除不良现象";
+            this.normalButton1.UseVisualStyleBackColor = true;
+            this.normalButton1.Click += new System.EventHandler(this.normalButton1_Click);
+            // 
+            // checkBox1
+            // 
+            this.checkBox1.AutoSize = true;
+            this.checkBox1.Location = new System.Drawing.Point(612, 67);
+            this.checkBox1.Name = "checkBox1";
+            this.checkBox1.Size = new System.Drawing.Size(157, 25);
+            this.checkBox1.TabIndex = 130;
+            this.checkBox1.Text = "清空机器写入信息";
+            this.checkBox1.UseVisualStyleBackColor = true;
+            // 
             // Make_Repair
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(1800, 1158);
+            this.ClientSize = new System.Drawing.Size(900, 587);
+            this.Controls.Add(this.normalButton1);
             this.Controls.Add(this.mbc_component);
             this.Controls.Add(this.mbr_dutycode);
             this.Controls.Add(this.so_code);
             this.Controls.Add(this.nrg_code);
             this.Controls.Add(this.mbr_dutyname);
             this.Controls.Add(this.so_name);
+            this.Controls.Add(this.Scrap);
             this.Controls.Add(this.nr_name);
             this.Controls.Add(this.nrg_name);
             this.Controls.Add(this.groupBoxWithBorder1);
@@ -1064,7 +1052,6 @@
             this.Controls.Add(this.bc_name_label);
             this.Controls.Add(this.bg_name_label);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
-            this.Margin = new System.Windows.Forms.Padding(6);
             this.Name = "Make_Repair";
             this.Tag = "Make!Repair";
             this.Text = "维修作业";
@@ -1073,12 +1060,12 @@
             this.SizeChanged += new System.EventHandler(this.Make_Repair_SizeChanged);
             ((System.ComponentModel.ISupportInitialize)(this.LocationSource)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.ComponentSource)).EndInit();
-            this.groupBoxWithBorder1.ResumeLayout(true);
+            this.groupBoxWithBorder1.ResumeLayout(false);
             this.groupBoxWithBorder1.PerformLayout();
             ((System.ComponentModel.ISupportInitialize)(this.mbp_partdgv)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.mbl_locdgv)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.RefreshTreeView)).EndInit();
-            this.ResumeLayout(true);
+            this.ResumeLayout(false);
             this.PerformLayout();
 
         }
@@ -1149,5 +1136,7 @@
         private System.Windows.Forms.Label so_code;
         private System.Windows.Forms.Label mbr_dutycode;
         private CustomControl.ComBoxWithFocus.ComBoxWithFocus mbc_component;
+        private CustomControl.ButtonUtil.NormalButton normalButton1;
+        private System.Windows.Forms.CheckBox checkBox1;
     }
 }

+ 32 - 1
UAS_MES_LT/FunctionCode/Make/Make_Repair.cs

@@ -594,7 +594,11 @@ 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 mbc_sncode='" + ms_sncode.Text + "'");
+                    if (checkBox1.Checked)
+                    {
+                        SQLS.Add("update makeserial set ms_key='',ms_keyid='',MS_HARDWREID='',MS_KEYSTATEID='',MS_BIOS='',ms_ec='',ms_uuid='',MS_KEYPARTNUMBER='',ms_bt='',ms_mac='',ms_imei='' where ms_sncode = '"+ ms_sncode.Text + "' and ms_makecode = '"+ms_makecode.Text+"'" );
+                    }
+                    //SQLS.Add("update MakeBadCount set mbc_status=-1 where mbc_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);
@@ -1017,5 +1021,32 @@ namespace UAS_MES_NEW.Make
                 SaveRepairInf.Enabled = false;
             }
         }
+
+        private void normalButton1_Click(object sender, EventArgs e)
+        {
+            DataTable dt = (DataTable)dh.ExecuteSql("select ms_makecode from makeserial where ms_id='" + msid + "' and ms_sncode='" + GetSNCode.Text + "' and ms_status=3", "select");
+            if (dt.Rows.Count > 0)
+            {
+                if (mb_id != "")
+                {
+
+                    string delete1 = "delete from makebadrsloc where mbl_mbrid in (select mbr_id from makebadreason where mbr_mbid = '" + mb_id + "' )";
+                    string delete2 = "delete from makebadrspart where mbp_mbrid in (select mbr_id from makebadreason where mbr_mbid = '" + mb_id + "' )";
+                    string delete3 = "delete from makebadrscom where mbc_mbrid in (select mbr_id from makebadreason where mbr_mbid = '" + mb_id + "' )";
+                    string delete4 = "delete from makebadreason where mbr_mbid='" + mb_id + "'";
+                    string delete = "delete from makebad where mb_id = '" + mb_id + "'";
+                    dh.ExecuteSQLTran(delete1, delete2, delete3, delete4, delete);
+                    OperatResult.AppendText(">>删除成功\n", Color.Green);
+                    BaseUtil.CleanControlsText(bc_name, bc_code, bg_name, bg_code, mb_badremark, nrg_name, nrg_code, nr_name, nr_code, so_name, so_code, mbr_dutyname, mbr_dutycode, mbc_component);
+                    mbp_partdgv.DataSource = null;
+                    mbl_locdgv.DataSource = null;
+                    mb_id = "";
+                    //删除后重新加载Tree的信息
+                    LoadBadInfTree(sender, e);
+                }
+                else OperatResult.AppendText(">>必须选择不良现象\n", Color.Red);
+            }
+            else OperatResult.AppendText(">>" + GetSNCode.Text + "序列号错误,不存在或者不处于维修状态\n", Color.Red);
+        }
     }
 }

+ 50 - 0
UAS_MES_LT/FunctionCode/Make/Make_Repair.resx

@@ -206,6 +206,18 @@
   <metadata name="DeleteCom.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
+  <metadata name="mbp_part1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="DeleteCom.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="mbl_loc1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="DeletePos.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
   <metadata name="mbl_loc1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
@@ -438,6 +450,44 @@
         2azB52i13asPDvCgTCZjHGt5sdmqDw7woHQ6bRzX8ny1UR8c4EHJZNJc5fC7XKsPDvCgRCLR2x9Pzt9q
         zT+Lpdqw/3A6W/HoUywWa32Nx8OL4zwffM8X6sJu7IcDPCgajaak7udoNNjsdgc81BZ2Yz8c4PH8cR2J
         ROJSU3qXjMKwG/vjzEz/skOI3Zqgv7AAAAAASUVORK5CYII=
+</value>
+  </data>
+  <data name="normalButton1.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="normalButton1.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="normalButton1.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>
   <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">

+ 1 - 1
UAS_MES_LT/FunctionCode/Make/Make_SeqTransformPrint.cs

@@ -1,5 +1,5 @@
 using LabelManager2;
-using Seagull.BarTender.Print;
+//using Seagull.BarTender.Print;
 using System;
 using System.Data;
 using System.Drawing;

+ 1 - 0
UAS_MES_LT/FunctionCode/Make/Make_TestCollection.Designer.cs

@@ -888,6 +888,7 @@ namespace UAS_MES_NEW.Make
             this.normalButton1.TabIndex = 197;
             this.normalButton1.Text = "打印不良";
             this.normalButton1.UseVisualStyleBackColor = false;
+            this.normalButton1.Visible = false;
             this.normalButton1.Click += new System.EventHandler(this.normalButton1_Click);
             // 
             // PrintList

+ 47 - 47
UAS_MES_LT/FunctionCode/Make/Make_TestCollection.cs

@@ -55,7 +55,7 @@ namespace UAS_MES_NEW.Make
 
         ApplicationClass lbl;
         Thread thread;
-        Document doc;
+       // Document doc;
 
         public Make_TestCollection()
         {
@@ -75,10 +75,10 @@ namespace UAS_MES_NEW.Make
 
             labelname = System.Windows.Forms.Application.StartupPath + @"\badsn.lab";
 
-            thread = new Thread(NewPrint);
-            SetLoadingWindow stw = new SetLoadingWindow(thread, "初始化打印程序");
-            BaseUtil.SetFormCenter(stw);
-            stw.ShowDialog();
+            //thread = new Thread(NewPrint);
+           // SetLoadingWindow stw = new SetLoadingWindow(thread, "初始化打印程序");
+            //BaseUtil.SetFormCenter(stw);
+           // stw.ShowDialog();
 
             //工单号放大镜配置
             ma_code.TableName = "make left join product on ma_prodcode=pr_code";
@@ -544,7 +544,7 @@ namespace UAS_MES_NEW.Make
                 }
                 //不良信息采集,mb_status<>0的是之前维修保存的,不能删除
                 dh.ExecuteSql("delete from makebad where mb_sncode='" + ms_sncode.Text + "' and mb_makecode='" + ma_code.Text + "' and nvl(mb_status,0)=0", "delete");
-                normalButton1_Click(this, e);
+                //normalButton1_Click(this, e);
                 if (LogicHandler.SetTestNGDetail(ms_sncode.Text, ma_code.Text, User.UserCode, User.UserSourceCode, "检查未通过", bgcode, bccode, bgname, bcname, bcremark, out ErrorMessage))
                 {
                     //存在的不良代码和
@@ -837,47 +837,47 @@ namespace UAS_MES_NEW.Make
 
         private void normalButton1_Click(object sender, EventArgs e)
         {
-            if (ChoosedRejectList.Items.Count == 0 || ms_sncode.Text == "")
-            {
-                MessageBox.Show("未录入不良或SN为空");
-            }
-
-            string BADINFO = "";
-
-            for (int i = 0; i < ChoosedRejectList.Items.Count; i++)
-            {
-                BADINFO = BADINFO + ChoosedRejectList.Items[i].ListView.Items[i].SubItems[3].Text + "    ";
-            }
-            BADINFO = BADINFO.Substring(0, BADINFO.Length - 1);
-            FileInfo PrintFile = new FileInfo(labelname);
-            if (!PrintFile.Exists)
-            {
-                MessageBox.Show("打印文件不存在");
-                return ;
-            }
-            doc = lbl.Documents.Open(labelname, true);
-            if (doc == null)
-            {
-                MessageBox.Show("标签文件打开失败");
-                return ;
-            }
-            for (int j = 1; j < doc.Variables.FormVariables.Count+1; j++)
-            {
-                switch (doc.Variables.FormVariables.Item(j).Name)
-                {
-                    case "SN":
-                        doc.Variables.FormVariables.Item(j).Value = ms_sncode.Text;
-                        break;
-                    case "BAD":
-                        doc.Variables.FormVariables.Item(j).Value = BADINFO;
-                        break;
-                }
-                //  doc.Variables.FormVariables.Item(1).Value = (Prefix.Text + Date.Value.ToString("yyMMdd") + lpad(4, (i).ToString()));
-
-            }
-            //保存本次赋值进行打印
-            doc.Printer.SwitchTo(PrintList.Text);
-            doc.PrintDocument(1);
+            //if (ChoosedRejectList.Items.Count == 0 || ms_sncode.Text == "")
+            //{
+            //    MessageBox.Show("未录入不良或SN为空");
+            //}
+
+            //string BADINFO = "";
+
+            //for (int i = 0; i < ChoosedRejectList.Items.Count; i++)
+            //{
+            //    BADINFO = BADINFO + ChoosedRejectList.Items[i].ListView.Items[i].SubItems[3].Text + "    ";
+            //}
+            //BADINFO = BADINFO.Substring(0, BADINFO.Length - 1);
+            //FileInfo PrintFile = new FileInfo(labelname);
+            //if (!PrintFile.Exists)
+            //{
+            //    MessageBox.Show("打印文件不存在");
+            //    return ;
+            //}
+            //doc = lbl.Documents.Open(labelname, true);
+            //if (doc == null)
+            //{
+            //    MessageBox.Show("标签文件打开失败");
+            //    return ;
+            //}
+            //for (int j = 1; j < doc.Variables.FormVariables.Count+1; j++)
+            //{
+            //    switch (doc.Variables.FormVariables.Item(j).Name)
+            //    {
+            //        case "SN":
+            //            doc.Variables.FormVariables.Item(j).Value = ms_sncode.Text;
+            //            break;
+            //        case "BAD":
+            //            doc.Variables.FormVariables.Item(j).Value = BADINFO;
+            //            break;
+            //    }
+            //    //  doc.Variables.FormVariables.Item(1).Value = (Prefix.Text + Date.Value.ToString("yyMMdd") + lpad(4, (i).ToString()));
+
+            //}
+            ////保存本次赋值进行打印
+            //doc.Printer.SwitchTo(PrintList.Text);
+            //doc.PrintDocument(1);
 
 
 

+ 3 - 1
UAS_MES_LT/FunctionCode/Make/Make_TestCollectionBad.Designer.cs

@@ -115,7 +115,7 @@ namespace UAS_MES_NEW.Make
             this.bc_remark_label.Name = "bc_remark_label";
             this.bc_remark_label.Size = new System.Drawing.Size(74, 21);
             this.bc_remark_label.TabIndex = 25;
-            this.bc_remark_label.Text = "不良备注";
+            this.bc_remark_label.Text = "首件备注";
             // 
             // ms_sncode_label
             // 
@@ -319,6 +319,7 @@ namespace UAS_MES_NEW.Make
             this.AutoBadCode.TabIndex = 69;
             this.AutoBadCode.Text = "恢复出厂设置";
             this.AutoBadCode.UseVisualStyleBackColor = true;
+            this.AutoBadCode.Visible = false;
             // 
             // ma_qty_label
             // 
@@ -889,6 +890,7 @@ namespace UAS_MES_NEW.Make
             this.normalButton1.TabIndex = 197;
             this.normalButton1.Text = "打印不良";
             this.normalButton1.UseVisualStyleBackColor = false;
+            this.normalButton1.Visible = false;
             this.normalButton1.Click += new System.EventHandler(this.normalButton1_Click);
             // 
             // PrintList

+ 18 - 18
UAS_MES_LT/FunctionCode/Make/Make_TestCollectionBad.cs

@@ -75,10 +75,10 @@ namespace UAS_MES_NEW.Make
 
             labelname = System.Windows.Forms.Application.StartupPath + @"\badsn.lab";
 
-            thread = new Thread(NewPrint);
-            SetLoadingWindow stw = new SetLoadingWindow(thread, "初始化打印程序");
-            BaseUtil.SetFormCenter(stw);
-            stw.ShowDialog();
+           // thread = new Thread(NewPrint);
+            //SetLoadingWindow stw = new SetLoadingWindow(thread, "初始化打印程序");
+           // BaseUtil.SetFormCenter(stw);
+            //stw.ShowDialog();
 
             //工单号放大镜配置
             ma_code.TableName = "make left join product on ma_prodcode=pr_code";
@@ -375,18 +375,18 @@ namespace UAS_MES_NEW.Make
                     {
                         if (AutoBadCode.Checked)
                         {
-                            string str = BaseUtil.GetDataFromDevice("DEVICES");
-                            str = str.Replace("LIST OF DEVICES ATTACHED", "").Replace("\n", "");
-                            if (!(str.Length == 0))
-                            {
-                                Console.WriteLine("有链接");
-                                BaseUtil.GetDataFromDevice("RESET");
-                            }
-                            else
-                            {
-                                OperateResult.AppendText(">>无设备链接,无法恢复出厂设置,采集失败\n", Color.Red, ms_sncode);
-                                return;
-                            }
+                            //string str = BaseUtil.GetDataFromDevice("DEVICES");
+                            //str = str.Replace("LIST OF DEVICES ATTACHED", "").Replace("\n", "");
+                            //if (!(str.Length == 0))
+                            //{
+                            //    Console.WriteLine("有链接");
+                            //    BaseUtil.GetDataFromDevice("RESET");
+                            //}
+                            //else
+                            //{
+                            //    OperateResult.AppendText(">>无设备链接,无法恢复出厂设置,采集失败\n", Color.Red, ms_sncode);
+                            //    return;
+                            //}
                         }
                         //良品信息采集
                         if (LogicHandler.SetStepResult(ma_code.Text, User.UserSourceCode, ms_sncode.Text, "良品采集", "检测合格", User.UserCode, out ErrorMessage))
@@ -516,7 +516,7 @@ namespace UAS_MES_NEW.Make
                         //获取不良名称
                         bcname[i] = ChoosedRejectList.Items[i].SubItems[3].Text;
                         //获取所有的不良备注
-                        bcremark[i] = bc_remark.Text;
+                       // bcremark[i] = bc_remark.Text;
                     }
                 }
                 dh.ExecuteSql("delete from MAKESNRELATION where sn = '" + ms_sncode.Text + "'", "delete");
@@ -749,7 +749,7 @@ namespace UAS_MES_NEW.Make
 
         private void Make_TestCollection_FormClosing(object sender, FormClosingEventArgs e)
         {
-            BaseUtil.ClosePrint(lbl);
+          //  BaseUtil.ClosePrint(lbl);
             //if (engine != null)
             //    engine.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges);
             dh.Dispose();

+ 30 - 15
UAS_MES_LT/FunctionCode/Packing/Packing_PackageCollection.cs

@@ -10,7 +10,7 @@ using System.Threading;
 using UAS_MES_NEW.PublicForm;
 using System.Collections.Generic;
 using System.Diagnostics;
-using Seagull.BarTender.Print;
+//using Seagull.BarTender.Print;
 
 namespace UAS_MES_NEW.Packing
 {
@@ -21,7 +21,7 @@ namespace UAS_MES_NEW.Packing
         LogStringBuilder sql = new LogStringBuilder();
         AutoSizeFormClass asc = new AutoSizeFormClass();
         ApplicationClass lbl;
-        Engine engine;
+        BarTender.Application engine;
         Thread thread;
 
         DataTable Dbfind;
@@ -48,7 +48,7 @@ namespace UAS_MES_NEW.Packing
         {
             try
             {
-                engine = new Engine();
+                engine = new BarTender.Application();
                 //lbl = new ApplicationClass();
                 //BaseUtil.WriteLbl();
             }
@@ -161,7 +161,7 @@ namespace UAS_MES_NEW.Packing
                     dh.ExecuteSql("update package set pa_printcount=pa_printcount+1 where pa_outboxcode='" + pa_outboxcode.Text + "'", "update");
                     for (int i = 0; i < _dt.Rows.Count; i++)
                     {
-                        if (Print.BarTender(Tag.ToString(), ref engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrintList.Text, pa_outboxcode.Text, int.Parse(PrintNum.Text), oMakeCode == "" ? pa_makecode.Text : oMakeCode, pr_code.Text, "卡通箱标", "0", out ErrorMessage))
+                        if (Print.SinglePrint(Tag.ToString(),  engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrintList.Text, pa_outboxcode.Text, int.Parse(PrintNum.Text), oMakeCode == "" ? pa_makecode.Text : oMakeCode, pr_code.Text, "卡通箱标", "0", out ErrorMessage))
                         {
                             OperateResult.AppendText(">>开始打印箱号" + pa_outboxcode.Text + "\n", Color.Black);
                         }
@@ -195,10 +195,10 @@ namespace UAS_MES_NEW.Packing
             {
                 LoadData();
                 LoadGridData();
-                if (CheckOutBoxLength())
-                {
+              //  if (CheckOutBoxLength())
+               // {
                     sn_code.Focus();
-                }
+               // }
             }
             //}
             //catch (Exception ex)
@@ -250,7 +250,7 @@ namespace UAS_MES_NEW.Packing
                         //获取序列号信息
                         sql.Clear();
                         sql.Append("select nvl(ms_iostatus,0) ms_iostatus,pa_salecode,ms_salecode,ms_outno,ms_makecode,ms_prodcode,nvl(pa_downstatus,0) pa_downstatus,pa_sccode,pa_checkno,pr_packrule,");
-                        sql.Append("nvl(pr_outboxinnerqty,0)pr_outboxinnerqty,nvl(pr_sendchecktype,'LineCode')pr_sendchecktype from makeserial left join product on ms_prodcode=pr_code left join packagedetail ");
+                        sql.Append("nvl(pr_outboxinnerqty,0)pr_outboxinnerqty,nvl(pr_sendchecktype,'LineCode')pr_sendchecktype,pr_code from makeserial left join product on ms_prodcode=pr_code left join packagedetail ");
                         sql.Append("on pd_barcode=ms_sncode left join package on pa_id =pd_paid where ms_id='" + oMsID + "'");
                         dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                         string ms_makecode = "";
@@ -315,7 +315,13 @@ namespace UAS_MES_NEW.Packing
                                 //如果勾选了自动生成箱号,在封箱或者首次
                                 if (AutoGenBoxCode.Checked && (pa_status.Text == "1" || pa_status.Text == "" || pa_status.Text == "0"))
                                 {
-                                    pa_outboxcode.Text = LogicHandler.GetOutBoxCode("PACKAGE", ms_makecode, pr_code.Text, User.UserCode);
+                                    string autoout = LogicHandler.GetOutBoxCode("PACKAGE", ms_makecode, pr_code.Text, User.UserCode);
+                                    if (autoout == " ")
+                                    {
+                                        OperateResult.AppendText(">>未维护箱号规则,无法生成箱号\n", Color.Red, sn_code);
+                                        return;
+                                    }
+                                    pa_outboxcode.Text = autoout;
                                     LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, oMakeCode, User.UserLineCode, User.UserSourceCode, "卡通箱采集", "卡通箱" + pa_outboxcode.Text + "自动生成", sn_code.Text, PreFix.Text + ":" + OutBoxLength.Text);
                                 }
                             }
@@ -394,13 +400,20 @@ namespace UAS_MES_NEW.Packing
                                     pa_outboxcode.Text = "";
                                     pa_status.Text = "0";
                                     BaseUtil.CleanDGVData(PackageDetail);
-                                    pa_outboxcode.Text = LogicHandler.GetOutBoxCode("PACKAGE", ms_makecode, pr_code.Text, User.UserCode);
+                                    string autoout = LogicHandler.GetOutBoxCode("PACKAGE", ms_makecode, pr_code.Text, User.UserCode);
+                                    if (autoout == " ")
+                                    {
+                                        OperateResult.AppendText(">>未维护箱号规则,无法生成箱号\n", Color.Red, sn_code);
+                                        return;
+                                    }
+                                    pa_outboxcode.Text = autoout;
+                                    //pa_outboxcode.Text = LogicHandler.GetOutBoxCode("PACKAGE", ms_makecode, pr_code.Text, User.UserCode);
                                     LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, oMakeCode, User.UserLineCode, User.UserSourceCode, "卡通箱采集", "卡通箱" + pa_outboxcode.Text + "自动生成", sn_code.Text, PreFix.Text + ":" + OutBoxLength.Text);
                                 }
-                                if (!CheckOutBoxLength(ms_salecode_text))
-                                {
-                                    return;
-                                }
+                                //if (!CheckOutBoxLength(ms_salecode_text))
+                                //{
+                                //    return;
+                                //}
                                 ////箱号不存在的情况
                                 if (LogicHandler.Packing(sn_code.Text, pa_outboxcode.Text, AutoGenBoxCode.Checked, "标准", User.UserSourceCode, User.UserCode, pr_outboxinnerqty.Text, Cancel.Checked, out oOutBoxCode, out ErrorMessage))
                                 {
@@ -570,7 +583,9 @@ namespace UAS_MES_NEW.Packing
 
         private void PackCollection_FormClosing(object sender, FormClosingEventArgs e)
         {
-            BaseUtil.ClosePrint(engine);
+            BaseUtil.ClosePrint(lbl);
+            if (engine != null)
+                engine.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges);
             dh.Dispose();
         }
 

+ 35 - 18
UAS_MES_LT/FunctionCode/Packing/Packing_PackageCollectionWeigh.cs

@@ -13,7 +13,7 @@ using System.IO.Ports;
 using System.IO;
 using System.Text.RegularExpressions;
 using System.Collections.Generic;
-using Seagull.BarTender.Print;
+//using Seagull.BarTender.Print;
 
 namespace UAS_MES_NEW.Packing
 {
@@ -25,7 +25,7 @@ namespace UAS_MES_NEW.Packing
         AutoSizeFormClass asc = new AutoSizeFormClass();
         Document doc;
         ApplicationClass lbl;
-        Engine engine;
+        BarTender.Application engine;
         Thread thread;
         DataTable Dbfind;
         string ErrorMessage = "";
@@ -66,7 +66,7 @@ namespace UAS_MES_NEW.Packing
         {
             try
             {
-                engine = new Engine();
+                engine = new BarTender.Application();
                 //lbl = new ApplicationClass();
                 //BaseUtil.WriteLbl();
             }
@@ -219,7 +219,7 @@ namespace UAS_MES_NEW.Packing
                 {
                     dh.ExecuteSql("update package set pa_printcount=pa_printcount+1 where pa_outboxcode='" + pa_outboxcode.Text + "'", "update");
                     //doc = lbl.Documents.Open(PrintLabel.Text);
-                    if (Print.BarTender(Tag.ToString(), ref engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrintList.Text, pa_outboxcode.Text, int.Parse(PrintNum.Text), oMakeCode == "" ? pa_makecode.Text : oMakeCode, pr_code.Text, "卡通箱标", "0", out ErrorMessage))
+                    if (Print.SinglePrint(Tag.ToString(),  engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrintList.Text, pa_outboxcode.Text, int.Parse(PrintNum.Text), oMakeCode == "" ? pa_makecode.Text : oMakeCode, pr_code.Text, "卡通箱标", "0", out ErrorMessage))
                     {
                         OperateResult.AppendText(">>开始打印箱号" + pa_outboxcode.Text + "\n", Color.Black);
                     }
@@ -248,12 +248,12 @@ namespace UAS_MES_NEW.Packing
         {
             if (e.KeyCode == Keys.Enter)
             {
-                if (CheckOutBoxLength())
-                {
+               // if (CheckOutBoxLength())
+               // {
                     LoadData();
                     LoadGridData();
                     sn_code.Focus();
-                }
+                //}
             }
         }
 
@@ -294,7 +294,7 @@ namespace UAS_MES_NEW.Packing
                         //PR_CHECKCARTONW = dh.getFieldDataByCondition("craftdetail left join craft on cr_id=cd_crid left join makeserial on ms_craftcode =cr_code", "nvl(cd_ifweigh,'0') cd_ifweigh", "ms_sncode='" + sn_code.Text + "' and ms_makecode='" + oMakeCode + "' and cd_stepcode = '" + User.CurrentStepCode + "'").ToString();
                         sql.Clear();
                         sql.Append("select nvl(ms_iostatus,0) ms_iostatus,ms_outno,ms_salecode,ms_makecode,ms_prodcode,nvl(pa_downstatus,0) pa_downstatus,pa_sccode,pa_checkno,pr_packrule,");
-                        sql.Append("nvl(pr_outboxinnerqty,0)pr_outboxinnerqty,nvl(pr_sendchecktype,'LineCode')pr_sendchecktype from makeserial left join product on ms_prodcode=pr_code left join packagedetail ");
+                        sql.Append("nvl(pr_outboxinnerqty,0)pr_outboxinnerqty,nvl(pr_sendchecktype,'LineCode')pr_sendchecktype,pr_code from makeserial left join product on ms_prodcode=pr_code left join packagedetail ");
                         sql.Append("on pd_barcode=ms_sncode left join package on pa_id =pd_paid where ms_id='" + oMsID + "'");
                         dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                         string ms_makecode = "";
@@ -317,12 +317,12 @@ namespace UAS_MES_NEW.Packing
                             }
                             BaseUtil.SetFormValue(this.Controls, dt);
                         }
-                        if (dt.Rows[0]["ms_outno"].ToString() != "")
+                        if (ms_outno != "")
                         {
-                            OperateResult.AppendText(">>序列号" + sn_code.Text + "已被出货单" + dt.Rows[0]["ms_outno"].ToString() + "采集,不允许操作\n", Color.Red, sn_code);
+                            OperateResult.AppendText(">>序列号" + sn_code.Text + "已被出货单" + ms_outno + "采集,不允许操作\n", Color.Red, sn_code);
                             return;
                         }
-                        if (dt.Rows[0]["ms_iostatus"].ToString() != "0")
+                        if (ms_iostatus != "0")
                         {
                             OperateResult.AppendText(">>序列号" + sn_code.Text + "已入库不允许采集\n", Color.Red, sn_code);
                             return;
@@ -343,7 +343,14 @@ namespace UAS_MES_NEW.Packing
                             {
                                 if (AutoGenBoxCode.Checked && (pa_status.Text == "1" || pa_status.Text == ""))
                                 {
-                                    pa_outboxcode.Text = LogicHandler.GetOutBoxCode("PACKAGE", ms_makecode, pr_code.Text, User.UserCode);
+                                    string autoout = LogicHandler.GetOutBoxCode("PACKAGE", ms_makecode, pr_code.Text, User.UserCode);
+                                    if (autoout == " ")
+                                    {
+                                        OperateResult.AppendText(">>未维护箱号规则,无法生成箱号\n", Color.Red, sn_code);
+                                        return;
+                                    }
+                                    pa_outboxcode.Text = autoout;
+                                    //pa_outboxcode.Text = LogicHandler.GetOutBoxCode("PACKAGE", ms_makecode, pr_code.Text, User.UserCode);
                                     LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, oMakeCode, User.UserLineCode, User.UserSourceCode, "卡通箱采集", "卡通箱" + pa_outboxcode.Text + "自动生成", sn_code.Text, PreFix.Text + ":" + OutBoxLength.Text);
                                 }
                             }
@@ -401,13 +408,20 @@ namespace UAS_MES_NEW.Packing
                                     pa_outboxcode.Text = "";
                                     pa_status.Text = "0";
                                     BaseUtil.CleanDGVData(PackageDetail);
-                                    pa_outboxcode.Text = LogicHandler.GetOutBoxCode("PACKAGE", ms_makecode, pr_code.Text, User.UserCode);
+                                    string autoout = LogicHandler.GetOutBoxCode("PACKAGE", ms_makecode, pr_code.Text, User.UserCode);
+                                    if (autoout == " ")
+                                    {
+                                        OperateResult.AppendText(">>未维护箱号规则,无法生成箱号\n", Color.Red, sn_code);
+                                        return;
+                                    }
+                                    pa_outboxcode.Text = autoout;
+                                    //pa_outboxcode.Text = LogicHandler.GetOutBoxCode("PACKAGE", ms_makecode, pr_code.Text, User.UserCode);
                                     LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, oMakeCode, User.UserLineCode, User.UserSourceCode, "卡通箱采集", "卡通箱" + pa_outboxcode.Text + "自动生成", sn_code.Text, PreFix.Text + ":" + OutBoxLength.Text);
                                 }
-                                if (!CheckOutBoxLength(ms_salecode_text))
-                                {
-                                    return;
-                                }
+                                //if (!CheckOutBoxLength(ms_salecode_text))
+                                //{
+                                //    return;
+                                //}
                                 ////箱号不存在的情况
                                 if (LogicHandler.Packing(sn_code.Text, pa_outboxcode.Text, AutoGenBoxCode.Checked, "标准", User.UserSourceCode, User.UserCode, pr_outboxinnerqty.Text, Cancel.Checked, out oOutBoxCode, out ErrorMessage))
                                 {
@@ -575,7 +589,7 @@ namespace UAS_MES_NEW.Packing
 
         private void Make_PackageCollectionWeigh_FormClosing(object sender, FormClosingEventArgs e)
         {
-            BaseUtil.ClosePrint(engine);
+            BaseUtil.ClosePrint(lbl);
             if (serialPort1.IsOpen)
             {
                 GetData = false;
@@ -584,6 +598,9 @@ namespace UAS_MES_NEW.Packing
                 thread.Interrupt();
             }
             //thread.Abort();
+            if (engine != null)
+                engine.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges);
+            dh.Dispose();
         }
 
         private void Packing_Click(object sender, EventArgs e)

+ 9 - 9
UAS_MES_LT/FunctionCode/Packing/Packing_PalletCollection.Designer.cs

@@ -205,7 +205,7 @@
             // 
             this.pa_status.AutoSize = true;
             this.pa_status.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pa_status.Location = new System.Drawing.Point(868, 174);
+            this.pa_status.Location = new System.Drawing.Point(868, 160);
             this.pa_status.Name = "pa_status";
             this.pa_status.Size = new System.Drawing.Size(0, 21);
             this.pa_status.TabIndex = 181;
@@ -273,7 +273,7 @@
             this.pa_standardqty.BackColor = System.Drawing.Color.White;
             this.pa_standardqty.ID = null;
             this.pa_standardqty.Location = new System.Drawing.Point(85, 84);
-            this.pa_standardqty.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.pa_standardqty.Margin = new System.Windows.Forms.Padding(2);
             this.pa_standardqty.Name = "pa_standardqty";
             this.pa_standardqty.Power = null;
             this.pa_standardqty.Size = new System.Drawing.Size(114, 21);
@@ -305,7 +305,7 @@
             this.Packing.DownImage = ((System.Drawing.Image)(resources.GetObject("Packing.DownImage")));
             this.Packing.Image = ((System.Drawing.Image)(resources.GetObject("Packing.Image")));
             this.Packing.IsShowBorder = true;
-            this.Packing.Location = new System.Drawing.Point(902, 213);
+            this.Packing.Location = new System.Drawing.Point(902, 199);
             this.Packing.MoveImage = ((System.Drawing.Image)(resources.GetObject("Packing.MoveImage")));
             this.Packing.Name = "Packing";
             this.Packing.NormalImage = ((System.Drawing.Image)(resources.GetObject("Packing.NormalImage")));
@@ -319,7 +319,7 @@
             // PrinterList
             // 
             this.PrinterList.Location = new System.Drawing.Point(592, 83);
-            this.PrinterList.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.PrinterList.Margin = new System.Windows.Forms.Padding(4);
             this.PrinterList.Name = "PrinterList";
             this.PrinterList.Size = new System.Drawing.Size(132, 20);
             this.PrinterList.TabIndex = 171;
@@ -403,7 +403,7 @@
             this.Printlab.DownImage = ((System.Drawing.Image)(resources.GetObject("Printlab.DownImage")));
             this.Printlab.Image = ((System.Drawing.Image)(resources.GetObject("Printlab.Image")));
             this.Printlab.IsShowBorder = true;
-            this.Printlab.Location = new System.Drawing.Point(826, 213);
+            this.Printlab.Location = new System.Drawing.Point(826, 199);
             this.Printlab.MoveImage = ((System.Drawing.Image)(resources.GetObject("Printlab.MoveImage")));
             this.Printlab.Name = "Printlab";
             this.Printlab.NormalImage = ((System.Drawing.Image)(resources.GetObject("Printlab.NormalImage")));
@@ -421,7 +421,7 @@
             this.ReleasePallet.DownImage = ((System.Drawing.Image)(resources.GetObject("ReleasePallet.DownImage")));
             this.ReleasePallet.Image = ((System.Drawing.Image)(resources.GetObject("ReleasePallet.Image")));
             this.ReleasePallet.IsShowBorder = true;
-            this.ReleasePallet.Location = new System.Drawing.Point(740, 213);
+            this.ReleasePallet.Location = new System.Drawing.Point(740, 199);
             this.ReleasePallet.MoveImage = ((System.Drawing.Image)(resources.GetObject("ReleasePallet.MoveImage")));
             this.ReleasePallet.Name = "ReleasePallet";
             this.ReleasePallet.NormalImage = ((System.Drawing.Image)(resources.GetObject("ReleasePallet.NormalImage")));
@@ -552,10 +552,10 @@
             // AutoPrint
             // 
             this.AutoPrint.Checked = false;
-            this.AutoPrint.Location = new System.Drawing.Point(757, 174);
+            this.AutoPrint.Location = new System.Drawing.Point(757, 160);
             this.AutoPrint.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
             this.AutoPrint.Name = "AutoPrint";
-            this.AutoPrint.Size = new System.Drawing.Size(84, 22);
+            this.AutoPrint.Size = new System.Drawing.Size(132, 22);
             this.AutoPrint.TabIndex = 191;
             // 
             // OutBoxLength_label
@@ -589,7 +589,7 @@
             // 
             this.StepCount.LineCode = null;
             this.StepCount.Location = new System.Drawing.Point(482, 11);
-            this.StepCount.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.StepCount.Margin = new System.Windows.Forms.Padding(2);
             this.StepCount.Name = "StepCount";
             this.StepCount.Size = new System.Drawing.Size(88, 22);
             this.StepCount.Source = null;

+ 44 - 9
UAS_MES_LT/FunctionCode/Packing/Packing_PalletCollection.cs

@@ -1,5 +1,5 @@
 using LabelManager2;
-using Seagull.BarTender.Print;
+//using Seagull.BarTender.Print;
 using System;
 using System.Collections.Generic;
 using System.ComponentModel;
@@ -35,7 +35,7 @@ namespace UAS_MES_NEW.Packing
         string pa_id;
 
         ApplicationClass lbl;
-        Engine engine;
+        BarTender.Application engine;
 
         Document doc;
 
@@ -53,7 +53,7 @@ namespace UAS_MES_NEW.Packing
         {
             try
             {
-                engine = new Engine();
+                engine = new BarTender.Application();
                 //lbl = new ApplicationClass();
                 //BaseUtil.WriteLbl();
             }
@@ -121,6 +121,10 @@ namespace UAS_MES_NEW.Packing
                         OperateResult.AppendText(">>箱号不能为空\n", Color.Red);
                         return;
                     }
+                    if (dh.CheckExist("makeserial","ms_sncode = '"+ outboxcode.Text + "' and ms_outboxcode is not null"))
+                    {
+                        outboxcode.Text = dh.getFieldDataByCondition("makeserial", "ms_outboxcode", "ms_sncode = '" + outboxcode.Text + "' and ms_outboxcode is not null order by ms_id desc").ToString();
+                    }
                     sql.Clear();
                     sql.Append("select nvl(pa_iostatus,0)pa_iostatus,pa_outno,pa_makecode pd_makecode,nvl(pa_downstatus,0)pa_downstatus,pa_salecode pd_salecode,pr_packrule,pa_id,pa_prodcode pd_prodcode,pa_status,pa_mothercode,pa_nextstep  ");
                     sql.Append("from packagedetail left join package on pd_paid=pa_id left join product on pd_prodcode=pr_code where pd_outboxcode='" + outboxcode.Text + "'");
@@ -152,6 +156,20 @@ namespace UAS_MES_NEW.Packing
                             }
                         }
                         string unfinpack = dh.getFieldDataByCondition("Line", "nvl(li_allowUnFinPack,0)", "li_code='" + User.UserLineCode + "'").ToString();
+                        string v_allowfirstover = dh.getFieldDataByCondition("Line", "nvl(li_allowfirstover,0)", "li_code='" + User.UserLineCode + "'").ToString();
+                        string v_stop = dh.getFieldDataByCondition("Line", "nvl(li_stop,0)", "li_code='" + User.UserLineCode + "'").ToString();
+                        string v_ftime = dh.getFieldDataByCondition("product", "nvl(pr_ftime,0)", "pr_code='" + pd_prodcode.Text + "'").ToString();
+
+                        if (!dh.CheckExist("FIRSTRECORD", "fr_linecode = '" + User.UserLineCode + "' and fr_content='" + outboxcode.Text + "' and FR_STATUS = 0 "))
+                        {
+                            string count = dh.getFieldDataByCondition("FIRSTRECORD", "count(1) cn", "fr_linecode = '" + User.UserLineCode + "'  and FR_STATUS = 0 and datediff_mes(fr_date,sysdate)>"+ v_ftime + "+0.5").ToString();
+                            if (v_stop == "-1" || (v_allowfirstover == "0" && int.Parse(count) > 0))
+                            {
+                                OperateResult.AppendText(">>线体" + User.UserLineCode + "已触发首件停线,当前线体不允许采集!\n", Color.Red, outboxcode);
+                                return;
+                            }
+                        }
+
                         pa_nextstep = dt.Rows[0]["pa_nextstep"].ToString();
                         if (pa_nextstep != User.CurrentStepCode && pa_nextstep != "" && (unfinpack == "0" || unfinpack == ""))
                         {
@@ -209,12 +227,26 @@ namespace UAS_MES_NEW.Packing
                             }
                             else
                             {
-                                pa_outboxcode.Text = LogicHandler.GetOutBoxCode("PALLET", "", pa_prodcode.Text, User.UserCode);
+                                string autoout = LogicHandler.GetOutBoxCode("PALLET", pd_makecode.Text, pd_prodcode.Text, User.UserCode);
+                                if (autoout == " ")
+                                {
+                                    OperateResult.AppendText(">>未维护箱号规则,无法生成箱号\n", Color.Red, outboxcode);
+                                    return;
+                                }
+                                pa_outboxcode.Text = autoout;
+                                pa_standardqty.Text = dh.getFieldDataByCondition("product", "pr_palletqty", "pr_code = '" + pd_prodcode.Text + "'").ToString();
+                                //pa_outboxcode.Text = LogicHandler.GetOutBoxCode("PALLET", "", pa_prodcode.Text, User.UserCode);
                             }
                         }
                         else if (pa_outboxcode.Text != "" && pa_status.Text == "1" && AutoOutBoxCode.Checked)
                         {
-                            pa_outboxcode.Text = LogicHandler.GetOutBoxCode("PALLET", "", pa_prodcode.Text, User.UserCode);
+                            string autoout = LogicHandler.GetOutBoxCode("PALLET", pd_makecode.Text, pd_prodcode.Text, User.UserCode);
+                            if (autoout == " ")
+                            {
+                                OperateResult.AppendText(">>未维护箱号规则,无法生成箱号\n", Color.Red, outboxcode);
+                                return;
+                            }
+                            pa_outboxcode.Text = autoout;
                         }
                         else if (pa_outboxcode.Text == "")
                         {
@@ -231,7 +263,7 @@ namespace UAS_MES_NEW.Packing
                             pa_id = dh.GetSEQ("package_seq");
                             sql.Clear();
                             sql.Append("insert into package (pa_id,pa_outboxcode,PA_STANDARDQTY,pa_makecode,pa_indate,pa_packageqty,pa_type,pa_prodcode,pa_level,PA_STATUS,pa_sccode,pa_currentstep,pa_salecode)values");
-                            sql.Append("(" + pa_id + ",'" + pa_outboxcode.Text + "','" + pa_standardqty.Text + "','" + pd_makecode.Text + "',sysdate,'0',3,'" + pd_prodcode.Text + "',0,0,'" + User.UserSourceCode + "','" + User.CurrentStepCode + "','" + pd_salecode.Text + "')");
+                            sql.Append("(" + pa_id + ",'" + pa_outboxcode.Text + "','" + pa_standardqty.Text + "','" + pd_makecode.Text + "',sysdate,'0',3,'" + pd_prodcode.Text + "',0,0,'" + User.UserSourceCode + "','" + User.CurrentStepCode + "','" + pd_salecode.Text + "' )");
                             dh.ExecuteSql(sql.GetString(), "insert");
                         }
                         else
@@ -287,7 +319,7 @@ namespace UAS_MES_NEW.Packing
                                     //如果是线内并且下一工序等于当前岗位资源工序
                                     if (pa_nextstep != "" && pa_nextstep == User.CurrentStepCode)
                                     {
-                                        LogicHandler.OutBoxStepPass(outboxcode.Text, pa_makecode.Text, User.UserSourceCode, User.UserCode, "栈板采集成功,栈板号:" + pa_outboxcode.Text, "栈板采集", out ErrorMessage);
+                                        LogicHandler.OutBoxStepPass(outboxcode.Text, pd_makecode.Text, User.UserSourceCode, User.UserCode, "栈板采集成功,栈板号:" + pa_outboxcode.Text, "栈板采集", out ErrorMessage);
                                     }
                                     if (pa_totalqty.Text == "1")
                                     {
@@ -426,7 +458,7 @@ namespace UAS_MES_NEW.Packing
                         outboxcode.SelectAll();
                     }
                     //doc = lbl.Documents.Open(PrintLabel.Text);
-                    if (Print.BarTender(Tag.ToString(), ref engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrinterList.Text, pa_outboxcode.Text, int.Parse(PrintNum.Text), pa_makecode.Text, pa_prodcode.Text, "栈板标", "0", out ErrorMessage))
+                    if (Print.SinglePrint(Tag.ToString(),  engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrinterList.Text, pa_outboxcode.Text, int.Parse(PrintNum.Text), pa_makecode.Text, pa_prodcode.Text, "栈板标", "0", out ErrorMessage))
                     {
                         OperateResult.AppendText(">>打印栈板" + pa_outboxcode.Text + "\n", Color.Black);
                     }
@@ -485,7 +517,10 @@ namespace UAS_MES_NEW.Packing
 
         private void Make_PalletCollection_FormClosing(object sender, FormClosingEventArgs e)
         {
-            BaseUtil.ClosePrint(engine);
+            BaseUtil.ClosePrint(lbl);
+            if (engine != null)
+                engine.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges);
+            dh.Dispose();
         }
 
         private void Packing_Click(object sender, EventArgs e)

+ 22 - 6
UAS_MES_LT/FunctionCode/Packing/Packing_PalletWightCollection.cs

@@ -12,7 +12,6 @@ using UAS_MES_NEW.Entity;
 using UAS_MES_NEW.PublicForm;
 using UAS_MES_NEW.PublicMethod;
 using UAS_MES_NEW.Packing;
-using Seagull.BarTender.Print;
 using System.Net.Sockets;
 using System.Net;
 
@@ -49,7 +48,7 @@ namespace UAS_MES_NEW.Packing
 
         string PR_CHECKCARTONW = "0";
 
-        Engine engine;
+        BarTender.Application engine;
 
         Thread InitPrint;
 
@@ -70,7 +69,7 @@ namespace UAS_MES_NEW.Packing
         {
             try
             {
-                engine = new Engine(true);
+                engine = new BarTender.Application();
                 BaseUtil.WriteLbl();
             }
             catch
@@ -292,12 +291,26 @@ namespace UAS_MES_NEW.Packing
                             }
                             else
                             {
-                                pa_outboxcode.Text = LogicHandler.GetOutBoxCode("PALLET", "", pa_prodcode.Text, User.UserCode);
+                                string autoout = LogicHandler.GetOutBoxCode("PALLET", "", pa_prodcode.Text, User.UserCode);
+                                if (autoout == " ")
+                                {
+                                    OperateResult.AppendText(">>未维护箱号规则,无法生成箱号\n", Color.Red, outboxcode);
+                                    return;
+                                }
+                                pa_outboxcode.Text = autoout;
+                                //pa_outboxcode.Text = LogicHandler.GetOutBoxCode("PALLET", "", pa_prodcode.Text, User.UserCode);
                             }
                         }
                         else if (pa_outboxcode.Text != "" && pa_status.Text == "1" && AutoOutBoxCode.Checked)
                         {
-                            pa_outboxcode.Text = LogicHandler.GetOutBoxCode("PALLET", "", pa_prodcode.Text, User.UserCode);
+                            string autoout = LogicHandler.GetOutBoxCode("PALLET", "", pa_prodcode.Text, User.UserCode);
+                            if (autoout == " ")
+                            {
+                                OperateResult.AppendText(">>未维护箱号规则,无法生成箱号\n", Color.Red, outboxcode);
+                                return;
+                            }
+                            pa_outboxcode.Text = autoout;
+                            //pa_outboxcode.Text = LogicHandler.GetOutBoxCode("PALLET", "", pa_prodcode.Text, User.UserCode);
                         }
                         else if (pa_outboxcode.Text == "")
                         {
@@ -498,7 +511,7 @@ namespace UAS_MES_NEW.Packing
                         pa_outboxcode.SelectAll();
                     }
                     //doc = lbl.Documents.Open(PrintLabel.Text);
-                    if (Print.BarTender(Tag.ToString(), ref engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrinterList.Text, pa_outboxcode.Text, int.Parse(PrintNum.Text), pa_makecode.Text, pa_prodcode.Text, "栈板标", "0", out ErrorMessage))
+                    if (Print.SinglePrint(Tag.ToString(),  engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrinterList.Text, pa_outboxcode.Text, int.Parse(PrintNum.Text), pa_makecode.Text, pa_prodcode.Text, "栈板标", "0", out ErrorMessage))
                     {
                         OperateResult.AppendText(">>打印栈板" + pa_outboxcode.Text + "\n", Color.Black);
                     }
@@ -567,6 +580,9 @@ namespace UAS_MES_NEW.Packing
                 SystemInf.OpenPort.Remove(serialPort1.PortName);
                 thread.Interrupt();
             }
+            if (engine != null)
+                engine.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges);
+            dh.Dispose();
             //thread.Abort();
         }
 

+ 208 - 0
UAS_MES_LT/FunctionCode/Special/Special_GetBad.Designer.cs

@@ -0,0 +1,208 @@
+namespace UAS_MES_NEW.Special
+{
+    partial class Special_GetBad
+    {
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows Form Designer generated code
+
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Special_GetBad));
+            this.Split = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
+            this.Pallet_label = new System.Windows.Forms.Label();
+            this.SN = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.OperatResult = new UAS_MES_NEW.CustomControl.RichText.RichTextAutoBottom();
+            this.NewBadCode = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
+            this.makecode = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.label1 = new System.Windows.Forms.Label();
+            this.bc_remark = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.label2 = new System.Windows.Forms.Label();
+            this.SuspendLayout();
+            // 
+            // Split
+            // 
+            this.Split.AllPower = null;
+            this.Split.BackColor = System.Drawing.Color.Transparent;
+            this.Split.DownImage = ((System.Drawing.Image)(resources.GetObject("Split.DownImage")));
+            this.Split.Image = null;
+            this.Split.IsShowBorder = true;
+            this.Split.Location = new System.Drawing.Point(91, 320);
+            this.Split.Margin = new System.Windows.Forms.Padding(2);
+            this.Split.MoveImage = ((System.Drawing.Image)(resources.GetObject("Split.MoveImage")));
+            this.Split.Name = "Split";
+            this.Split.NormalImage = ((System.Drawing.Image)(resources.GetObject("Split.NormalImage")));
+            this.Split.Power = null;
+            this.Split.Size = new System.Drawing.Size(56, 22);
+            this.Split.TabIndex = 0;
+            this.Split.Text = "采集不良";
+            this.Split.UseVisualStyleBackColor = false;
+            this.Split.Click += new System.EventHandler(this.Split_Click);
+            // 
+            // Pallet_label
+            // 
+            this.Pallet_label.AutoSize = true;
+            this.Pallet_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.Pallet_label.Location = new System.Drawing.Point(18, 131);
+            this.Pallet_label.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.Pallet_label.Name = "Pallet_label";
+            this.Pallet_label.Size = new System.Drawing.Size(32, 21);
+            this.Pallet_label.TabIndex = 1;
+            this.Pallet_label.Text = "SN";
+            // 
+            // SN
+            // 
+            this.SN.AllPower = null;
+            this.SN.BackColor = System.Drawing.Color.White;
+            this.SN.ID = null;
+            this.SN.Location = new System.Drawing.Point(91, 133);
+            this.SN.Margin = new System.Windows.Forms.Padding(2);
+            this.SN.Name = "SN";
+            this.SN.Power = null;
+            this.SN.Size = new System.Drawing.Size(148, 21);
+            this.SN.Str = null;
+            this.SN.Str1 = null;
+            this.SN.Str2 = null;
+            this.SN.TabIndex = 2;
+            this.SN.KeyDown += new System.Windows.Forms.KeyEventHandler(this.SN_KeyDown);
+            // 
+            // OperatResult
+            // 
+            this.OperatResult.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.OperatResult.Location = new System.Drawing.Point(408, 59);
+            this.OperatResult.Margin = new System.Windows.Forms.Padding(2);
+            this.OperatResult.Name = "OperatResult";
+            this.OperatResult.Size = new System.Drawing.Size(204, 310);
+            this.OperatResult.TabIndex = 3;
+            this.OperatResult.Text = "";
+            // 
+            // NewBadCode
+            // 
+            this.NewBadCode.AllPower = "ifall";
+            this.NewBadCode.BackColor = System.Drawing.Color.Transparent;
+            this.NewBadCode.DownImage = ((System.Drawing.Image)(resources.GetObject("NewBadCode.DownImage")));
+            this.NewBadCode.Image = null;
+            this.NewBadCode.IsShowBorder = true;
+            this.NewBadCode.Location = new System.Drawing.Point(91, 91);
+            this.NewBadCode.MoveImage = ((System.Drawing.Image)(resources.GetObject("NewBadCode.MoveImage")));
+            this.NewBadCode.Name = "NewBadCode";
+            this.NewBadCode.NormalImage = ((System.Drawing.Image)(resources.GetObject("NewBadCode.NormalImage")));
+            this.NewBadCode.Power = null;
+            this.NewBadCode.Size = new System.Drawing.Size(86, 24);
+            this.NewBadCode.TabIndex = 61;
+            this.NewBadCode.Tag = "IfRead";
+            this.NewBadCode.Text = "新增不良代码";
+            this.NewBadCode.UseVisualStyleBackColor = true;
+            this.NewBadCode.Click += new System.EventHandler(this.NewBadCode_Click);
+            // 
+            // makecode
+            // 
+            this.makecode.AllPower = null;
+            this.makecode.BackColor = System.Drawing.Color.White;
+            this.makecode.ID = null;
+            this.makecode.Location = new System.Drawing.Point(91, 177);
+            this.makecode.Margin = new System.Windows.Forms.Padding(2);
+            this.makecode.Name = "makecode";
+            this.makecode.Power = null;
+            this.makecode.ReadOnly = true;
+            this.makecode.Size = new System.Drawing.Size(148, 21);
+            this.makecode.Str = null;
+            this.makecode.Str1 = null;
+            this.makecode.Str2 = null;
+            this.makecode.TabIndex = 63;
+            // 
+            // 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(18, 175);
+            this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(42, 21);
+            this.label1.TabIndex = 62;
+            this.label1.Text = "工单";
+            // 
+            // bc_remark
+            // 
+            this.bc_remark.AllPower = null;
+            this.bc_remark.BackColor = System.Drawing.Color.White;
+            this.bc_remark.ID = null;
+            this.bc_remark.Location = new System.Drawing.Point(91, 229);
+            this.bc_remark.Multiline = true;
+            this.bc_remark.Name = "bc_remark";
+            this.bc_remark.Power = null;
+            this.bc_remark.Size = new System.Drawing.Size(264, 62);
+            this.bc_remark.Str = null;
+            this.bc_remark.Str1 = null;
+            this.bc_remark.Str2 = null;
+            this.bc_remark.TabIndex = 64;
+            // 
+            // 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(11, 229);
+            this.label2.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(74, 21);
+            this.label2.TabIndex = 65;
+            this.label2.Text = "原因分析";
+            // 
+            // Special_GetBad
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(692, 527);
+            this.Controls.Add(this.label2);
+            this.Controls.Add(this.bc_remark);
+            this.Controls.Add(this.makecode);
+            this.Controls.Add(this.label1);
+            this.Controls.Add(this.NewBadCode);
+            this.Controls.Add(this.OperatResult);
+            this.Controls.Add(this.SN);
+            this.Controls.Add(this.Pallet_label);
+            this.Controls.Add(this.Split);
+            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
+            this.Margin = new System.Windows.Forms.Padding(2);
+            this.Name = "Special_GetBad";
+            this.Tag = "Special!GetBad";
+            this.Text = "线外不良采集";
+            this.Load += new System.EventHandler(this.Special_BoxSplit_Load);
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private CustomControl.ButtonUtil.NormalButton Split;
+        private System.Windows.Forms.Label Pallet_label;
+        private CustomControl.TextBoxWithIcon.EnterTextBox SN;
+        private CustomControl.RichText.RichTextAutoBottom OperatResult;
+        private CustomControl.ButtonUtil.NormalButton NewBadCode;
+        private CustomControl.TextBoxWithIcon.EnterTextBox makecode;
+        private System.Windows.Forms.Label label1;
+        private CustomControl.TextBoxWithIcon.EnterTextBox bc_remark;
+        private System.Windows.Forms.Label label2;
+    }
+}

+ 131 - 0
UAS_MES_LT/FunctionCode/Special/Special_GetBad.cs

@@ -0,0 +1,131 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+using UAS_MES_NEW.DataOperate;
+using UAS_MES_NEW.Entity;
+using UAS_MES_NEW.Make;
+using UAS_MES_NEW.PublicMethod;
+
+namespace UAS_MES_NEW.Special
+{
+    public partial class Special_GetBad : Form
+    {
+        DataHelper dh;
+
+        LogStringBuilder sql = new LogStringBuilder();
+
+        DataTable dt;
+
+        public Special_GetBad()
+        {
+            InitializeComponent();
+        }
+
+        private void Special_BoxSplit_Load(object sender, EventArgs e)
+        {
+            dh = SystemInf.dh;
+        }
+
+        private void Split_Click(object sender, EventArgs e)
+        {
+            if (SN.Text == "" || makecode.Text == null || makecode.Text == ""|| bc_remark.Text==null|| bc_remark.Text=="")
+            {
+                OperatResult.AppendText(">>序列号,工单号,原因分析不允许为空\n", Color.Red);
+            }
+            else
+            {
+                //如果存在送检批号则进行删除
+                if (dh.CheckExist("oqcbatchdetail", "obd_sncode='" + SN.Text + "'"))
+                {
+                    string checkno = dh.getFieldDataByCondition("oqcbatchdetail", "obd_checkno", "obd_sncode='" + SN.Text + "'").ToString();
+                    string ifng = dh.getFieldDataByCondition("oqcbatchdetail", "obd_ifng", "obd_sncode='" + SN.Text + "'").ToString();
+                    if (ifng == "-1")
+                    {
+                        dh.ExecuteSql("delete OQCITEMSAMPLES where ois_sncode = '" + SN.Text + "'", "select");
+                        dh.ExecuteSql("update oqcbatch set ob_nowcheckqty=ob_nowcheckqty-1,ob_ngqty =  ob_ngqty -1 where ob_checkno='" + checkno + "'", "update");
+                    }
+                    dh.ExecuteSql("delete from oqcbatchdetail where obd_sncode='" + SN.Text + "'", "delete");
+                }
+                //之前保存的不良就不再调用
+                DataTable dt = dh.getFieldsDataByCondition("makeserial", new string[] { "ms_stepcode", "nvl(ms_ifrework,0)ms_ifrework", "ms_status" }, "ms_sncode='" + SN.Text + "' and ms_makecode='" + makecode.Text + "'");
+                if (dt.Rows.Count > 0)
+                {
+                    string ifrework = dt.Rows[0]["ms_ifrework"].ToString();
+                    string ms_stepcode = dt.Rows[0]["ms_stepcode"].ToString();
+                    string ms_status = dt.Rows[0]["ms_status"].ToString();
+                    if (ms_status == "2")
+                    {
+                        dh.UpdateByCondition("make", "ma_madeqty=nvl(ma_madeqty,0)-1", "ma_code='" + makecode.Text + "'");
+                    }
+                    dh.UpdateByCondition("makeserial", "ms_nextstepcode='',ms_status=3", "ms_sncode='" + SN.Text + "' and ms_makecode='" + makecode.Text + "' ");
+                }
+                if (dh.CheckExist("makeserial", "ms_sncode='" + SN.Text + "' and ms_makecode='" + makecode.Text + "' and ms_outboxcode is not null"))
+                {
+                    string outboxcode = dh.getFieldDataByCondition("makeserial", "nvl(ms_outboxcode,' ')", "ms_sncode='" + SN.Text + "' and ms_makecode='" + makecode.Text + "' order by ms_id desc").ToString();
+
+                    string delete1 = "delete from packagedetail where pd_outboxcode = '"+ outboxcode + "' and pd_barcode = '" + SN.Text + "'";
+                    string delete2 = "update makeserial set ms_outboxcode = '', ms_currentstepcode = null where ms_sncode='" + SN.Text + "' and ms_makecode='" + makecode.Text + "'";
+                    string delete3 = "update package set pa_currentqty = pa_currentqty - 1,pa_totalqty = pa_totalqty - 1,pa_packageqty = pa_packageqty - 1,pa_status = 0 where pa_outboxcode = '" + outboxcode + "' ";
+                    string delete4 = "update package set pa_packtype = null, pa_sccode = null, pa_checkno = null, pa_salecode = null, pa_makecode = null, pa_prodcode = null where pa_outboxcode = '" + outboxcode + "'  and pa_currentqty = 0";
+                    //string delete = "delete from makebad where mb_id = '" + mb_id + "'";
+                    dh.ExecuteSQLTran(delete1, delete2, delete3, delete4);
+
+                }
+                dh.ExecuteSql("insert into FIRSTALY(fa_id,fa_sncode,fa_makecode,fa_content,fa_date) values (FIRSTALY_seq.nextval,'"+SN.Text+"','"+makecode.Text+"','"+ bc_remark.Text+ "',SYSDATE)", "insert");
+                LogicHandler.InsertMakeProcess(SN.Text, makecode.Text, User.UserSourceCode, "采集成不良", "首件测试不良", User.UserCode);
+                LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, makecode.Text, User.UserLineCode, User.UserSourceCode, "采集成不良", "首件采集不良", SN.Text,"");
+                OperatResult.AppendText(">>序列号:" + SN.Text + "不良采集成功\n", Color.Green);
+                BaseUtil.CleanControls(this.Controls);
+            }
+        }
+
+        private void SN_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.KeyCode == Keys.Enter)
+            {
+                sql.Clear();
+                sql.Append("select ms_makecode makecode  from makeserial left join make ");
+                sql.Append("on ms_makecode=ma_code where ms_sncode = '" + SN.Text + "' order by ms_id desc");
+                dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                BaseUtil.SetFormValue(this.Controls, dt);
+                string ms_paststep = "";
+                if (!(dt.Rows.Count > 0))
+                {
+                    OperatResult.AppendText(">>序列号:" + SN.Text + "不存在\n", Color.Red);
+                    BaseUtil.CleanForm(this);
+                    return;
+                }
+                if (!dh.CheckExist("FIRSTRECORD", "fr_content='" + SN.Text + "' and FR_STATUS = 0"))
+                {
+                    string outboxcode = dh.getFieldDataByCondition("makeserial", "nvl(ms_outboxcode,' ')", "ms_sncode='" + SN.Text + "' and ms_makecode='" + makecode.Text + "' order by ms_id desc").ToString();
+                    if (!dh.CheckExist("FIRSTRECORD", "fr_content='" + outboxcode + "' and FR_STATUS = 0"))
+                    {
+                        OperatResult.AppendText(">>序列号:" + SN.Text + "非在测首件SN\n", Color.Red);
+                        BaseUtil.CleanForm(this);
+                        return;
+                    }
+                }
+            }
+        }
+
+        private void NewBadCode_Click(object sender, EventArgs e)
+        {
+            if (SN.Text == "" || makecode.Text == null || makecode.Text == "")
+            {
+                OperatResult.AppendText(">>序列号和工单号不允许为空\n", Color.Red);
+            }
+            else
+            {
+                Make_NewBadCode badcode = new Make_NewBadCode(SN.Text, makecode.Text);
+               // badcode.FormClosed += LoadBadInfTree;
+                BaseUtil.SetFormCenter(badcode);
+                badcode.ShowDialog();
+            }
+        }
+    }
+}

+ 197 - 0
UAS_MES_LT/FunctionCode/Special/Special_GetBad.resx

@@ -0,0 +1,197 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+  <data name="Split.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="Split.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="Split.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>
+  <data name="NewBadCode.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="NewBadCode.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="NewBadCode.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>

+ 13 - 0
UAS_MES_LT/FunctionCode/Special/Special_Reset.Designer.cs

@@ -47,6 +47,7 @@
             this.OperatResult = new UAS_MES_NEW.CustomControl.RichText.RichTextAutoBottom();
             this.input = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.Split = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
+            this.checkBox1 = new System.Windows.Forms.CheckBox();
             this.SuspendLayout();
             // 
             // Pallet_label
@@ -289,11 +290,22 @@
             this.Split.UseVisualStyleBackColor = false;
             this.Split.Click += new System.EventHandler(this.Split_Click);
             // 
+            // checkBox1
+            // 
+            this.checkBox1.AutoSize = true;
+            this.checkBox1.Location = new System.Drawing.Point(473, 149);
+            this.checkBox1.Name = "checkBox1";
+            this.checkBox1.Size = new System.Drawing.Size(120, 16);
+            this.checkBox1.TabIndex = 246;
+            this.checkBox1.Text = "清空机器写入信息";
+            this.checkBox1.UseVisualStyleBackColor = true;
+            // 
             // Special_Reset
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(805, 565);
+            this.Controls.Add(this.checkBox1);
             this.Controls.Add(this.数据清空);
             this.Controls.Add(this.cd_stepno);
             this.Controls.Add(this.WeighRecord);
@@ -342,5 +354,6 @@
         private System.Windows.Forms.ColumnHeader columnHeader3;
         private System.Windows.Forms.Label cd_stepno;
         private CustomControl.ButtonUtil.NormalButton 数据清空;
+        private System.Windows.Forms.CheckBox checkBox1;
     }
 }

+ 4 - 0
UAS_MES_LT/FunctionCode/Special/Special_Reset.cs

@@ -52,6 +52,10 @@ namespace UAS_MES_NEW.Special
         {
             string stname = dh.getFieldDataByCondition("step", "st_name", "st_code = '" + stepcode +  "'").ToString();
             dh.ExecuteSql("update makeserial set ms_status=1,ms_outboxcode='',ms_nextstepcode= '"+ stepcode + "' where ms_sncode='" + sncode + "'", "update");
+            if (checkBox1.Checked)
+            {
+                dh.ExecuteSql("update makeserial set ms_key='',ms_keyid='',MS_HARDWREID='',MS_KEYSTATEID='',MS_BIOS='',ms_ec='',ms_uuid='',MS_KEYPARTNUMBER='',ms_bt='',ms_mac='',ms_imei='' where ms_sncode = '" + sncode + "' and ms_makecode = '" + ms_makecode.Text + "'", "update");
+            }
             dh.ExecuteSql("delete makebad where mb_sncode = '" + sncode + "' and mb_status = 0", "delete");
             sql.Clear();
             sql.Append("update craftmaterial set cm_status=-1,cm_lastdeco=-1,cm_dropman='" + User.UserCode + "',");

+ 7 - 6
UAS_MES_LT/Login.cs

@@ -44,8 +44,8 @@ namespace UAS_MES_NEW
 
         private void Login_Load(object sender, EventArgs e)
         {
-            BaseUtil.FormStepInOrOut(this, true);
-            //设置默认数据库
+            BaseUtil.FormStepInOrOut(this, true); 
+            //设置默认数据库  
             SystemInf.DefaultDB = Properties.Settings.Default.Properties["MES"].DefaultValue.ToString();
             SystemInf.ProcessesID = System.Diagnostics.Process.GetCurrentProcess().Id;
             CheckForIllegalCrossThreadCalls = false;
@@ -55,6 +55,7 @@ namespace UAS_MES_NEW
             {
                 Directory.CreateDirectory(Application.StartupPath + @"\" + DateTime.Now.ToString("yyyy-MM-dd"));
             }
+            //MessageBox.Show("HELLO");
             //SystemInf.OpenByNet = true;
             //显示上次用户登录的用户名,将输入框定位到密码
             UserName.Text = BaseUtil.GetCacheData("LastLoginUser").ToString();
@@ -69,7 +70,7 @@ namespace UAS_MES_NEW
         private void LoadMaster()
         {
             try
-            {
+            {    
                 dh = new DataHelper();
                 //将账套的信息查询出来赋给下拉框
                 DbComboxData = (DataTable)dh.ExecuteSql("select ms_pwd,ma_user,ma_user||'#'||ma_inneraddress db_user from master", "select");
@@ -93,9 +94,9 @@ namespace UAS_MES_NEW
             //设置选中数据库的链接
             string DBUser = DB.SelectedValue.ToString().Split('#')[0];
             string Address = DB.SelectedValue.ToString().Split('#')[1];
-            //DataHelper.DBConnectionString = "Password=select!#%*(;User ID=" + DBUser + ";Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.8.0.97)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
-            DataHelper.DBConnectionString = "Password=select!#%*(;User ID=" + DBUser + ";Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=" + Address + ")(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
-            SystemInf.CurrentDB = DBUser;
+            //DataHelper.DBConnectionString = "Password=select!#%*(;User ID=" + DBUser + ";Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=usoft.f3322.net)(PORT=11644)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+            DataHelper.DBConnectionString = "Password=select!#%*(;User ID=" + DBUser + ";Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.83.235)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+            SystemInf.CurrentDB = DBUser;   
             //设置屏幕的宽高信息
             SystemInf.ScreenWidth = Screen.PrimaryScreen.WorkingArea.Width;
             SystemInf.ScreenHeight = Screen.PrimaryScreen.WorkingArea.Height;

+ 2 - 2
UAS_MES_LT/Properties/Settings.Designer.cs

@@ -122,8 +122,8 @@ namespace UAS_MES_NEW.Properties {
         [global::System.Configuration.ApplicationScopedSettingAttribute()]
         [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
         [global::System.Configuration.DefaultSettingValueAttribute("Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=LIANT;Pooling=fal" +
-            "se;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1" +
-            "1.201)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));")]
+            "se;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.8" +
+            "3.235)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));")]
         public string MES {
             get {
                 return ((string)(this["MES"]));

+ 1 - 1
UAS_MES_LT/Properties/Settings.settings

@@ -27,7 +27,7 @@
       <Value Profile="(Default)">ftp://10.8.0.82|vsftpd|vsftpd</Value>
     </Setting>
     <Setting Name="MES" Type="System.String" Scope="Application">
-      <Value Profile="(Default)">Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=LIANT;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.11.201)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));</Value>
+      <Value Profile="(Default)">Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=LIANT;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.83.235)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));</Value>
     </Setting>
   </Settings>
 </SettingsFile>

+ 4 - 9
UAS_MES_LT/PublicMethod/BaseUtil.cs

@@ -1,5 +1,5 @@
 using LabelManager2;
-using Seagull.BarTender.Print;
+//using Seagull.BarTender.Print;
 using System;
 using System.Collections;
 using System.Collections.Generic;
@@ -1205,14 +1205,9 @@ namespace UAS_MES_NEW.PublicMethod
             close.Start();
         }
 
-        public static void ClosePrint(Engine lbl)
-        {
-            eng = lbl;
-            Thread close = new Thread(ClosePrintProcess);
-            close.Start();
-        }
+    
 
-        static Engine eng;
+        static BarTender.Application eng;
 
         static ApplicationClass lblpro;
 
@@ -1220,7 +1215,7 @@ namespace UAS_MES_NEW.PublicMethod
         {
             try
             {
-                eng.Stop();
+                lblpro.Quit();
             }
             catch (Exception)
             {

+ 1 - 1
UAS_MES_LT/PublicMethod/LogicHandler.cs

@@ -1148,7 +1148,7 @@ namespace UAS_MES_NEW.PublicMethod
                     bool f = false;
                     for (int i = 0; i < pres.Length; i++)
                     {
-                        if (pres[i] == "" ? true : iSN.StartsWith(pres[i]))
+                        if (pres[i] == "" ? true : iSN.Contains(pres[i]))
                         {
                             //满足其中一条即可
                             f = true;

+ 198 - 85
UAS_MES_LT/PublicMethod/Print.cs

@@ -6,7 +6,7 @@ using System.IO;
 using UAS_MES_NEW.Entity;
 using System.Text.RegularExpressions;
 using System.Windows.Forms;
-using Seagull.BarTender.Print;
+
 
 namespace UAS_MES_NEW.PublicMethod
 {
@@ -18,18 +18,18 @@ namespace UAS_MES_NEW.PublicMethod
         ////CodeSoft的打印机
         //string CodeSpft_Printer;
 
-        static LabelFormatDocument format;
-
+        // static LabelFormatDocument format;
+        static BarTender.Format doc2;
         public Print() { }
 
 
-        public static bool CodeSoft(string iCaller, Document doc, string LabelName, string LaID, string PrinterName, string SnCode, int PrintNum, string MakeCode, string ProdCode, string LabelType, string IfRePrint, out string ErrorMessage)
+        public static bool SinglePrint(string iCaller, BarTender.Application lbl, string LabelName, string LaID, string PrinterName, string SnCode, int PrintNum, string MakeCode, string ProdCode, string LabelType, string IfRePrint, out string ErrorMessage)
         {
             ErrorMessage = "";
             DataTable dt = new DataTable();
             if (IfRePrint != "-1")
             {
-                if (LabelType == "卡通箱标" || LabelType == "大箱标" || LabelType == "栈板标")
+                if (LabelType == "卡通箱标" || LabelType == "彩盒标" || LabelType == "栈板标" || LabelType == "机身标")
                 {
                     dt = (DataTable)dh.ExecuteSql("select lpl_id from labelprintlog where lpl_value='" + SnCode + "' and lpl_type='" + LabelType + "' and lpl_stepcode='" + User.CurrentStepCode + "'", "select");
                 }
@@ -44,13 +44,31 @@ namespace UAS_MES_NEW.PublicMethod
                     return false;
                 }
             }
+            //  string filelastwritetime = dh.getFieldDataByCondition("label", "la_lastwritetime", "la_id = '" + LaID + "'").ToString();
+            // FileInfo PrintFile = new FileInfo(LabelName);
             //打开模板路径
             //查询模板对应的取值SQL和参数名称
             dt = (DataTable)dh.ExecuteSql("select lp_name,lp_sql from label left join LABELPARAMETER on la_id=lp_laid where la_id='" + LaID + "'", "select");
-            StringBuilder sb = new StringBuilder();
-            if (doc == null)
+            //StringBuilder sb = new StringBuilder();
+            //if (!PrintFile.Exists)
+            //{
+            //    MessageBox.Show("打印文件不存在");
+            //    return false;
+            //}
+            //string filechangetime = PrintFile.LastWriteTime.ToString();
+            //if (filechangetime != filelastwritetime)
+            //{
+            //    lbl.Dispose();
+            //    lbl = new Engine();
+            //  //  BaseUtil.WriteLbl();
+            //    filechangetime = PrintFile.LastWriteTime.ToString("yyyy-MM-dd HH:mm:ss");
+            //    string update = "la_lastwritetime = to_date((regexp_substr('" + filechangetime + "','\\d+.+\\d+')),'yyyy-mm-dd hh24:mi:ss')";
+            //    dh.UpdateByCondition("label", update, "la_id = '" + LaID + "'");
+            //}
+            doc2 = lbl.Formats.Open(LabelName);
+            if (doc2 == null)
             {
-                MessageBox.Show("打印文件不存在");
+                MessageBox.Show("标签文件打开失败");
                 return false;
             }
             //执行全部的SQL
@@ -74,41 +92,51 @@ namespace UAS_MES_NEW.PublicMethod
                         int LoopTime = Param.Rows.Count > 100 ? 100 : Param.Rows.Count;
                         for (int j = 0; j < LoopTime; j++)
                         {
-                            for (int k = 0; k < doc.Variables.FormVariables.Count; k++)
+                            for (int k = 0; k < doc2.NamedSubStrings.Count; k++)
                             {
-                                if (j == 0 & doc.Variables.FormVariables.Item(k + 1).Name.ToUpper() == dt.Rows[i]["lp_name"].ToString().ToUpper())
+                                if (j == 0 & doc2.NamedSubStrings.Item(k + 1).Name.ToUpper() == dt.Rows[i]["lp_name"].ToString().ToUpper())
                                 {
-                                    doc.Variables.FormVariables.Item(k + 1).Value = Param.Rows[0][0].ToString();
+                                    doc2.SetNamedSubStringValue(doc2.NamedSubStrings.Item(k + 1).Name, Param.Rows[0][0].ToString());
                                 }
                                 //使用SN开头的参数赋值SN1,SN2,SN3等参数
-                                if (doc.Variables.FormVariables.Item(k + 1).Name.ToUpper() == dt.Rows[i]["lp_name"].ToString().ToUpper() + (j + 1))
+                                //if (j != 0 & doc2.NamedSubStrings.Item(k + 1).Name.ToUpper() == dt.Rows[i]["lp_name"].ToString().ToUpper() + (j))
+                                //{
+                                //    doc2.SetNamedSubStringValue(doc2.NamedSubStrings.Item(k + 1).Name, Param.Rows[j][0].ToString());
+                                //}
+                                if (doc2.NamedSubStrings.Item(k + 1).Name.ToUpper() == dt.Rows[i]["lp_name"].ToString().ToUpper() + (j+1))
                                 {
-                                    doc.Variables.FormVariables.Item(k + 1).Value = Param.Rows[j][0].ToString();
+                                    doc2.SetNamedSubStringValue(doc2.NamedSubStrings.Item(k + 1).Name, Param.Rows[j][0].ToString());
                                 }
                             }
                         }
                     }
                 }
-                catch (System.Exception)
+                catch (System.Exception ex)
                 {
-                    MessageBox.Show("SQL维护不正确");
+                    MessageBox.Show("SQL维护不正确" + ex.Message);
                 }
             }
-            LogManager.DoLog(sb.ToString());
+            //  LogManager.DoLog(sb.ToString());
             //保存本次赋值进行打印
-            doc.Printer.SwitchTo(PrinterName);
-            doc.PrintDocument(PrintNum);
+            // doc2.Printer.SwitchTo(PrinterName);
+
+            // 同样标签的份数 
+            doc2.PrintSetup.IdenticalCopiesOfLabel = PrintNum;
+            // 序列标签数 
+            doc2.PrintSetup.NumberSerializedLabels = 1;
+            doc2.PrintSetup.Printer = PrinterName;
+            doc2.PrintOut(false, false);
+            doc2.Close(BarTender.BtSaveOptions.btDoNotSaveChanges);
             LogicHandler.DoCommandLog(iCaller, User.UserCode, "", User.UserLineCode, User.UserSourceCode, "打印", "成功打印", SnCode, "");
-            for (int k = 0; k < doc.Variables.FormVariables.Count; k++)
-            {
-                doc.Variables.FormVariables.Item(k + 1).Value = null;
-            }
             LogicHandler.doLabelPrintLog(SnCode, LabelType, MakeCode, ProdCode, User.UserSourceCode, User.CurrentStepCode, IfRePrint, User.UserCode);
+            //打印完毕 
+            lbl.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges);
             return true;
         }
 
 
-        public static bool CodeSoft(string iCaller, ref ApplicationClass lbl, string LabelName, string LaID, string PrinterName, string SnCode, int PrintNum, string MakeCode, string ProdCode, string LabelType, string IfRePrint, out string ErrorMessage)
+
+        public static bool CodeSoft(string iCaller, Document doc, string LabelName, string LaID, string PrinterName, string SnCode, int PrintNum, string MakeCode, string ProdCode, string LabelType, string IfRePrint, out string ErrorMessage)
         {
             ErrorMessage = "";
             DataTable dt = new DataTable();
@@ -116,44 +144,26 @@ namespace UAS_MES_NEW.PublicMethod
             {
                 if (LabelType == "卡通箱标" || LabelType == "大箱标" || LabelType == "栈板标")
                 {
-                    dt = (DataTable)dh.ExecuteSql("select lpl_id from labelprintlog where lpl_value='" + SnCode + "' and lpl_type='" + LabelType + LabelName + "' and lpl_stepcode='" + User.CurrentStepCode + "'", "select");
+                    dt = (DataTable)dh.ExecuteSql("select lpl_id from labelprintlog where lpl_value='" + SnCode + "' and lpl_type='" + LabelType + "' and lpl_stepcode='" + User.CurrentStepCode + "'", "select");
                 }
                 else
                 {
-                    dt = (DataTable)dh.ExecuteSql("select lpl_id from labelprintlog where lpl_value='" + SnCode + "' and lpl_makecode='" + MakeCode + "' and lpl_type='" + LabelType + LabelName + "' and lpl_stepcode='" + User.CurrentStepCode + "'", "select");
+                    dt = (DataTable)dh.ExecuteSql("select lpl_id from labelprintlog where lpl_value='" + SnCode + "' and lpl_makecode='" + MakeCode + "' and lpl_type='" + LabelType + "' and lpl_stepcode='" + User.CurrentStepCode + "'", "select");
                 }
                 ////如果已经打印过了,则不允许再打印
-                //if (dt.Rows.Count > 0)
-                //{
-                //    ErrorMessage = SnCode + LabelType + "已打印";
-                //    return false;
-                //}
+                if (dt.Rows.Count > 0)
+                {
+                    ErrorMessage = SnCode + LabelType + "已打印";
+                    return false;
+                }
             }
-            string filelastwritetime = dh.getFieldDataByCondition("label", "la_lastwritetime", "la_id = '" + LaID + "'").ToString();
-            FileInfo PrintFile = new FileInfo(LabelName);
             //打开模板路径
             //查询模板对应的取值SQL和参数名称
-            dt = (DataTable)dh.ExecuteSql("select lp_name,lp_sql from label left join LABELPARAMETER on la_id=lp_laid where la_id='" + LaID + "' order by to_number(lp_detno)", "select");
+            dt = (DataTable)dh.ExecuteSql("select lp_name,lp_sql from label left join LABELPARAMETER on la_id=lp_laid where la_id='" + LaID + "'", "select");
             StringBuilder sb = new StringBuilder();
-            if (!PrintFile.Exists)
-            {
-                MessageBox.Show("打印文件不存在");
-                return false;
-            }
-            string filechangetime = PrintFile.LastWriteTime.ToString();
-            if (filechangetime != filelastwritetime)
-            {
-                lbl.Quit();
-                lbl = new ApplicationClass();
-                BaseUtil.WriteLbl();
-                filechangetime = PrintFile.LastWriteTime.ToString("yyyy-MM-dd HH:mm:ss");
-                string update = "la_lastwritetime = to_date((regexp_substr('" + filechangetime + "','\\d+.+\\d+')),'yyyy-mm-dd hh24:mi:ss')";
-                dh.UpdateByCondition("label", update, "la_id = '" + LaID + "'");
-            }
-            doc = lbl.Documents.Open(LabelName, true);
             if (doc == null)
             {
-                MessageBox.Show("标签文件打开失败");
+                MessageBox.Show("打印文件不存在");
                 return false;
             }
             //执行全部的SQL
@@ -206,36 +216,37 @@ namespace UAS_MES_NEW.PublicMethod
             {
                 doc.Variables.FormVariables.Item(k + 1).Value = null;
             }
-            LogicHandler.doLabelPrintLog(SnCode, LabelType + LabelName, MakeCode, ProdCode, User.UserSourceCode, User.CurrentStepCode, IfRePrint, User.UserCode);
+            LogicHandler.doLabelPrintLog(SnCode, LabelType, MakeCode, ProdCode, User.UserSourceCode, User.CurrentStepCode, IfRePrint, User.UserCode);
             return true;
         }
 
-        public static bool BarTender(string iCaller, ref Engine lbl, string LabelName, string LaID, string PrinterName, string SnCode, int PrintNum, string MakeCode, string ProdCode, string LabelType, string IfRePrint, out string ErrorMessage)
+
+        public static bool CodeSoft(string iCaller, ref ApplicationClass lbl, string LabelName, string LaID, string PrinterName, string SnCode, int PrintNum, string MakeCode, string ProdCode, string LabelType, string IfRePrint, out string ErrorMessage)
         {
             ErrorMessage = "";
             DataTable dt = new DataTable();
-            //if (IfRePrint != "-1")
-            //{
-            //    if (LabelType == "卡通箱标" || LabelType == "大箱标" || LabelType == "栈板标")
-            //    {
-            //        dt = (DataTable)dh.ExecuteSql("select lpl_id from labelprintlog where lpl_value='" + SnCode + "' and lpl_type='" + LabelType + "' and lpl_stepcode='" + User.CurrentStepCode + "'", "select");
-            //    }
-            //    else
-            //    {
-            //        dt = (DataTable)dh.ExecuteSql("select lpl_id from labelprintlog where lpl_value='" + SnCode + "' and lpl_makecode='" + MakeCode + "' and lpl_type='" + LabelType + "' and lpl_stepcode='" + User.CurrentStepCode + "'", "select");
-            //    }
-            //    ////如果已经打印过了,则不允许再打印
-            //    if (dt.Rows.Count > 0)
-            //    {
-            //        ErrorMessage = SnCode + LabelType + "已打印";
-            //        return false;
-            //    }
-            //}
+            if (IfRePrint != "-1")
+            {
+                if (LabelType == "卡通箱标" || LabelType == "大箱标" || LabelType == "栈板标")
+                {
+                    dt = (DataTable)dh.ExecuteSql("select lpl_id from labelprintlog where lpl_value='" + SnCode + "' and lpl_type='" + LabelType + LabelName + "' and lpl_stepcode='" + User.CurrentStepCode + "'", "select");
+                }
+                else
+                {
+                    dt = (DataTable)dh.ExecuteSql("select lpl_id from labelprintlog where lpl_value='" + SnCode + "' and lpl_makecode='" + MakeCode + "' and lpl_type='" + LabelType + LabelName + "' and lpl_stepcode='" + User.CurrentStepCode + "'", "select");
+                }
+                ////如果已经打印过了,则不允许再打印
+                //if (dt.Rows.Count > 0)
+                //{
+                //    ErrorMessage = SnCode + LabelType + "已打印";
+                //    return false;
+                //}
+            }
             string filelastwritetime = dh.getFieldDataByCondition("label", "la_lastwritetime", "la_id = '" + LaID + "'").ToString();
             FileInfo PrintFile = new FileInfo(LabelName);
             //打开模板路径
             //查询模板对应的取值SQL和参数名称
-            dt = (DataTable)dh.ExecuteSql("select lp_name,lp_sql from label left join LABELPARAMETER on la_id=lp_laid where la_id='" + LaID + "'", "select");
+            dt = (DataTable)dh.ExecuteSql("select lp_name,lp_sql from label left join LABELPARAMETER on la_id=lp_laid where la_id='" + LaID + "' order by to_number(lp_detno)", "select");
             StringBuilder sb = new StringBuilder();
             if (!PrintFile.Exists)
             {
@@ -245,15 +256,15 @@ namespace UAS_MES_NEW.PublicMethod
             string filechangetime = PrintFile.LastWriteTime.ToString();
             if (filechangetime != filelastwritetime)
             {
-                lbl.Stop();
-                lbl = new Engine(true);
+                lbl.Quit();
+                lbl = new ApplicationClass();
                 BaseUtil.WriteLbl();
                 filechangetime = PrintFile.LastWriteTime.ToString("yyyy-MM-dd HH:mm:ss");
                 string update = "la_lastwritetime = to_date((regexp_substr('" + filechangetime + "','\\d+.+\\d+')),'yyyy-mm-dd hh24:mi:ss')";
                 dh.UpdateByCondition("label", update, "la_id = '" + LaID + "'");
             }
-            format = lbl.Documents.Open(LabelName);
-            if (format == null)
+            doc = lbl.Documents.Open(LabelName, true);
+            if (doc == null)
             {
                 MessageBox.Show("标签文件打开失败");
                 return false;
@@ -279,16 +290,16 @@ namespace UAS_MES_NEW.PublicMethod
                         int LoopTime = Param.Rows.Count > 100 ? 100 : Param.Rows.Count;
                         for (int j = 0; j < LoopTime; j++)
                         {
-                            for (int k = 0; k < format.SubStrings.Count; k++)
+                            for (int k = 0; k < doc.Variables.FormVariables.Count; k++)
                             {
-                                if (j == 0 & format.SubStrings[k].Name.ToUpper() == dt.Rows[i]["lp_name"].ToString().ToUpper())
+                                if (j == 0 & doc.Variables.FormVariables.Item(k + 1).Name.ToUpper() == dt.Rows[i]["lp_name"].ToString().ToUpper())
                                 {
-                                    format.SubStrings[k].Value = Param.Rows[0][0].ToString();
+                                    doc.Variables.FormVariables.Item(k + 1).Value = Param.Rows[0][0].ToString();
                                 }
                                 //使用SN开头的参数赋值SN1,SN2,SN3等参数
-                                if (format.SubStrings[k].Name.ToUpper() == dt.Rows[i]["lp_name"].ToString().ToUpper() + (j + 1))
+                                if (doc.Variables.FormVariables.Item(k + 1).Name.ToUpper() == dt.Rows[i]["lp_name"].ToString().ToUpper() + (j + 1))
                                 {
-                                    format.SubStrings[k].Value = Param.Rows[j][0].ToString();
+                                    doc.Variables.FormVariables.Item(k + 1).Value = Param.Rows[j][0].ToString();
                                 }
                             }
                         }
@@ -301,17 +312,119 @@ namespace UAS_MES_NEW.PublicMethod
             }
             LogManager.DoLog(sb.ToString());
             //保存本次赋值进行打印
-            format.PrintSetup.PrinterName = PrinterName;
-            format.PrintSetup.IdenticalCopiesOfLabel = PrintNum;
-            format.Print();
+            doc.Printer.SwitchTo(PrinterName);
+            doc.PrintDocument(PrintNum);
             LogicHandler.DoCommandLog(iCaller, User.UserCode, "", User.UserLineCode, User.UserSourceCode, "打印", "成功打印", SnCode, "");
-            for (int k = 0; k < format.SubStrings.Count; k++)
+            for (int k = 0; k < doc.Variables.FormVariables.Count; k++)
             {
-                format.SubStrings[k].Value = null;
+                doc.Variables.FormVariables.Item(k + 1).Value = null;
             }
-            LogicHandler.doLabelPrintLog(SnCode, LabelType, MakeCode, ProdCode, User.UserSourceCode, User.CurrentStepCode, IfRePrint, User.UserCode);
+            LogicHandler.doLabelPrintLog(SnCode, LabelType + LabelName, MakeCode, ProdCode, User.UserSourceCode, User.CurrentStepCode, IfRePrint, User.UserCode);
             return true;
         }
 
+    //    public static bool BarTender(string iCaller, ref Engine lbl, string LabelName, string LaID, string PrinterName, string SnCode, int PrintNum, string MakeCode, string ProdCode, string LabelType, string IfRePrint, out string ErrorMessage)
+    //    {
+    //        ErrorMessage = "";
+    //        DataTable dt = new DataTable();
+    //        //if (IfRePrint != "-1")
+    //        //{
+    //        //    if (LabelType == "卡通箱标" || LabelType == "大箱标" || LabelType == "栈板标")
+    //        //    {
+    //        //        dt = (DataTable)dh.ExecuteSql("select lpl_id from labelprintlog where lpl_value='" + SnCode + "' and lpl_type='" + LabelType + "' and lpl_stepcode='" + User.CurrentStepCode + "'", "select");
+    //        //    }
+    //        //    else
+    //        //    {
+    //        //        dt = (DataTable)dh.ExecuteSql("select lpl_id from labelprintlog where lpl_value='" + SnCode + "' and lpl_makecode='" + MakeCode + "' and lpl_type='" + LabelType + "' and lpl_stepcode='" + User.CurrentStepCode + "'", "select");
+    //        //    }
+    //        //    ////如果已经打印过了,则不允许再打印
+    //        //    if (dt.Rows.Count > 0)
+    //        //    {
+    //        //        ErrorMessage = SnCode + LabelType + "已打印";
+    //        //        return false;
+    //        //    }
+    //        //}
+    //        string filelastwritetime = dh.getFieldDataByCondition("label", "la_lastwritetime", "la_id = '" + LaID + "'").ToString();
+    //        FileInfo PrintFile = new FileInfo(LabelName);
+    //        //打开模板路径
+    //        //查询模板对应的取值SQL和参数名称
+    //        dt = (DataTable)dh.ExecuteSql("select lp_name,lp_sql from label left join LABELPARAMETER on la_id=lp_laid where la_id='" + LaID + "'", "select");
+    //        StringBuilder sb = new StringBuilder();
+    //        if (!PrintFile.Exists)
+    //        {
+    //            MessageBox.Show("打印文件不存在");
+    //            return false;
+    //        }
+    //        string filechangetime = PrintFile.LastWriteTime.ToString();
+    //        if (filechangetime != filelastwritetime)
+    //        {
+    //            lbl.Stop();
+    //            lbl = new Engine(true);
+    //            BaseUtil.WriteLbl();
+    //            filechangetime = PrintFile.LastWriteTime.ToString("yyyy-MM-dd HH:mm:ss");
+    //            string update = "la_lastwritetime = to_date((regexp_substr('" + filechangetime + "','\\d+.+\\d+')),'yyyy-mm-dd hh24:mi:ss')";
+    //            dh.UpdateByCondition("label", update, "la_id = '" + LaID + "'");
+    //        }
+    //        format = lbl.Documents.Open(LabelName);
+    //        if (format == null)
+    //        {
+    //            MessageBox.Show("标签文件打开失败");
+    //            return false;
+    //        }
+    //        //执行全部的SQL
+    //        for (int i = 0; i < dt.Rows.Count; i++)
+    //        {
+    //            string sql = dt.Rows[i]["lp_sql"].ToString();
+    //            try
+    //            {
+    //                Regex ConnoteA = new Regex("{\\w+}");
+    //                foreach (Match mch in ConnoteA.Matches(sql))
+    //                {
+    //                    string x = mch.Value.Trim();
+    //                    sql = sql.Replace(x, "'" + SnCode + "'");
+    //                }
+    //                DataTable Param = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
+    //                if (Param.Rows.Count == 0)
+    //                    continue;
+    //                //查询的结果的参数个数大于1需要给标签的多个参数赋值
+    //                if (Param.Rows.Count > 0)
+    //                {
+    //                    int LoopTime = Param.Rows.Count > 100 ? 100 : Param.Rows.Count;
+    //                    for (int j = 0; j < LoopTime; j++)
+    //                    {
+    //                        for (int k = 0; k < format.SubStrings.Count; k++)
+    //                        {
+    //                            if (j == 0 & format.SubStrings[k].Name.ToUpper() == dt.Rows[i]["lp_name"].ToString().ToUpper())
+    //                            {
+    //                                format.SubStrings[k].Value = Param.Rows[0][0].ToString();
+    //                            }
+    //                            //使用SN开头的参数赋值SN1,SN2,SN3等参数
+    //                            if (format.SubStrings[k].Name.ToUpper() == dt.Rows[i]["lp_name"].ToString().ToUpper() + (j + 1))
+    //                            {
+    //                                format.SubStrings[k].Value = Param.Rows[j][0].ToString();
+    //                            }
+    //                        }
+    //                    }
+    //                }
+    //            }
+    //            catch (System.Exception)
+    //            {
+    //                MessageBox.Show("SQL维护不正确");
+    //            }
+    //        }
+    //        LogManager.DoLog(sb.ToString());
+    //        //保存本次赋值进行打印
+    //        format.PrintSetup.PrinterName = PrinterName;
+    //        format.PrintSetup.IdenticalCopiesOfLabel = PrintNum;
+    //        format.Print();
+    //        LogicHandler.DoCommandLog(iCaller, User.UserCode, "", User.UserLineCode, User.UserSourceCode, "打印", "成功打印", SnCode, "");
+    //        for (int k = 0; k < format.SubStrings.Count; k++)
+    //        {
+    //            format.SubStrings[k].Value = null;
+    //        }
+    //        LogicHandler.doLabelPrintLog(SnCode, LabelType, MakeCode, ProdCode, User.UserSourceCode, User.CurrentStepCode, IfRePrint, User.UserCode);
+    //        return true;
+    //    }
+
     }
 }

BIN
UAS_MES_LT/Resources/Sound/FAIL.wav


BIN
UAS_MES_LT/Resources/Sound/PASS.wav


+ 21 - 14
UAS_MES_LT/UAS_MES_LT.csproj

@@ -33,7 +33,7 @@
     <BootstrapperEnabled>true</BootstrapperEnabled>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-    <PlatformTarget>x86</PlatformTarget>
+    <PlatformTarget>AnyCPU</PlatformTarget>
     <DebugSymbols>true</DebugSymbols>
     <DebugType>full</DebugType>
     <Optimize>false</Optimize>
@@ -146,10 +146,6 @@
       <SpecificVersion>False</SpecificVersion>
       <HintPath>Tool\Oracle.ManagedDataAccess.dll</HintPath>
     </Reference>
-    <Reference Include="Seagull.BarTender.Print, Version=10.1.4.1, Culture=neutral, PublicKeyToken=109ff779a1b4cbc7, processorArchitecture=x86">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>Tool\Seagull.BarTender.Print.dll</HintPath>
-    </Reference>
     <Reference Include="System" />
     <Reference Include="System.Configuration" />
     <Reference Include="System.Core" />
@@ -682,12 +678,6 @@
     <Compile Include="FunctionCode\Make\Make_ColorBoxWeigh.Designer.cs">
       <DependentUpon>Make_ColorBoxWeigh.cs</DependentUpon>
     </Compile>
-    <Compile Include="FunctionCode\Make\Make_CustomLabelPrint.cs">
-      <SubType>Form</SubType>
-    </Compile>
-    <Compile Include="FunctionCode\Make\Make_CustomLabelPrint.Designer.cs">
-      <DependentUpon>Make_CustomLabelPrint.cs</DependentUpon>
-    </Compile>
     <Compile Include="FunctionCode\Make\Make_Decompose.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -1000,6 +990,12 @@
     <Compile Include="FunctionCode\Special\Special_CancelProdinout.Designer.cs">
       <DependentUpon>Special_CancelProdinout.cs</DependentUpon>
     </Compile>
+    <Compile Include="FunctionCode\Special\Special_GetBad.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="FunctionCode\Special\Special_GetBad.Designer.cs">
+      <DependentUpon>Special_GetBad.cs</DependentUpon>
+    </Compile>
     <Compile Include="FunctionCode\Special\Special_MendLabel.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -1405,9 +1401,6 @@
     <EmbeddedResource Include="FunctionCode\Make\Make_ColorBoxWeigh.resx">
       <DependentUpon>Make_ColorBoxWeigh.cs</DependentUpon>
     </EmbeddedResource>
-    <EmbeddedResource Include="FunctionCode\Make\Make_CustomLabelPrint.resx">
-      <DependentUpon>Make_CustomLabelPrint.cs</DependentUpon>
-    </EmbeddedResource>
     <EmbeddedResource Include="FunctionCode\Make\Make_Decompose.resx">
       <DependentUpon>Make_Decompose.cs</DependentUpon>
     </EmbeddedResource>
@@ -1564,6 +1557,9 @@
     <EmbeddedResource Include="FunctionCode\Special\Special_CancelProdinout.resx">
       <DependentUpon>Special_CancelProdinout.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="FunctionCode\Special\Special_GetBad.resx">
+      <DependentUpon>Special_GetBad.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="FunctionCode\Special\Special_MendLabel.resx">
       <DependentUpon>Special_MendLabel.cs</DependentUpon>
     </EmbeddedResource>
@@ -1709,6 +1705,8 @@
     <Content Include="Resources\Button\White-side.png" />
     <Content Include="Resources\change_password.png" />
     <None Include="Resources\Sound\4082.wav" />
+    <Content Include="Resources\Sound\FAIL.wav" />
+    <Content Include="Resources\Sound\PASS.wav" />
     <Content Include="Tool\DevComponents.DotNetBar2.dll" />
     <Content Include="Tool\DevExpress.BonusSkins.v15.2.dll" />
     <Content Include="Tool\DevExpress.Data.v15.2.dll" />
@@ -1802,6 +1800,15 @@
     <Content Include="Resources\zxing_android_code_48px_1107946_easyicon.net.png" />
   </ItemGroup>
   <ItemGroup>
+    <COMReference Include="BarTender">
+      <Guid>{D58562C1-E51B-11CF-8941-00A024A9083F}</Guid>
+      <VersionMajor>10</VersionMajor>
+      <VersionMinor>1</VersionMinor>
+      <Lcid>0</Lcid>
+      <WrapperTool>tlbimp</WrapperTool>
+      <Isolated>False</Isolated>
+      <EmbedInteropTypes>True</EmbedInteropTypes>
+    </COMReference>
     <COMReference Include="LabelManager2">
       <Guid>{3624B9C2-9E5D-11D3-A896-00C04F324E22}</Guid>
       <VersionMajor>6</VersionMajor>

+ 1 - 1
UAS_MES_WEIP/App.config

@@ -78,7 +78,7 @@
   <applicationSettings>
     <UAS_MES_NEW.Properties.Settings>
       <setting name="MES" serializeAs="String">
-        <value>Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.105)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));</value>
+        <value>Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=usoft.f3322.net)(PORT=11585)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));</value>
       </setting>
     </UAS_MES_NEW.Properties.Settings>
     <UAS_MES.Properties.Settings>

+ 64 - 2
UAS_MES_WEIP/DataOperate/ExcelHandler.cs

@@ -57,7 +57,7 @@ namespace UAS_MES_NEW.DataOperate
         {
             DataTable dt = new DataTable();
             dt.TableName = TableName;
-            if (FolderPath.Contains(".xls") || FolderPath.Contains(".xlsx"))
+            if (FolderPath.Contains(".xls") || FolderPath.Contains(".xlsx")|| FolderPath.Contains(".XLS") || FolderPath.Contains(".XLSX"))
             {
                 using (FileStream file = new FileStream(FolderPath, FileMode.Open, FileAccess.Read))
                 {
@@ -67,7 +67,7 @@ namespace UAS_MES_NEW.DataOperate
                     //获取所有的列名
                     foreach (ICell item in sheet.GetRow(sheet.FirstRowNum).Cells)
                     {
-                        dt.Columns.Add(item.ToString(), typeof(string));
+                        dt.Columns.Add(item.ToString().Trim(), typeof(string));
                     }
 
                     System.Collections.IEnumerator rows = sheet.GetRowEnumerator();
@@ -159,9 +159,71 @@ namespace UAS_MES_NEW.DataOperate
                     }
                 }
             }
+            if (FolderPath.Contains(".csv"))
+            {
+                dt = ReadFromCSV(FolderPath);
+
+            }
+            return dt;
+        }
+
+
+        /// <summary>
+        /// 将CSV文件中内容读取到DataTable中
+        /// </summary>
+        /// <param name="path">CSV文件路径</param>
+        /// <param name="hasTitle">是否将CSV文件的第一行读取为DataTable的列名</param>
+        /// <returns></returns>
+        public static DataTable ReadFromCSV(string path, bool hasTitle = true)
+        {
+            DataTable dt = new DataTable();           //要输出的数据表
+            StreamReader sr = new StreamReader(path, System.Text.Encoding.GetEncoding("GB2312")); //文件读入流
+            bool bFirst = true;                       //指示是否第一次读取数据
+
+            //逐行读取
+            string line;
+            while ((line = sr.ReadLine()) != null)
+            {
+                string[] elements = line.Replace("\r", "").Replace("\n", "").Replace("\t", "").Split(',');
+
+                //第一次读取数据时,要创建数据列
+                if (bFirst)
+                {
+                    for (int i = 0; i < elements.Length; i++)
+                    {
+                        dt.Columns.Add();
+                    }
+                    bFirst = false;
+                }
+
+                //有标题行时,第一行当做标题行处理
+                if (hasTitle)
+                {
+                    for (int i = 0; i < dt.Columns.Count && i < elements.Length; i++)
+                    {
+                        dt.Columns[i].ColumnName = elements[i];
+                    }
+                    hasTitle = false;
+                }
+                else //读取一行数据
+                {
+                    if (elements.Length == dt.Columns.Count)
+                    {
+                        dt.Rows.Add(elements);
+                    }
+                    else
+                    {
+                        //throw new Exception("CSV格式错误:表格各行列数不一致");
+                    }
+                }
+            }
+            sr.Close();
+
             return dt;
         }
 
+
+
         public void WriteTxt(DataTable dt, string FolderPath, string FileName)
         {
             StreamWriter sr;

+ 181 - 0
UAS_MES_WEIP/FunctionCode/Make/Make_NewPo.Designer.cs

@@ -0,0 +1,181 @@
+namespace UAS_MES_NEW.Make
+{
+    partial class Make_NewPo
+    {
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows Form Designer generated code
+
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.components = new System.ComponentModel.Container();
+            this.label3 = new System.Windows.Forms.Label();
+            this.headBar1 = new UAS_MES_NEW.CustomControl.HeadBar();
+            this.BadInfo = new System.Windows.Forms.BindingSource(this.components);
+            this.BatchProductDGV = new UAS_MES_NEW.CustomControl.DataGrid_View.DataGridViewWithSerialNum();
+            this.mss_linecode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.mss_makecode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.sp_soncode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.mss_prodcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.sp_oneuseqty = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.mss_qty = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.mss_remain = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.mss_useqty = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            ((System.ComponentModel.ISupportInitialize)(this.BadInfo)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.BatchProductDGV)).BeginInit();
+            this.SuspendLayout();
+            // 
+            // label3
+            // 
+            this.label3.AutoSize = true;
+            this.label3.BackColor = System.Drawing.SystemColors.ControlDarkDark;
+            this.label3.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label3.ForeColor = System.Drawing.SystemColors.ControlLightLight;
+            this.label3.Location = new System.Drawing.Point(6, 5);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(106, 21);
+            this.label3.TabIndex = 99;
+            this.label3.Text = "岗位备料汇总";
+            // 
+            // headBar1
+            // 
+            this.headBar1.BackColor = System.Drawing.SystemColors.ControlDarkDark;
+            this.headBar1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+            this.headBar1.Dock = System.Windows.Forms.DockStyle.Top;
+            this.headBar1.Location = new System.Drawing.Point(0, 0);
+            this.headBar1.Margin = new System.Windows.Forms.Padding(4);
+            this.headBar1.Name = "headBar1";
+            this.headBar1.Size = new System.Drawing.Size(735, 32);
+            this.headBar1.TabIndex = 98;
+            this.headBar1.Title = null;
+            this.headBar1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.headBar1_MouseDown);
+            // 
+            // BatchProductDGV
+            // 
+            this.BatchProductDGV.AllowUserToAddRows = false;
+            this.BatchProductDGV.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+            this.BatchProductDGV.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
+            this.mss_linecode,
+            this.mss_makecode,
+            this.sp_soncode,
+            this.mss_prodcode,
+            this.sp_oneuseqty,
+            this.mss_qty,
+            this.mss_remain,
+            this.mss_useqty});
+            this.BatchProductDGV.EnableContentClick = true;
+            this.BatchProductDGV.Location = new System.Drawing.Point(0, 29);
+            this.BatchProductDGV.Name = "BatchProductDGV";
+            this.BatchProductDGV.RowTemplate.Height = 23;
+            this.BatchProductDGV.Size = new System.Drawing.Size(735, 458);
+            this.BatchProductDGV.TabIndex = 175;
+            // 
+            // mss_linecode
+            // 
+            this.mss_linecode.DataPropertyName = "mss_linecode";
+            this.mss_linecode.HeaderText = "线别";
+            this.mss_linecode.Name = "mss_linecode";
+            // 
+            // mss_makecode
+            // 
+            this.mss_makecode.DataPropertyName = "mss_makecode";
+            this.mss_makecode.HeaderText = "工单号";
+            this.mss_makecode.Name = "mss_makecode";
+            // 
+            // sp_soncode
+            // 
+            this.sp_soncode.DataPropertyName = "sp_fsoncode";
+            this.sp_soncode.HeaderText = "首选料号";
+            this.sp_soncode.Name = "sp_soncode";
+            this.sp_soncode.ReadOnly = true;
+            // 
+            // mss_prodcode
+            // 
+            this.mss_prodcode.DataPropertyName = "sp_soncode";
+            this.mss_prodcode.HeaderText = "备选料号";
+            this.mss_prodcode.Name = "mss_prodcode";
+            this.mss_prodcode.ReadOnly = true;
+            // 
+            // sp_oneuseqty
+            // 
+            this.sp_oneuseqty.DataPropertyName = "sp_oneuseqty";
+            this.sp_oneuseqty.HeaderText = "单位用量";
+            this.sp_oneuseqty.Name = "sp_oneuseqty";
+            this.sp_oneuseqty.ReadOnly = true;
+            // 
+            // mss_qty
+            // 
+            this.mss_qty.DataPropertyName = "mss_qty";
+            this.mss_qty.HeaderText = "备料数量";
+            this.mss_qty.Name = "mss_qty";
+            // 
+            // mss_remain
+            // 
+            this.mss_remain.DataPropertyName = "mss_remain";
+            this.mss_remain.HeaderText = "剩余数";
+            this.mss_remain.Name = "mss_remain";
+            this.mss_remain.ReadOnly = true;
+            // 
+            // mss_useqty
+            // 
+            this.mss_useqty.DataPropertyName = "mss_useqty";
+            this.mss_useqty.HeaderText = "已用数量";
+            this.mss_useqty.Name = "mss_useqty";
+            this.mss_useqty.ReadOnly = true;
+            // 
+            // Make_NewPo
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.BackColor = System.Drawing.SystemColors.HighlightText;
+            this.ClientSize = new System.Drawing.Size(735, 486);
+            this.Controls.Add(this.BatchProductDGV);
+            this.Controls.Add(this.label3);
+            this.Controls.Add(this.headBar1);
+            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
+            this.Name = "Make_NewPo";
+            this.Tag = "ShowDialogWindow";
+            this.Text = "备料信息汇总";
+            this.Load += new System.EventHandler(this.Make_NewBadCode_Load);
+            ((System.ComponentModel.ISupportInitialize)(this.BadInfo)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.BatchProductDGV)).EndInit();
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+        private CustomControl.HeadBar headBar1;
+        private System.Windows.Forms.Label label3;
+        private System.Windows.Forms.BindingSource BadInfo;
+        private CustomControl.DataGrid_View.DataGridViewWithSerialNum BatchProductDGV;
+        private System.Windows.Forms.DataGridViewTextBoxColumn mss_linecode;
+        private System.Windows.Forms.DataGridViewTextBoxColumn mss_makecode;
+        private System.Windows.Forms.DataGridViewTextBoxColumn sp_soncode;
+        private System.Windows.Forms.DataGridViewTextBoxColumn mss_prodcode;
+        private System.Windows.Forms.DataGridViewTextBoxColumn sp_oneuseqty;
+        private System.Windows.Forms.DataGridViewTextBoxColumn mss_qty;
+        private System.Windows.Forms.DataGridViewTextBoxColumn mss_remain;
+        private System.Windows.Forms.DataGridViewTextBoxColumn mss_useqty;
+    }
+}

+ 89 - 0
UAS_MES_WEIP/FunctionCode/Make/Make_NewPo.cs

@@ -0,0 +1,89 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Runtime.InteropServices;
+using System.Text;
+using System.Windows.Forms;
+using UAS_MES_NEW.DataOperate;
+using UAS_MES_NEW.Entity;
+using UAS_MES_NEW.PublicMethod;
+
+namespace UAS_MES_NEW.Make
+{
+    public partial class Make_NewPo : CustomControl.BaseForm.BaseForm
+    {
+        //所有用到了headBar的部分都需要这段代码
+        [DllImport("user32.dll")]
+        public static extern bool ReleaseCapture();
+
+        [DllImport("user32.dll")]
+        public static extern bool SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam);
+
+        [DllImport("user32.dll", EntryPoint = "GetWindowLong", CharSet = CharSet.Auto)]
+        public static extern int GetWindowLong(HandleRef hWnd, int nIndex);
+
+        [DllImport("user32.dll", EntryPoint = "SetWindowLong", CharSet = CharSet.Auto)]
+        public static extern IntPtr SetWindowLong(HandleRef hWnd, int nIndex, int dwNewLong);
+
+        public const int WM_SYSCOMMAND = 0x0112;
+        public const int SC_MOVE = 0xF010;
+        public const int HTCAPTION = 0x0002;
+        /// <summary>
+        /// 序列号
+        /// </summary>
+        string sncode = "";
+        /// <summary>
+        /// 工单号
+        /// </summary>
+        string macode = "";
+        string licode = "";
+
+        DataHelper dh;
+
+        DataTable dt;
+
+        LogStringBuilder sql = new LogStringBuilder();
+
+        public Make_NewPo(string iMakeCode,string iLicode)
+        {
+            InitializeComponent();
+            macode = iMakeCode;
+            licode = iLicode;
+        }
+
+        private void Make_NewBadCode_Load(object sender, EventArgs e)
+        {
+            dh = SystemInf.dh;
+
+            sql.Clear();
+            //sql.Append("select nvl(mss_makecode,' ') mss_makecode,mss_linecode,sp_fsoncode,nvl(mss_id,0) mss_id,sp_soncode,mss_prodcode,sp_oneuseqty,mss_barcode,nvl(mss_qty,0) mss_qty ,nvl(mss_remain,0)mss_remain,");
+            //sql.Append("pr_detail,nvl(mss_useqty,0) mss_useqty from stepbom left join stepproduct on sp_sbid=sb_id left join product on ");
+            //sql.Append("pr_code=sp_mothercode left join makesourcestock on  mss_craftcode=sb_craftcode ");
+            //sql.Append("and mss_stepcode=sp_stepcode and sp_soncode=mss_prodcode and sp_fsoncode=mss_fprodcode where  ");
+            //sql.Append(" sp_stepcode='" + User.CurrentStepCode + "' and sp_tracekind=2 and mss_linecode = '" + User.UserLineCode + "' order  by sp_soncode");
+            sql.Append("select * from MAKESOURCESTOCK_SUM_VIEW where mss_makecode = '" + macode + "' and mss_linecode = '" + licode + "'");
+            DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+            BaseUtil.FillDgvWithDataTable(BatchProductDGV, dt);
+
+        }
+
+    
+
+    
+
+  
+
+     
+
+        private void headBar1_MouseDown(object sender, MouseEventArgs e)
+        {
+            ReleaseCapture();
+            SendMessage(this.Handle, WM_SYSCOMMAND, SC_MOVE + HTCAPTION, 0);
+        }
+
+     
+    }
+}

+ 147 - 0
UAS_MES_WEIP/FunctionCode/Make/Make_NewPo.resx

@@ -0,0 +1,147 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <metadata name="BadInfo.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </metadata>
+  <metadata name="mss_linecode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="mss_makecode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="sp_soncode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="mss_prodcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="sp_oneuseqty.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="mss_qty.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="mss_remain.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="mss_useqty.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+</root>

+ 22 - 0
UAS_MES_WEIP/FunctionCode/Make/Make_PositionStock.Designer.cs

@@ -64,6 +64,7 @@
             this.pr_detail = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
             this.ma_prodcode = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
             this.Screen = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
+            this.normalButton2 = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
             ((System.ComponentModel.ISupportInitialize)(this.BatchProductDGV)).BeginInit();
             this.SuspendLayout();
             // 
@@ -180,6 +181,7 @@
             // 
             // show_all_check
             // 
+            this.show_all_check.AllPower = null;
             this.show_all_check.AutoSize = true;
             this.show_all_check.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.show_all_check.Location = new System.Drawing.Point(642, 79);
@@ -452,11 +454,30 @@
             this.Screen.UseVisualStyleBackColor = true;
             this.Screen.Click += new System.EventHandler(this.Screen_Click);
             // 
+            // normalButton2
+            // 
+            this.normalButton2.AllPower = null;
+            this.normalButton2.BackColor = System.Drawing.Color.Transparent;
+            this.normalButton2.DownImage = ((System.Drawing.Image)(resources.GetObject("normalButton2.DownImage")));
+            this.normalButton2.Image = null;
+            this.normalButton2.IsShowBorder = true;
+            this.normalButton2.Location = new System.Drawing.Point(320, 80);
+            this.normalButton2.MoveImage = ((System.Drawing.Image)(resources.GetObject("normalButton2.MoveImage")));
+            this.normalButton2.Name = "normalButton2";
+            this.normalButton2.NormalImage = ((System.Drawing.Image)(resources.GetObject("normalButton2.NormalImage")));
+            this.normalButton2.Power = null;
+            this.normalButton2.Size = new System.Drawing.Size(107, 28);
+            this.normalButton2.TabIndex = 228;
+            this.normalButton2.Text = "备料条码汇总";
+            this.normalButton2.UseVisualStyleBackColor = false;
+            this.normalButton2.Click += new System.EventHandler(this.normalButton2_Click);
+            // 
             // Make_PositionStock
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(922, 510);
+            this.Controls.Add(this.normalButton2);
             this.Controls.Add(this.normalButton1);
             this.Controls.Add(this.show_all_check);
             this.Controls.Add(this.ma_bomversion);
@@ -526,5 +547,6 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn pr_detail1;
         private System.Windows.Forms.DataGridViewTextBoxColumn pr_spec;
         private System.Windows.Forms.DataGridViewImageColumn DeleteRow;
+        private CustomControl.ButtonUtil.NormalButton normalButton2;
     }
 }

+ 7 - 0
UAS_MES_WEIP/FunctionCode/Make/Make_PositionStock.cs

@@ -403,5 +403,12 @@ namespace UAS_MES_NEW.Make
                 OperateResult.AppendText(">>没有上料记录,无需全部下料\n", Color.Red);
             }
         }
+
+        private void normalButton2_Click(object sender, EventArgs e)
+        {
+            Make_NewPo badcode = new Make_NewPo(ma_code.Text,User.UserLineCode);
+            BaseUtil.SetFormCenter(badcode);
+            badcode.ShowDialog();
+        }
     }
 }

+ 17 - 2
UAS_MES_WEIP/FunctionCode/Make/Make_Repair.Designer.cs

@@ -59,6 +59,7 @@
             this.bc_code1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
             this.bc_name1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
             this.BadInfo = new System.Windows.Forms.BindingSource(this.components);
+            this.checkBox1 = new System.Windows.Forms.CheckBox();
             this.Filter = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.TextBoxWithPlaceHolder();
             this.badgroup = new UAS_MES_NEW.CustomControl.ComBoxWithFocus.ComBoxWithFocus();
             this.normalButton1 = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
@@ -230,7 +231,7 @@
             | System.Windows.Forms.AnchorStyles.Left)));
             this.GetSNCode_Label.AutoSize = true;
             this.GetSNCode_Label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.GetSNCode_Label.Location = new System.Drawing.Point(320, 533);
+            this.GetSNCode_Label.Location = new System.Drawing.Point(320, 542);
             this.GetSNCode_Label.Name = "GetSNCode_Label";
             this.GetSNCode_Label.Size = new System.Drawing.Size(58, 21);
             this.GetSNCode_Label.TabIndex = 113;
@@ -341,12 +342,14 @@
             this.bg_name1,
             this.bc_code1,
             this.bc_name1});
+            this.WaitRejectList.FullRowSelect = true;
             this.WaitRejectList.Location = new System.Drawing.Point(6, 325);
             this.WaitRejectList.Name = "WaitRejectList";
             this.WaitRejectList.Size = new System.Drawing.Size(244, 244);
             this.WaitRejectList.TabIndex = 141;
             this.WaitRejectList.UseCompatibleStateImageBehavior = false;
             this.WaitRejectList.View = System.Windows.Forms.View.Details;
+            this.WaitRejectList.DoubleClick += new System.EventHandler(this.WaitRejectList_DoubleClick);
             // 
             // columnHeader5
             // 
@@ -373,6 +376,16 @@
             this.bc_name1.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
             this.bc_name1.Width = 80;
             // 
+            // checkBox1
+            // 
+            this.checkBox1.AutoSize = true;
+            this.checkBox1.Location = new System.Drawing.Point(634, 544);
+            this.checkBox1.Name = "checkBox1";
+            this.checkBox1.Size = new System.Drawing.Size(108, 16);
+            this.checkBox1.TabIndex = 146;
+            this.checkBox1.Text = "良品采集成不良";
+            this.checkBox1.UseVisualStyleBackColor = true;
+            // 
             // Filter
             // 
             this.Filter.BackColor = System.Drawing.Color.Transparent;
@@ -891,7 +904,7 @@
             | System.Windows.Forms.AnchorStyles.Left)));
             this.GetSNCode.BackColor = System.Drawing.Color.White;
             this.GetSNCode.ID = null;
-            this.GetSNCode.Location = new System.Drawing.Point(419, 533);
+            this.GetSNCode.Location = new System.Drawing.Point(419, 542);
             this.GetSNCode.Name = "GetSNCode";
             this.GetSNCode.Power = null;
             this.GetSNCode.Size = new System.Drawing.Size(188, 21);
@@ -1086,6 +1099,7 @@
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(900, 579);
+            this.Controls.Add(this.checkBox1);
             this.Controls.Add(this.Filter);
             this.Controls.Add(this.label1);
             this.Controls.Add(this.badgroup);
@@ -1230,5 +1244,6 @@
         private System.Windows.Forms.ColumnHeader bc_code1;
         private System.Windows.Forms.ColumnHeader bc_name1;
         private System.Windows.Forms.BindingSource BadInfo;
+        private System.Windows.Forms.CheckBox checkBox1;
     }
 }

+ 64 - 1
UAS_MES_WEIP/FunctionCode/Make/Make_Repair.cs

@@ -158,7 +158,7 @@ namespace UAS_MES_NEW.Make
                     return;
                 }
                 sql.Clear();
-                sql.Append("select ms_status,ms_outboxcode,ms_paststep,ms_reworkstatus,nvl(ms_ifrework,0)ms_ifrework from makeserial left join make ");
+                sql.Append("select ms_status,ms_outboxcode,ms_paststep,ms_reworkstatus,nvl(ms_ifrework,0)ms_ifrework,ms_makecode from makeserial left join make ");
                 sql.Append("on ms_makecode=ma_code where ms_sncode = '" + GetSNCode.Text + "' order by ms_id desc");
                 dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                 string ms_paststep = "";
@@ -168,6 +168,7 @@ namespace UAS_MES_NEW.Make
                     ms_paststep = dt.Rows[0]["ms_paststep"].ToString();
                     ifrework = dt.Rows[0]["ms_ifrework"].ToString();
                     reworkstatus = dt.Rows[0]["ms_reworkstatus"].ToString();
+                    string ms_makecode = dt.Rows[0]["ms_makecode"].ToString();
                     if (dt.Rows[0]["ms_outboxcode"].ToString() != "")
                     {
                         OperatResult.AppendText(">>序列号:" + GetSNCode.Text + "已装箱,请先进行拆箱\n", Color.Red);
@@ -175,6 +176,55 @@ namespace UAS_MES_NEW.Make
                         BadCodeTree.Nodes.Clear();
                         return;
                     }
+                    if (checkBox1.Checked)
+                    {
+                        if (ms_status == "3")
+                        {
+                            OperatResult.AppendText(">>序列号:" + GetSNCode.Text + "处于维修状态\n", Color.Red);
+                            BaseUtil.CleanForm(this);
+                            BadCodeTree.Nodes.Clear();
+                            return;
+                        }
+                        ////如果存在送检批号则进行删除
+                        //if (dh.CheckExist("oqcbatchdetail", "obd_sncode='" +  GetSNCode.Text + "'"))
+                        //{
+                        //    string checkno = dh.getFieldDataByCondition("oqcbatchdetail", "obd_checkno", "obd_sncode='" +  GetSNCode.Text + "'").ToString();
+                        //    string ifng = dh.getFieldDataByCondition("oqcbatchdetail", "obd_ifng", "obd_sncode='" +  GetSNCode.Text + "'").ToString();
+                        //    if (ifng == "-1")
+                        //    {
+                        //        dh.ExecuteSql("delete OQCITEMSAMPLES where ois_sncode = '" +  GetSNCode.Text + "'", "select");
+                        //        dh.ExecuteSql("update oqcbatch set ob_nowcheckqty=ob_nowcheckqty-1,ob_ngqty =  ob_ngqty -1 where ob_checkno='" + checkno + "'", "update");
+                        //    }
+                        //    dh.ExecuteSql("delete from oqcbatchdetail where obd_sncode='" +  GetSNCode.Text + "'", "delete");
+                        //}
+                        ////之前保存的不良就不再调用
+                        //DataTable dt = dh.getFieldsDataByCondition("makeserial", new string[] { "ms_stepcode", "nvl(ms_ifrework,0)ms_ifrework", "ms_status" }, "ms_sncode='" +  GetSNCode.Text + "' and ms_makecode='" + ms_makecode + "'");
+                        //if (dt.Rows.Count > 0)
+                        //{
+                        //    string ifrework = dt.Rows[0]["ms_ifrework"].ToString();
+                        //    string ms_stepcode = dt.Rows[0]["ms_stepcode"].ToString();
+                        //    if (ms_status == "2")
+                        //    {
+                        //        dh.UpdateByCondition("make", "ma_madeqty=nvl(ma_madeqty,0)-1", "ma_code='" + ms_makecode + "'");
+                        //    }
+                        //    dh.UpdateByCondition("makeserial", "ms_nextstepcode='',ms_status=3", "ms_sncode='" +  GetSNCode.Text + "' and ms_makecode='" + ms_makecode + "' ");
+                        //}
+                        string ErrorMessage1 =" ";
+                        string sp_id = dh.getFieldDataByCondition("steppassed", "max(sp_id)", "sp_makecode = '"+ ms_makecode + "' and sp_sncode = '"+ GetSNCode.Text + "' and sp_result = '良品'").ToString();
+                        if (sp_id != "")
+                        {
+                            string usecode = dh.getFieldDataByCondition("steppassed", "sp_sccode", "sp_id = " + sp_id + "").ToString();
+                            string stepcpde = dh.getFieldDataByCondition("steppassed", "sp_stepcode", "sp_id = " + sp_id + "").ToString();
+                            dh.UpdateByCondition("steppassed", "sp_result='不良品',sp_ifng=-1,sp_ymd=to_char(sysdate,'yyyymmdd'),sp_hm=to_char(sysdate,'hh24miss')", "sp_id=" + sp_id + "");
+                            dh.UpdateByCondition("makecraftdetail", "mcd_okqty=mcd_okqty-1", "mcd_macode='" + ms_makecode + "' and mcd_stepcode='" + stepcpde + "'");
+
+                        }
+                        LogicHandler.SetTestNGDetail(GetSNCode.Text, ms_makecode, User.UserCode, User.UserSourceCode, "检查未通过", out ErrorMessage1);
+                        LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_makecode, User.UserLineCode, User.UserSourceCode, "采集成不良", "维修采集不良",  GetSNCode.Text, "");
+                        OperatResult.AppendText(">>序列号:" +  GetSNCode.Text + "不良采集成功\n", Color.Green, GetSNCode);
+                        return;
+                    }
+
                     //如果不是返修序列号执行原来的步骤
                     if (ifrework == "0")
                     {
@@ -1121,5 +1171,18 @@ namespace UAS_MES_NEW.Make
                 }
             }
         }
+
+        private void WaitRejectList_DoubleClick(object sender, EventArgs e)
+        {
+            for (int i = WaitRejectList.Items.Count - 1; i >= 0; i--)
+            {
+                if (WaitRejectList.Items[i].Checked)
+                {
+                    //双击右移
+                    Filter.Text = WaitRejectList.Items[i].SubItems[3].Text;
+                    Filter_UserControlOnKeyDown(sender, new KeyEventArgs(Keys.Enter));
+                }
+            }
+        }
     }
 }

+ 0 - 12
UAS_MES_WEIP/FunctionCode/Make/Make_Repair.resx

@@ -247,18 +247,6 @@
   <metadata name="DeleteCom.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
-  <metadata name="mbp_part1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="DeleteCom.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="mbl_loc1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="DeletePos.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
   <metadata name="mbl_loc1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>

+ 64 - 5
UAS_MES_WEIP/FunctionCode/Make/Make_SMTBind.Designer.cs

@@ -84,6 +84,10 @@
             this.code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SnCollectionBox();
             this.sn_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.dataGridViewTextBoxColumn6 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.normalButton2 = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
+            this.textBox1 = new System.Windows.Forms.TextBox();
+            this.normalButton3 = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
+            this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
             ((System.ComponentModel.ISupportInitialize)(this.ClearSn_code)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.LabelDataGridView)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.pr_pcbacount)).BeginInit();
@@ -171,7 +175,7 @@
             this.UnLoading.AutoSize = true;
             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(121, 11);
+            this.UnLoading.Location = new System.Drawing.Point(82, 10);
             this.UnLoading.Name = "UnLoading";
             this.UnLoading.Size = new System.Drawing.Size(60, 25);
             this.UnLoading.TabIndex = 63;
@@ -299,7 +303,7 @@
             // 
             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(279, 361);
+            this.label2.Location = new System.Drawing.Point(170, 363);
             this.label2.Name = "label2";
             this.label2.Size = new System.Drawing.Size(58, 21);
             this.label2.TabIndex = 200;
@@ -307,7 +311,7 @@
             // 
             // pr_pcbacount
             // 
-            this.pr_pcbacount.Location = new System.Drawing.Point(348, 364);
+            this.pr_pcbacount.Location = new System.Drawing.Point(239, 366);
             this.pr_pcbacount.Margin = new System.Windows.Forms.Padding(2);
             this.pr_pcbacount.Name = "pr_pcbacount";
             this.pr_pcbacount.ReadOnly = true;
@@ -424,7 +428,7 @@
             this.groupBox1.Controls.Add(this.Loading);
             this.groupBox1.Location = new System.Drawing.Point(18, 349);
             this.groupBox1.Name = "groupBox1";
-            this.groupBox1.Size = new System.Drawing.Size(200, 43);
+            this.groupBox1.Size = new System.Drawing.Size(146, 43);
             this.groupBox1.TabIndex = 213;
             this.groupBox1.TabStop = false;
             // 
@@ -657,7 +661,7 @@
             this.Clean.DownImage = ((System.Drawing.Image)(resources.GetObject("Clean.DownImage")));
             this.Clean.Image = ((System.Drawing.Image)(resources.GetObject("Clean.Image")));
             this.Clean.IsShowBorder = true;
-            this.Clean.Location = new System.Drawing.Point(460, 439);
+            this.Clean.Location = new System.Drawing.Point(545, 460);
             this.Clean.MoveImage = ((System.Drawing.Image)(resources.GetObject("Clean.MoveImage")));
             this.Clean.Name = "Clean";
             this.Clean.NormalImage = ((System.Drawing.Image)(resources.GetObject("Clean.NormalImage")));
@@ -726,11 +730,62 @@
             this.dataGridViewTextBoxColumn6.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
             this.dataGridViewTextBoxColumn6.Width = 300;
             // 
+            // normalButton2
+            // 
+            this.normalButton2.AllPower = null;
+            this.normalButton2.BackColor = System.Drawing.Color.Transparent;
+            this.normalButton2.DownImage = ((System.Drawing.Image)(resources.GetObject("normalButton2.DownImage")));
+            this.normalButton2.Image = null;
+            this.normalButton2.IsShowBorder = true;
+            this.normalButton2.Location = new System.Drawing.Point(429, 359);
+            this.normalButton2.MoveImage = ((System.Drawing.Image)(resources.GetObject("normalButton2.MoveImage")));
+            this.normalButton2.Name = "normalButton2";
+            this.normalButton2.NormalImage = ((System.Drawing.Image)(resources.GetObject("normalButton2.NormalImage")));
+            this.normalButton2.Power = null;
+            this.normalButton2.Size = new System.Drawing.Size(111, 28);
+            this.normalButton2.TabIndex = 216;
+            this.normalButton2.Text = "导入镭雕日志";
+            this.normalButton2.UseVisualStyleBackColor = false;
+            this.normalButton2.Click += new System.EventHandler(this.normalButton2_Click);
+            // 
+            // textBox1
+            // 
+            this.textBox1.Location = new System.Drawing.Point(321, 398);
+            this.textBox1.Name = "textBox1";
+            this.textBox1.ReadOnly = true;
+            this.textBox1.Size = new System.Drawing.Size(219, 21);
+            this.textBox1.TabIndex = 217;
+            // 
+            // normalButton3
+            // 
+            this.normalButton3.AllPower = null;
+            this.normalButton3.BackColor = System.Drawing.Color.Transparent;
+            this.normalButton3.DownImage = ((System.Drawing.Image)(resources.GetObject("normalButton3.DownImage")));
+            this.normalButton3.Image = null;
+            this.normalButton3.IsShowBorder = true;
+            this.normalButton3.Location = new System.Drawing.Point(460, 425);
+            this.normalButton3.MoveImage = ((System.Drawing.Image)(resources.GetObject("normalButton3.MoveImage")));
+            this.normalButton3.Name = "normalButton3";
+            this.normalButton3.NormalImage = ((System.Drawing.Image)(resources.GetObject("normalButton3.NormalImage")));
+            this.normalButton3.Power = null;
+            this.normalButton3.Size = new System.Drawing.Size(75, 28);
+            this.normalButton3.TabIndex = 218;
+            this.normalButton3.Text = "确认导入";
+            this.normalButton3.UseVisualStyleBackColor = false;
+            this.normalButton3.Click += new System.EventHandler(this.normalButton3_Click);
+            // 
+            // openFileDialog1
+            // 
+            this.openFileDialog1.FileName = "openFileDialog1";
+            // 
             // Make_SMTBind
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(898, 487);
+            this.Controls.Add(this.normalButton3);
+            this.Controls.Add(this.textBox1);
+            this.Controls.Add(this.normalButton2);
             this.Controls.Add(this.sqit);
             this.Controls.Add(this.spit);
             this.Controls.Add(this.groupBox1);
@@ -847,5 +902,9 @@
         private System.Windows.Forms.GroupBox groupBox1;
         private System.Windows.Forms.NumericUpDown sqit;
         private System.Windows.Forms.Label spit;
+        private CustomControl.ButtonUtil.NormalButton normalButton2;
+        private System.Windows.Forms.TextBox textBox1;
+        private CustomControl.ButtonUtil.NormalButton normalButton3;
+        private System.Windows.Forms.OpenFileDialog openFileDialog1;
     }
 }

+ 59 - 0
UAS_MES_WEIP/FunctionCode/Make/Make_SMTBind.cs

@@ -28,6 +28,10 @@ namespace UAS_MES_NEW.Make
         //保存ListB中的数据
         DataTable dt1;
 
+        DataTable dt = new DataTable();
+        DataTable dbfind;
+        ExcelHandler eh;
+
         Thread thread;
 
         AutoSizeFormClass asc = new AutoSizeFormClass();
@@ -49,6 +53,7 @@ namespace UAS_MES_NEW.Make
             LockMakeCode.GetMakeCodeCtl(ma_code);
             ma_code.SetLockCheckBox(LockMakeCode);
             //工单号放大镜配置
+            eh = new ExcelHandler();
             ma_code.TableName = "make left join product on ma_prodcode=pr_code";
             ma_code.SelectField = "ma_code # 工单号,ma_prodcode # 产品编号,ma_qty # 工单数量,ma_craftcode # 途程编号,pr_spec # 产品名称,ma_bomversion # Bom版本,ma_softversion # 软件版本,ma_ecncode # ECN号,pr_pcbacount # 拼版数";
             ma_code.FormName = Name;
@@ -617,6 +622,60 @@ namespace UAS_MES_NEW.Make
             }
         }
 
+        private void normalButton2_Click(object sender, EventArgs e)
+        {
+            DialogResult result = openFileDialog1.ShowDialog();
+            if (result == DialogResult.OK)
+            {
+                textBox1.Text = openFileDialog1.FileName;
+            }
+        }
 
+        private void normalButton3_Click(object sender, EventArgs e)
+        {
+            if (ma_code.Text == "" || textBox1.Text == "" || ma_prodcode.Text == "")
+            {
+                MessageBox.Show("工单号,产品编号与文件地址不可为空");
+                return;
+            }
+            dt = eh.ImportExcel(textBox1.Text, "test");
+            int number = 0;
+
+            //for (int i = 0; i < dt.Rows.Count; i++)
+            //{
+            //    MessageBox.Show(dt.Rows[i]["RefDes"].ToString()+":"+ dt.Rows[i]["Layer"].ToString());
+            //}
+            //BaseUtil.FillDgvWithDataTable(LabelDataGridView, dt);
+
+            List<string> maincodelist = new List<string>();
+            List<string> nowcodelist = new List<string>();
+            for (int i = 0; i < dt.Rows.Count; i++)
+            {
+                if (dt.Rows[i]["工单"].ToString().Trim()==ma_code.Text&&dt.Rows[i]["拼板号"].ToString().Trim().Length >2 && dt.Rows[i]["读码内容"].ToString().Trim().Length > 2 && dt.Rows[i]["拼板号"].ToString().Trim().Substring(0, 2)
+                    == dt.Rows[i]["读码内容"].ToString().Trim().Substring(0, 2))
+                {
+                    maincodelist.Add(dt.Rows[i]["拼板号"].ToString().Trim());
+                    nowcodelist.Add(dt.Rows[i]["读码内容"].ToString().Trim());
+                    number++;
+                }
+            }
+
+            sql.Clear();
+            sql.Append("insert into smtbind_temp(MAINCODE,BARCODE)");
+            sql.Append("values(:maincode,:nowcode)");
+
+            dh.BatchInsert(sql.GetString(), new string[] { "maincode", "nowcode" }, maincodelist.ToArray(), nowcodelist.ToArray());
+
+            sql.Clear();
+            sql.Append("merge  into smtbind using SMTBIND_TEMP  on (sb_barcode = barcode) when not MATCHED then insert  (sb_id,sb_maincode,sb_barcode,sb_makecode,sb_prodcode,sb_inman,sb_indate,sb_status)");
+            sql.Append(" values (SMTBIND_seq.nextval ,maincode,barcode,'" + ma_code.Text + "','"+ma_prodcode.Text+"','"+User.UserCode+"',sysdate,0)");
+            dh.ExecuteSql(sql.GetString(), "insert");
+
+            dh.ExecuteSql("delete SMTBIND_TEMP", "delete");
+
+            MessageBox.Show("导入成功"+ number + "条!");
+            OperateResult.AppendText(">>导入成功" + number + "条!\n", Color.Green);
+
+        }
     }
 }

+ 94 - 0
UAS_MES_WEIP/FunctionCode/Make/Make_SMTBind.resx

@@ -132,6 +132,21 @@
   <metadata name="sb_indate.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
+  <metadata name="序号.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="sb_maincode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="sb_barcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="sb_prodcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="sb_indate.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
   <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
   <data name="Debut.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
@@ -657,4 +672,83 @@
         ROJSU3qXjMKwG/vjzEz/skOI3Zqgv7AAAAAASUVORK5CYII=
 </value>
   </data>
+  <data name="normalButton2.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="normalButton2.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="normalButton2.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>
+  <data name="normalButton3.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="normalButton3.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="normalButton3.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>
+  <metadata name="openFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </metadata>
 </root>

+ 177 - 92
UAS_MES_WEIP/FunctionCode/Make/Make_TestCollection.Designer.cs

@@ -59,10 +59,16 @@
             this.mcd_inqty_label = new System.Windows.Forms.Label();
             this.mc_restqty_label = new System.Windows.Forms.Label();
             this.panel1 = new System.Windows.Forms.Panel();
+            this.ob_sendqty = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
             this.label7 = new System.Windows.Forms.Label();
             this.ob_checkno = new System.Windows.Forms.Label();
+            this.SendCheck = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
+            this.ob_batchqty = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
             this.ob_batchqty_label = new System.Windows.Forms.Label();
+            this.ob_nowcheckqty = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
             this.ob_nowcheckqty_label = new System.Windows.Forms.Label();
+            this.mcd_remainqty = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
+            this.mcd_inqty = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
             this.pr_detail_label = new System.Windows.Forms.Label();
             this.ma_softversion_label = new System.Windows.Forms.Label();
             this.BadInfSource = new System.Windows.Forms.BindingSource(this.components);
@@ -77,12 +83,6 @@
             this.StepCount = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SourceStepCount();
             this.Filter = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.TextBoxWithPlaceHolder();
             this.ma_softversion = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
-            this.ob_sendqty = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
-            this.SendCheck = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
-            this.ob_batchqty = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
-            this.ob_nowcheckqty = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
-            this.mcd_remainqty = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
-            this.mcd_inqty = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
             this.Save = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
             this.bc_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.ma_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.MaCodeSearchTextBox();
@@ -97,19 +97,27 @@
             this.bc_remark = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.bc_groupcode = new UAS_MES_NEW.CustomControl.ComBoxWithFocus.ComBoxWithFocus();
             this.ms_sncode = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SnCollectionBox();
+            this.StopWatch = new System.Windows.Forms.Button();
+            this.StartWatch = new System.Windows.Forms.Button();
+            this.ChooseFolder = new System.Windows.Forms.Button();
+            this.FolderPath = new System.Windows.Forms.TextBox();
+            this.label8 = new System.Windows.Forms.Label();
+            this.XmlWatcher = new System.IO.FileSystemWatcher();
             this.panel1.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.BadInfSource)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.XmlWatcher)).BeginInit();
             this.SuspendLayout();
             // 
             // bc_remark_label
             // 
             this.bc_remark_label.AutoSize = true;
             this.bc_remark_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.bc_remark_label.Location = new System.Drawing.Point(287, 181);
+            this.bc_remark_label.Location = new System.Drawing.Point(456, 257);
             this.bc_remark_label.Name = "bc_remark_label";
             this.bc_remark_label.Size = new System.Drawing.Size(74, 21);
             this.bc_remark_label.TabIndex = 25;
             this.bc_remark_label.Text = "不良备注";
+            this.bc_remark_label.Visible = false;
             // 
             // ms_sncode_label
             // 
@@ -384,6 +392,19 @@
             this.panel1.Size = new System.Drawing.Size(315, 127);
             this.panel1.TabIndex = 71;
             // 
+            // ob_sendqty
+            // 
+            this.ob_sendqty.AutoSize = true;
+            this.ob_sendqty.CutLength = null;
+            this.ob_sendqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ob_sendqty.ForeColor = System.Drawing.Color.Black;
+            this.ob_sendqty.Location = new System.Drawing.Point(109, 91);
+            this.ob_sendqty.MaximumSize = new System.Drawing.Size(150, 0);
+            this.ob_sendqty.Name = "ob_sendqty";
+            this.ob_sendqty.Size = new System.Drawing.Size(0, 21);
+            this.ob_sendqty.TabIndex = 78;
+            this.ob_sendqty.Tag = "ob_batchqty";
+            // 
             // label7
             // 
             this.label7.AutoSize = true;
@@ -408,6 +429,39 @@
             this.ob_checkno.Visible = false;
             this.ob_checkno.TextChanged += new System.EventHandler(this.ob_checkno_TextChanged);
             // 
+            // SendCheck
+            // 
+            this.SendCheck.AllPower = null;
+            this.SendCheck.BackColor = System.Drawing.Color.Transparent;
+            this.SendCheck.DownImage = ((System.Drawing.Image)(resources.GetObject("SendCheck.DownImage")));
+            this.SendCheck.Enabled = false;
+            this.SendCheck.Image = null;
+            this.SendCheck.IsShowBorder = true;
+            this.SendCheck.Location = new System.Drawing.Point(229, 90);
+            this.SendCheck.Margin = new System.Windows.Forms.Padding(2);
+            this.SendCheck.MoveImage = ((System.Drawing.Image)(resources.GetObject("SendCheck.MoveImage")));
+            this.SendCheck.Name = "SendCheck";
+            this.SendCheck.NormalImage = ((System.Drawing.Image)(resources.GetObject("SendCheck.NormalImage")));
+            this.SendCheck.Power = null;
+            this.SendCheck.Size = new System.Drawing.Size(65, 26);
+            this.SendCheck.TabIndex = 72;
+            this.SendCheck.Text = "送检";
+            this.SendCheck.UseVisualStyleBackColor = false;
+            this.SendCheck.Click += new System.EventHandler(this.SendCheck_Click);
+            // 
+            // ob_batchqty
+            // 
+            this.ob_batchqty.AutoSize = true;
+            this.ob_batchqty.CutLength = null;
+            this.ob_batchqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ob_batchqty.ForeColor = System.Drawing.Color.Black;
+            this.ob_batchqty.Location = new System.Drawing.Point(109, 51);
+            this.ob_batchqty.MaximumSize = new System.Drawing.Size(150, 0);
+            this.ob_batchqty.Name = "ob_batchqty";
+            this.ob_batchqty.Size = new System.Drawing.Size(0, 21);
+            this.ob_batchqty.TabIndex = 75;
+            this.ob_batchqty.Tag = "ob_batchqty";
+            // 
             // ob_batchqty_label
             // 
             this.ob_batchqty_label.AutoSize = true;
@@ -419,6 +473,19 @@
             this.ob_batchqty_label.TabIndex = 74;
             this.ob_batchqty_label.Text = "抽检批数";
             // 
+            // ob_nowcheckqty
+            // 
+            this.ob_nowcheckqty.AutoSize = true;
+            this.ob_nowcheckqty.CutLength = null;
+            this.ob_nowcheckqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ob_nowcheckqty.ForeColor = System.Drawing.Color.Black;
+            this.ob_nowcheckqty.Location = new System.Drawing.Point(248, 51);
+            this.ob_nowcheckqty.MaximumSize = new System.Drawing.Size(150, 0);
+            this.ob_nowcheckqty.Name = "ob_nowcheckqty";
+            this.ob_nowcheckqty.Size = new System.Drawing.Size(0, 21);
+            this.ob_nowcheckqty.TabIndex = 73;
+            this.ob_nowcheckqty.Tag = "ob_nowcheckqty";
+            // 
             // ob_nowcheckqty_label
             // 
             this.ob_nowcheckqty_label.AutoSize = true;
@@ -430,6 +497,30 @@
             this.ob_nowcheckqty_label.TabIndex = 72;
             this.ob_nowcheckqty_label.Text = "当前批数";
             // 
+            // mcd_remainqty
+            // 
+            this.mcd_remainqty.AutoSize = true;
+            this.mcd_remainqty.CutLength = null;
+            this.mcd_remainqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.mcd_remainqty.Location = new System.Drawing.Point(109, 12);
+            this.mcd_remainqty.MaximumSize = new System.Drawing.Size(150, 0);
+            this.mcd_remainqty.Name = "mcd_remainqty";
+            this.mcd_remainqty.Size = new System.Drawing.Size(0, 21);
+            this.mcd_remainqty.TabIndex = 57;
+            this.mcd_remainqty.Tag = "mcd_remainqty";
+            // 
+            // mcd_inqty
+            // 
+            this.mcd_inqty.AutoSize = true;
+            this.mcd_inqty.CutLength = null;
+            this.mcd_inqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.mcd_inqty.Location = new System.Drawing.Point(248, 12);
+            this.mcd_inqty.MaximumSize = new System.Drawing.Size(150, 0);
+            this.mcd_inqty.Name = "mcd_inqty";
+            this.mcd_inqty.Size = new System.Drawing.Size(0, 21);
+            this.mcd_inqty.TabIndex = 54;
+            this.mcd_inqty.Tag = "mcd_inqty";
+            // 
             // pr_detail_label
             // 
             this.pr_detail_label.AutoSize = true;
@@ -564,89 +655,6 @@
             this.ma_softversion.Size = new System.Drawing.Size(0, 21);
             this.ma_softversion.TabIndex = 73;
             // 
-            // ob_sendqty
-            // 
-            this.ob_sendqty.AutoSize = true;
-            this.ob_sendqty.CutLength = null;
-            this.ob_sendqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ob_sendqty.ForeColor = System.Drawing.Color.Black;
-            this.ob_sendqty.Location = new System.Drawing.Point(109, 91);
-            this.ob_sendqty.MaximumSize = new System.Drawing.Size(150, 0);
-            this.ob_sendqty.Name = "ob_sendqty";
-            this.ob_sendqty.Size = new System.Drawing.Size(0, 21);
-            this.ob_sendqty.TabIndex = 78;
-            this.ob_sendqty.Tag = "ob_batchqty";
-            // 
-            // SendCheck
-            // 
-            this.SendCheck.AllPower = null;
-            this.SendCheck.BackColor = System.Drawing.Color.Transparent;
-            this.SendCheck.DownImage = ((System.Drawing.Image)(resources.GetObject("SendCheck.DownImage")));
-            this.SendCheck.Enabled = false;
-            this.SendCheck.Image = null;
-            this.SendCheck.IsShowBorder = true;
-            this.SendCheck.Location = new System.Drawing.Point(229, 90);
-            this.SendCheck.Margin = new System.Windows.Forms.Padding(2);
-            this.SendCheck.MoveImage = ((System.Drawing.Image)(resources.GetObject("SendCheck.MoveImage")));
-            this.SendCheck.Name = "SendCheck";
-            this.SendCheck.NormalImage = ((System.Drawing.Image)(resources.GetObject("SendCheck.NormalImage")));
-            this.SendCheck.Power = null;
-            this.SendCheck.Size = new System.Drawing.Size(65, 26);
-            this.SendCheck.TabIndex = 72;
-            this.SendCheck.Text = "送检";
-            this.SendCheck.UseVisualStyleBackColor = false;
-            this.SendCheck.Click += new System.EventHandler(this.SendCheck_Click);
-            // 
-            // ob_batchqty
-            // 
-            this.ob_batchqty.AutoSize = true;
-            this.ob_batchqty.CutLength = null;
-            this.ob_batchqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ob_batchqty.ForeColor = System.Drawing.Color.Black;
-            this.ob_batchqty.Location = new System.Drawing.Point(109, 51);
-            this.ob_batchqty.MaximumSize = new System.Drawing.Size(150, 0);
-            this.ob_batchqty.Name = "ob_batchqty";
-            this.ob_batchqty.Size = new System.Drawing.Size(0, 21);
-            this.ob_batchqty.TabIndex = 75;
-            this.ob_batchqty.Tag = "ob_batchqty";
-            // 
-            // ob_nowcheckqty
-            // 
-            this.ob_nowcheckqty.AutoSize = true;
-            this.ob_nowcheckqty.CutLength = null;
-            this.ob_nowcheckqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ob_nowcheckqty.ForeColor = System.Drawing.Color.Black;
-            this.ob_nowcheckqty.Location = new System.Drawing.Point(248, 51);
-            this.ob_nowcheckqty.MaximumSize = new System.Drawing.Size(150, 0);
-            this.ob_nowcheckqty.Name = "ob_nowcheckqty";
-            this.ob_nowcheckqty.Size = new System.Drawing.Size(0, 21);
-            this.ob_nowcheckqty.TabIndex = 73;
-            this.ob_nowcheckqty.Tag = "ob_nowcheckqty";
-            // 
-            // mcd_remainqty
-            // 
-            this.mcd_remainqty.AutoSize = true;
-            this.mcd_remainqty.CutLength = null;
-            this.mcd_remainqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_remainqty.Location = new System.Drawing.Point(109, 12);
-            this.mcd_remainqty.MaximumSize = new System.Drawing.Size(150, 0);
-            this.mcd_remainqty.Name = "mcd_remainqty";
-            this.mcd_remainqty.Size = new System.Drawing.Size(0, 21);
-            this.mcd_remainqty.TabIndex = 57;
-            this.mcd_remainqty.Tag = "mcd_remainqty";
-            // 
-            // mcd_inqty
-            // 
-            this.mcd_inqty.AutoSize = true;
-            this.mcd_inqty.CutLength = null;
-            this.mcd_inqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_inqty.Location = new System.Drawing.Point(248, 12);
-            this.mcd_inqty.MaximumSize = new System.Drawing.Size(150, 0);
-            this.mcd_inqty.Name = "mcd_inqty";
-            this.mcd_inqty.Size = new System.Drawing.Size(0, 21);
-            this.mcd_inqty.TabIndex = 54;
-            this.mcd_inqty.Tag = "mcd_inqty";
-            // 
             // Save
             // 
             this.Save.AllPower = null;
@@ -801,15 +809,16 @@
             this.bc_remark.AllPower = null;
             this.bc_remark.BackColor = System.Drawing.Color.White;
             this.bc_remark.ID = null;
-            this.bc_remark.Location = new System.Drawing.Point(370, 182);
+            this.bc_remark.Location = new System.Drawing.Point(561, 261);
             this.bc_remark.Multiline = true;
             this.bc_remark.Name = "bc_remark";
             this.bc_remark.Power = null;
-            this.bc_remark.Size = new System.Drawing.Size(264, 62);
+            this.bc_remark.Size = new System.Drawing.Size(67, 10);
             this.bc_remark.Str = null;
             this.bc_remark.Str1 = null;
             this.bc_remark.Str2 = null;
             this.bc_remark.TabIndex = 41;
+            this.bc_remark.Visible = false;
             // 
             // bc_groupcode
             // 
@@ -838,12 +847,81 @@
             this.ms_sncode.Tag = "IfRead";
             this.ms_sncode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ms_code_KeyDown_one);
             // 
+            // StopWatch
+            // 
+            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(520, 225);
+            this.StopWatch.Margin = new System.Windows.Forms.Padding(2);
+            this.StopWatch.Name = "StopWatch";
+            this.StopWatch.Size = new System.Drawing.Size(64, 28);
+            this.StopWatch.TabIndex = 207;
+            this.StopWatch.Text = "停止监控";
+            this.StopWatch.UseVisualStyleBackColor = true;
+            this.StopWatch.Click += new System.EventHandler(this.StopWatch_Click);
+            // 
+            // 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(408, 225);
+            this.StartWatch.Margin = new System.Windows.Forms.Padding(2);
+            this.StartWatch.Name = "StartWatch";
+            this.StartWatch.Size = new System.Drawing.Size(64, 28);
+            this.StartWatch.TabIndex = 206;
+            this.StartWatch.Text = "开始监控";
+            this.StartWatch.UseVisualStyleBackColor = true;
+            this.StartWatch.Click += new System.EventHandler(this.StartWatch_Click);
+            // 
+            // 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(548, 186);
+            this.ChooseFolder.Margin = new System.Windows.Forms.Padding(2);
+            this.ChooseFolder.Name = "ChooseFolder";
+            this.ChooseFolder.Size = new System.Drawing.Size(78, 24);
+            this.ChooseFolder.TabIndex = 205;
+            this.ChooseFolder.Text = "选择文件夹";
+            this.ChooseFolder.UseVisualStyleBackColor = true;
+            this.ChooseFolder.Click += new System.EventHandler(this.ChooseFolder_Click);
+            // 
+            // FolderPath
+            // 
+            this.FolderPath.Enabled = false;
+            this.FolderPath.Location = new System.Drawing.Point(380, 190);
+            this.FolderPath.Margin = new System.Windows.Forms.Padding(2);
+            this.FolderPath.Name = "FolderPath";
+            this.FolderPath.Size = new System.Drawing.Size(159, 21);
+            this.FolderPath.TabIndex = 204;
+            // 
+            // label8
+            // 
+            this.label8.AutoSize = true;
+            this.label8.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label8.Location = new System.Drawing.Point(446, 155);
+            this.label8.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.label8.Name = "label8";
+            this.label8.Size = new System.Drawing.Size(84, 20);
+            this.label8.TabIndex = 203;
+            this.label8.Text = "监控文件夹";
+            // 
+            // XmlWatcher
+            // 
+            this.XmlWatcher.EnableRaisingEvents = true;
+            this.XmlWatcher.Filter = "*.csv";
+            this.XmlWatcher.SynchronizingObject = this;
+            this.XmlWatcher.Created += new System.IO.FileSystemEventHandler(this.XmlWatcher_Created);
+            // 
             // Make_TestCollection
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.BackColor = System.Drawing.SystemColors.Control;
             this.ClientSize = new System.Drawing.Size(862, 535);
+            this.Controls.Add(this.StopWatch);
+            this.Controls.Add(this.StartWatch);
+            this.Controls.Add(this.ChooseFolder);
+            this.Controls.Add(this.FolderPath);
+            this.Controls.Add(this.label8);
             this.Controls.Add(this.oneget);
             this.Controls.Add(this.label1);
             this.Controls.Add(this.SMTBind);
@@ -899,6 +977,7 @@
             this.panel1.ResumeLayout(false);
             this.panel1.PerformLayout();
             ((System.ComponentModel.ISupportInitialize)(this.BadInfSource)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.XmlWatcher)).EndInit();
             this.ResumeLayout(false);
             this.PerformLayout();
 
@@ -972,5 +1051,11 @@
         private System.Windows.Forms.CheckBox SMTBind;
         private System.Windows.Forms.Label label1;
         private CustomControl.ValueLabel.ValueLabel oneget;
+        private System.Windows.Forms.Button StopWatch;
+        private System.Windows.Forms.Button StartWatch;
+        private System.Windows.Forms.Button ChooseFolder;
+        private System.Windows.Forms.TextBox FolderPath;
+        private System.Windows.Forms.Label label8;
+        private System.IO.FileSystemWatcher XmlWatcher;
     }
 }

+ 92 - 0
UAS_MES_WEIP/FunctionCode/Make/Make_TestCollection.cs

@@ -10,6 +10,7 @@ using UAS_MES_NEW.PublicMethod;
 using System.Collections.Generic;
 using UAS_MES_NEW.CustomControl.PowerControlForm;
 using UAS_MES_NEW.Properties;
+using System.IO;
 
 namespace UAS_MES_NEW.Make
 {
@@ -72,6 +73,7 @@ namespace UAS_MES_NEW.Make
             ControlLockTimer.Interval = 100;
             SMTBind.Checked = Settings.Default.SMTBIND;
             Control.CheckForIllegalCrossThreadCalls = false;
+            FolderPath.Text = BaseUtil.GetCacheData("FolderPath").ToString();
             //工单号放大镜配置
             ma_code.TableName = "make left join product on ma_prodcode=pr_code";
             ma_code.SelectField = "ma_code # 工单号,ma_prodcode # 产品编号,ma_qty # 工单数量,pr_spec # 产品规格,ma_softversion # 软件版本,ma_salecode # 销售单号,pr_sendchecktype # 产品送检方式";
@@ -1019,5 +1021,95 @@ namespace UAS_MES_NEW.Make
             Settings.Default.Save();
 
         }
+
+        private void StartWatch_Click(object sender, EventArgs e)
+        {
+            if (FolderPath.Text == "")
+            {
+                OperateResult.AppendText("请选择监控文件夹\n");
+                return;
+            }
+            else
+            {
+                if (!Directory.Exists(FolderPath.Text))
+                {
+                    OperateResult.AppendText("监控文件夹不存在\n");
+                    return;
+                }
+            }
+            XmlWatcher.Path = FolderPath.Text;
+            XmlWatcher.Filter = "*.csv";
+            XmlWatcher.EnableRaisingEvents = true;
+            //设置缓存数据
+            BaseUtil.SetCacheData("FolderPath", FolderPath.Text);
+            //设置按钮不可点击
+            StartWatch.Enabled = false;
+            ChooseFolder.Enabled = false;
+            StopWatch.Enabled = true;
+            OperateResult.AppendText("开始执行监控\n");
+        }
+
+        private void StopWatch_Click(object sender, EventArgs e)
+        {
+            XmlWatcher.EnableRaisingEvents = false;
+            StartWatch.Enabled = true;
+            ChooseFolder.Enabled = true;
+            StopWatch.Enabled = false;
+            OperateResult.AppendText("停止执行监控\n");
+        }
+
+        private void ChooseFolder_Click(object sender, EventArgs e)
+        {
+            FolderBrowserDialog folder = new FolderBrowserDialog();
+            folder.Description = "选择监控文件夹";
+            DialogResult result = folder.ShowDialog();
+            if (result == DialogResult.OK)
+            {
+                FolderPath.Text = folder.SelectedPath;
+            }
+        }
+
+        private void XmlWatcher_Created(object sender, FileSystemEventArgs e)
+        {
+            while (true)
+            {
+                try
+                {
+                    using (Stream stream = File.Open(e.FullPath, FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite))
+                    {
+                        if (stream != null)
+                            break;
+                    }
+                }
+                catch (Exception ex)
+                {
+                    Console.WriteLine(ex.Message);
+                }
+            }
+            StreamReader _Sr = new StreamReader(FolderPath.Text + @"\" + e.Name, Encoding.UTF8);
+            String[] strData;
+            string line;
+            while ((line = _Sr.ReadLine()) != null)
+            { 
+                strData = line.Replace("\r", "").Replace("\n", "").Replace("\t", "").Split(',');
+                if (strData.Length > 5 && strData[0] == "ArrayID")
+                {
+                    if (strData[5] != ""&& strData[5] != "NOREAD")
+                    {
+                        if (strData[3] == "Good")
+                        {
+                            ms_sncode.Text = strData[5];
+                            ms_code_KeyDown(this, new KeyEventArgs(Keys.Enter));
+                        }
+                        else {
+                            OperateResult.AppendText(">>解析数据" + strData[5] + "非良品,无法采集\n", Color.Red, ms_sncode);
+                        }
+                    }
+                }
+            }
+            _Sr.Close();
+
+
+        }
     }
 }

+ 3 - 0
UAS_MES_WEIP/FunctionCode/Make/Make_TestCollection.resx

@@ -369,4 +369,7 @@
         fgAAAABJRU5ErkJggg==
 </value>
   </data>
+  <metadata name="XmlWatcher.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>329, 17</value>
+  </metadata>
 </root>

+ 14 - 14
UAS_MES_WEIP/FunctionCode/Special/Special_SmtLocation.Designer.cs

@@ -32,6 +32,8 @@
             this.textBox1 = new System.Windows.Forms.TextBox();
             this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
             this.LabelDataGridView = new System.Windows.Forms.DataGridView();
+            this.RefDes = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.Layer = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog();
             this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -40,8 +42,6 @@
             this.normalButton3 = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
             this.normalButton2 = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
             this.pr_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SearchTextBox();
-            this.RefDes = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.Layer = new System.Windows.Forms.DataGridViewTextBoxColumn();
             ((System.ComponentModel.ISupportInitialize)(this.LabelDataGridView)).BeginInit();
             this.SuspendLayout();
             // 
@@ -73,6 +73,18 @@
             this.LabelDataGridView.Size = new System.Drawing.Size(675, 233);
             this.LabelDataGridView.TabIndex = 189;
             // 
+            // RefDes
+            // 
+            this.RefDes.DataPropertyName = "RefDes";
+            this.RefDes.HeaderText = "RefDes";
+            this.RefDes.Name = "RefDes";
+            // 
+            // Layer
+            // 
+            this.Layer.DataPropertyName = "Layer";
+            this.Layer.HeaderText = "Layer";
+            this.Layer.Name = "Layer";
+            // 
             // dataGridViewTextBoxColumn1
             // 
             this.dataGridViewTextBoxColumn1.DataPropertyName = "RefDes";
@@ -162,18 +174,6 @@
             this.pr_code.Tag = "pr_code";
             this.pr_code.TextBoxEnable = true;
             // 
-            // RefDes
-            // 
-            this.RefDes.DataPropertyName = "RefDes";
-            this.RefDes.HeaderText = "RefDes";
-            this.RefDes.Name = "RefDes";
-            // 
-            // Layer
-            // 
-            this.Layer.DataPropertyName = "Layer";
-            this.Layer.HeaderText = "Layer";
-            this.Layer.Name = "Layer";
-            // 
             // Special_SmtLocation
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);

+ 3 - 2
UAS_MES_WEIP/Login.cs

@@ -89,11 +89,12 @@ namespace UAS_MES_NEW
             string DBUser = DB.SelectedValue.ToString().Split('#')[0];
             string Address = DB.SelectedValue.ToString().Split('#')[1];
             DataHelper.DBConnectionString = "Password=select!#%*(;User ID=" + DBUser + ";Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=" + Address + ")(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+            //DataHelper.DBConnectionString = "Password=select!#%*(;User ID=" + DBUser + ";Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=usoft.f3322.net)(PORT=11585)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
             SystemInf.CurrentDB = DBUser;
             //设置屏幕的宽高信息
             SystemInf.ScreenWidth = Screen.PrimaryScreen.WorkingArea.Width;
-            SystemInf.ScreenHeight = Screen.PrimaryScreen.WorkingArea.Height;
-            //重新执行一遍构造函数使得重置之后的链接字符串生效
+            SystemInf.ScreenHeight = Screen.PrimaryScreen.WorkingArea.Height; 
+            //重新执行一遍构造函数使得重置之后的链接字符串生效   
             dh = new DataHelper();
             SystemInf.dh = dh;
             string ErrorMessage = "";

+ 9 - 0
UAS_MES_WEIP/UAS_MES_WEIP.csproj

@@ -530,6 +530,12 @@
     <Compile Include="FunctionCode\Make\Make_FeedingCollectionCombine.Designer.cs">
       <DependentUpon>Make_FeedingCollectionCombine.cs</DependentUpon>
     </Compile>
+    <Compile Include="FunctionCode\Make\Make_NewPo.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="FunctionCode\Make\Make_NewPo.Designer.cs">
+      <DependentUpon>Make_NewPo.cs</DependentUpon>
+    </Compile>
     <Compile Include="FunctionCode\Make\Make_PreFeedingCollection.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -1278,6 +1284,9 @@
     <EmbeddedResource Include="FunctionCode\Make\Make_FeedingCollectionCombine.resx">
       <DependentUpon>Make_FeedingCollectionCombine.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="FunctionCode\Make\Make_NewPo.resx">
+      <DependentUpon>Make_NewPo.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="FunctionCode\Make\Make_PreFeedingCollection.resx">
       <DependentUpon>Make_PreFeedingCollection.cs</DependentUpon>
     </EmbeddedResource>