Explorar el Código

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

caosy hace 1 año
padre
commit
06fa4bfc05
Se han modificado 94 ficheros con 8245 adiciones y 743 borrados
  1. 229 0
      FileWatcher/AutoAnalysisDeviceKS.Designer.cs
  2. 302 0
      FileWatcher/AutoAnalysisDeviceKS.cs
  3. 132 0
      FileWatcher/AutoAnalysisDeviceKS.resx
  4. 4 3
      FileWatcher/AutoAnalysisXmlByStep.cs
  5. 45 3
      FileWatcher/AutoMakeQTY.Designer.cs
  6. 71 21
      FileWatcher/AutoMakeQTY.cs
  7. 9 5
      FileWatcher/AutoMakeQTYRZ.cs
  8. 26 6
      FileWatcher/DataHelper.cs
  9. 18 0
      FileWatcher/FileWatcher.csproj
  10. 28 5
      FileWatcher/Form4.Designer.cs
  11. 5 1
      FileWatcher/Program.cs
  12. 9 7
      FileWatcher/SOP.cs
  13. 163 0
      FileWatcher/UploadMakePlan.Designer.cs
  14. 179 0
      FileWatcher/UploadMakePlan.cs
  15. 138 0
      FileWatcher/UploadMakePlan.resx
  16. 1 1
      UAS-出货标签管理(贸易版)/ChangeMaster.Designer.cs
  17. 1 1
      UAS-出货标签管理(贸易版)/CustomControl/BlurSearch.Designer.cs
  18. 1 1
      UAS-出货标签管理(贸易版)/CustomControl/DataGridViewWithSerialNum.Designer.cs
  19. 1 1
      UAS-出货标签管理(贸易版)/CustomControl/EnterTextBox.Designer.cs
  20. 1 1
      UAS-出货标签管理(贸易版)/CustomControl/HeadBar.Designer.cs
  21. 1 1
      UAS-出货标签管理(贸易版)/CustomControl/NumOnlyTextBox.Designer.cs
  22. 2 2
      UAS-出货标签管理(贸易版)/CustomControl/Pagination.Designer.cs
  23. 1 1
      UAS-出货标签管理(贸易版)/CustomControl/PrinterCombox.Designer.cs
  24. 1 1
      UAS-出货标签管理(贸易版)/CustomControl/SearchTextBox.Designer.cs
  25. 1 1
      UAS-出货标签管理(贸易版)/CustomerRule.Designer.cs
  26. 1 1
      UAS-出货标签管理(贸易版)/DateCodeSetAndPrint.Designer.cs
  27. 1 1
      UAS-出货标签管理(贸易版)/DbFind.Designer.cs
  28. 1 1
      UAS-出货标签管理(贸易版)/ExportColumns.Designer.cs
  29. 3 3
      UAS-出货标签管理(贸易版)/ExportExcel.Designer.cs
  30. 1 1
      UAS-出货标签管理(贸易版)/ExportExcel.cs
  31. 1 1
      UAS-出货标签管理(贸易版)/Login.Designer.cs
  32. 1 1
      UAS-出货标签管理(贸易版)/PowerSetting.Designer.cs
  33. 1 1
      UAS-出货标签管理(贸易版)/PreViewWindow.Designer.cs
  34. 19 19
      UAS-出货标签管理(贸易版)/PublicMethod/DataHelper.cs
  35. 1 1
      UAS-出货标签管理(贸易版)/ReSetMaxNum.Designer.cs
  36. 1 1
      UAS-出货标签管理(贸易版)/SetLoadingWindow.Designer.cs
  37. 1 1
      UAS-出货标签管理(贸易版)/SetLotNo.Designer.cs
  38. 370 69
      UAS-出货标签管理(贸易版)/UAS_出货标签管理.Designer.cs
  39. 17 18
      UAS-出货标签管理(贸易版)/UAS_出货标签管理.cs
  40. 1 1
      UAS-出货标签管理(贸易版)/生成条码.Designer.cs
  41. 1 1
      UAS-出货标签管理(贸易版)/采集策略.Designer.cs
  42. 1 1
      UAS-出货标签管理(贸易版)/附件内容打印.Designer.cs
  43. 2 2
      UAS_BARCODEIO/DataHelper.cs
  44. 13 0
      UAS_BARCODEIO/极测_出货清单打印.Designer.cs
  45. 10 5
      UAS_BARCODEIO/极测_出货清单打印.cs
  46. 42 0
      UAS_BARCODEIO/极测_出货清单打印.resx
  47. 3 0
      UAS_MES_JC/CustomControl/HeadBar/HeadBar.Designer.cs
  48. 48 24
      UAS_MES_JC/CustomControl/HeadBar/HeadBar.resx
  49. 1 1
      UAS_MES_JC/Entity/SystemInf.cs
  50. 8 1
      UAS_MES_JC/FunctionCode/Query/Query_SN.cs
  51. 15 4
      UAS_MES_JC/PublicMethod/LogicHandler.cs
  52. 49 30
      UAS_MES_LGDZ/DataOperate/ExcelHandler.cs
  53. 66 66
      UAS_MES_LGDZ/FunctionCode/Make/Make_ColorBoxLabelPrint_WN.cs
  54. 3 3
      UAS_MES_LGDZ/FunctionCode/Make/Make_FeedingCollection.cs
  55. 0 5
      UAS_MES_LGDZ/FunctionCode/Query/Query_BarcodeIn1.cs
  56. 347 11
      UAS_MES_LGDZ/FunctionCode/Query/Query_SpecialReport.Designer.cs
  57. 18 6
      UAS_MES_LGDZ/FunctionCode/Query/Query_SpecialReport.cs
  58. 46 46
      UAS_MES_LGDZ/FunctionCode/Query/Query_SpecialReport.resx
  59. 3 3
      UAS_MES_LGDZ/FunctionCode/Special/Special_ChangeMakeCodeBySN.cs
  60. 1 1
      UAS_MES_LGDZ/FunctionCode/Special/Special_DeleteWN.cs
  61. 9 0
      UAS_MES_LGDZ/UAS_MES_LGDZ.csproj
  62. 36 2
      UAS_MES_ODLF/FunctionCode/Packing/Packing_PackageCollectionWeigh.cs
  63. 1260 0
      UAS_MES_ODLF/FunctionCode/Packing/Packing_PackageCollectionWeigh2.Designer.cs
  64. 1092 0
      UAS_MES_ODLF/FunctionCode/Packing/Packing_PackageCollectionWeigh2.cs
  65. 367 0
      UAS_MES_ODLF/FunctionCode/Packing/Packing_PackageCollectionWeigh2.resx
  66. 9 0
      UAS_MES_ODLF/UAS_MES_ODLF.csproj
  67. 309 0
      UAS_MES_PW/FunctionCode/Make/Make_StencilPrint.Designer.cs
  68. 264 0
      UAS_MES_PW/FunctionCode/Make/Make_StencilPrint.cs
  69. 159 0
      UAS_MES_PW/FunctionCode/Make/Make_StencilPrint.resx
  70. 9 0
      UAS_MES_PW/UAS_MES_PW.csproj
  71. 1 1
      UAS_MES_YD/CustomControl/HeadBar/HeadBar.cs
  72. 1 1
      UAS_MES_YD/CustomControl/RichText/RichTextAutoBottom.cs
  73. 1 1
      UAS_MES_YD/DataOperate/DataHelper.cs
  74. 1 1
      UAS_MES_YD/FunctionCode/Make/Make_FeedingCollection.cs
  75. 59 6
      UAS_MES_YD/FunctionCode/Make/Make_ImeiCheck.cs
  76. 3 3
      UAS_MES_YD/FunctionCode/Make/Make_PreFeedingCollection.cs
  77. 1 1
      UAS_MES_YD/FunctionCode/Make/Make_TestCollection.cs
  78. 1 1
      UAS_MES_YD/FunctionCode/Make/Make_TestCollection_DCW.Designer.cs
  79. 3 2
      UAS_MES_YD/FunctionCode/Special/Special_CancelOQC.cs
  80. 4 3
      UAS_MES_YD/FunctionCode/Special/Special_CancelOQCToLastStep.cs
  81. 2 2
      UAS_MES_YD/Login.cs
  82. 1 1
      UAS_MES_YD/Main.cs
  83. 1 1
      UAS_MES_YDCY/DataOperate/ExcelHandler.cs
  84. 410 0
      UAS_MES_YDCY/FunctionCode/Special/Special_Reset.Designer.cs
  85. 458 0
      UAS_MES_YDCY/FunctionCode/Special/Special_Reset.cs
  86. 279 0
      UAS_MES_YDCY/FunctionCode/Special/Special_Reset.resx
  87. 9 0
      UAS_MES_YDCY/UAS_MES_YDCY.csproj
  88. 8 0
      UAS_MES_ZDXW/FunctionCode/Query/ArrayList.cs
  89. 305 210
      UAS_MES_ZDXW/FunctionCode/Query/Query_SN.Designer.cs
  90. 294 59
      UAS_MES_ZDXW/FunctionCode/Query/Query_SN.cs
  91. 317 55
      UAS_MES_ZDXW/FunctionCode/Query/Query_SN.resx
  92. 1 1
      UAS_MES_ZDXW/Properties/Settings.Designer.cs
  93. 104 0
      UAS_MES_ZDXW/PublicMethod/BaseUtil.cs
  94. 1 0
      UAS_MES_ZDXW/UAS_MES_ZDXW.csproj

+ 229 - 0
FileWatcher/AutoAnalysisDeviceKS.Designer.cs

@@ -0,0 +1,229 @@
+namespace FileWatcher
+{
+    partial class AutoAnalysisDeviceKS
+    {
+        /// <summary>
+        /// 必需的设计器变量。
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// 清理所有正在使用的资源。
+        /// </summary>
+        /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows 窗体设计器生成的代码
+
+        /// <summary>
+        /// 设计器支持所需的方法 - 不要修改
+        /// 使用代码编辑器修改此方法的内容。
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.components = new System.ComponentModel.Container();
+            this.XmlWatcher = new System.IO.FileSystemWatcher();
+            this.XmlFolder = new System.Windows.Forms.FolderBrowserDialog();
+            this.StartWatch = new System.Windows.Forms.Button();
+            this.StopWatch = new System.Windows.Forms.Button();
+            this.label1 = new System.Windows.Forms.Label();
+            this.FolderPath = new System.Windows.Forms.TextBox();
+            this.ChooseFolder = new System.Windows.Forms.Button();
+            this.OperateResult = new System.Windows.Forms.RichTextBox();
+            this.Clean = new System.Windows.Forms.Button();
+            this.AutoStart = new System.Windows.Forms.CheckBox();
+            this.Timer = new System.Windows.Forms.Timer(this.components);
+            this.Device = new System.Windows.Forms.ComboBox();
+            this.label3 = new System.Windows.Forms.Label();
+            this.ATEFile = new System.IO.FileSystemWatcher();
+            ((System.ComponentModel.ISupportInitialize)(this.XmlWatcher)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.ATEFile)).BeginInit();
+            this.SuspendLayout();
+            // 
+            // XmlWatcher
+            // 
+            this.XmlWatcher.EnableRaisingEvents = true;
+            this.XmlWatcher.Filter = "*.log";
+            this.XmlWatcher.SynchronizingObject = this;
+            // 
+            // 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(290, 557);
+            this.StartWatch.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+            this.StartWatch.Name = "StartWatch";
+            this.StartWatch.Size = new System.Drawing.Size(128, 56);
+            this.StartWatch.TabIndex = 0;
+            this.StartWatch.Text = "开始监控";
+            this.StartWatch.UseVisualStyleBackColor = true;
+            this.StartWatch.Click += new System.EventHandler(this.StartWatch_Click);
+            // 
+            // 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(498, 557);
+            this.StopWatch.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+            this.StopWatch.Name = "StopWatch";
+            this.StopWatch.Size = new System.Drawing.Size(128, 56);
+            this.StopWatch.TabIndex = 1;
+            this.StopWatch.Text = "停止监控";
+            this.StopWatch.UseVisualStyleBackColor = true;
+            this.StopWatch.Click += new System.EventHandler(this.StopWatch_Click);
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label1.Location = new System.Drawing.Point(48, 283);
+            this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(162, 38);
+            this.label1.TabIndex = 2;
+            this.label1.Text = "监控文件夹";
+            // 
+            // FolderPath
+            // 
+            this.FolderPath.Enabled = false;
+            this.FolderPath.Location = new System.Drawing.Point(218, 283);
+            this.FolderPath.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+            this.FolderPath.Name = "FolderPath";
+            this.FolderPath.Size = new System.Drawing.Size(436, 35);
+            this.FolderPath.TabIndex = 3;
+            // 
+            // ChooseFolder
+            // 
+            this.ChooseFolder.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ChooseFolder.Location = new System.Drawing.Point(686, 277);
+            this.ChooseFolder.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+            this.ChooseFolder.Name = "ChooseFolder";
+            this.ChooseFolder.Size = new System.Drawing.Size(156, 48);
+            this.ChooseFolder.TabIndex = 6;
+            this.ChooseFolder.Text = "选择文件夹";
+            this.ChooseFolder.UseVisualStyleBackColor = true;
+            this.ChooseFolder.Click += new System.EventHandler(this.ChooseFolder_Click);
+            // 
+            // OperateResult
+            // 
+            this.OperateResult.Location = new System.Drawing.Point(892, 22);
+            this.OperateResult.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+            this.OperateResult.Name = "OperateResult";
+            this.OperateResult.Size = new System.Drawing.Size(517, 535);
+            this.OperateResult.TabIndex = 7;
+            this.OperateResult.Text = "";
+            // 
+            // Clean
+            // 
+            this.Clean.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.Clean.Location = new System.Drawing.Point(1096, 580);
+            this.Clean.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+            this.Clean.Name = "Clean";
+            this.Clean.Size = new System.Drawing.Size(112, 48);
+            this.Clean.TabIndex = 8;
+            this.Clean.Text = "清除";
+            this.Clean.UseVisualStyleBackColor = true;
+            this.Clean.Click += new System.EventHandler(this.Clean_Click);
+            // 
+            // AutoStart
+            // 
+            this.AutoStart.AutoSize = true;
+            this.AutoStart.Checked = true;
+            this.AutoStart.CheckState = System.Windows.Forms.CheckState.Checked;
+            this.AutoStart.Location = new System.Drawing.Point(686, 201);
+            this.AutoStart.Margin = new System.Windows.Forms.Padding(6);
+            this.AutoStart.Name = "AutoStart";
+            this.AutoStart.Size = new System.Drawing.Size(186, 28);
+            this.AutoStart.TabIndex = 16;
+            this.AutoStart.Text = "开机自动启动";
+            this.AutoStart.UseVisualStyleBackColor = true;
+            this.AutoStart.CheckedChanged += new System.EventHandler(this.AutoStart_CheckedChanged);
+            // 
+            // Timer
+            // 
+            this.Timer.Interval = 60000;
+            this.Timer.Tick += new System.EventHandler(this.Timer_Tick);
+            // 
+            // Device
+            // 
+            this.Device.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.Device.FormattingEnabled = true;
+            this.Device.Items.AddRange(new object[] {
+            "ATE设备",
+            "老化设备"});
+            this.Device.Location = new System.Drawing.Point(224, 201);
+            this.Device.Margin = new System.Windows.Forms.Padding(6);
+            this.Device.Name = "Device";
+            this.Device.Size = new System.Drawing.Size(436, 32);
+            this.Device.TabIndex = 20;
+            // 
+            // label3
+            // 
+            this.label3.AutoSize = true;
+            this.label3.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label3.Location = new System.Drawing.Point(54, 195);
+            this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(133, 38);
+            this.label3.TabIndex = 19;
+            this.label3.Text = "设备选择";
+            // 
+            // ATEFile
+            // 
+            this.ATEFile.EnableRaisingEvents = true;
+            this.ATEFile.Filter = "*.txt";
+            this.ATEFile.SynchronizingObject = this;
+            // 
+            // AutoAnalysisDeviceKS
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(1443, 640);
+            this.Controls.Add(this.Device);
+            this.Controls.Add(this.label3);
+            this.Controls.Add(this.AutoStart);
+            this.Controls.Add(this.Clean);
+            this.Controls.Add(this.OperateResult);
+            this.Controls.Add(this.ChooseFolder);
+            this.Controls.Add(this.FolderPath);
+            this.Controls.Add(this.label1);
+            this.Controls.Add(this.StopWatch);
+            this.Controls.Add(this.StartWatch);
+            this.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+            this.MaximizeBox = false;
+            this.Name = "AutoAnalysisDeviceKS";
+            this.Text = "UAS设备数据解析 2025-03-18  10:05";
+            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing);
+            this.Load += new System.EventHandler(this.Form1_Load);
+            ((System.ComponentModel.ISupportInitialize)(this.XmlWatcher)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.ATEFile)).EndInit();
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private System.IO.FileSystemWatcher XmlWatcher;
+        private System.Windows.Forms.FolderBrowserDialog XmlFolder;
+        private System.Windows.Forms.Button StopWatch;
+        private System.Windows.Forms.Button StartWatch;
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.TextBox FolderPath;
+        private System.Windows.Forms.Button ChooseFolder;
+        private System.Windows.Forms.RichTextBox OperateResult;
+        private System.Windows.Forms.Button Clean;
+        private System.Windows.Forms.CheckBox AutoStart;
+        private System.Windows.Forms.Timer Timer;
+        private System.Windows.Forms.ComboBox Device;
+        private System.Windows.Forms.Label label3;
+        private System.IO.FileSystemWatcher ATEFile;
+    }
+}
+

+ 302 - 0
FileWatcher/AutoAnalysisDeviceKS.cs

@@ -0,0 +1,302 @@
+using Microsoft.Win32;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.IO;
+using System.Threading;
+using System.Windows.Forms;
+using System.Xml;
+using System.Text;
+using System.Net;
+using System.Net.Sockets;
+using System.Text.RegularExpressions;
+using Oracle.ManagedDataAccess.Client;
+using NPOI.SS.UserModel;
+using NPOI.XSSF.UserModel;
+
+namespace FileWatcher
+{
+    public partial class AutoAnalysisDeviceKS : Form
+    {
+
+        DataHelper dh;
+
+        /// <summary>
+        /// 用户编号
+        /// </summary>
+        string iusercode;
+        /// <summary>
+        /// 岗位资源
+        /// </summary>
+        string isource;
+
+        Tip tipform;
+
+        Thread InitDB;
+
+        StringBuilder sql = new StringBuilder();
+        /// <summary>
+        /// 缓存的文件
+        /// </summary>
+        public static string CachePath = Environment.GetEnvironmentVariable("windir").Substring(0, 1) + @":/UAS_MES/XmlAnalysor/Cache.xml";
+        /// <summary>
+        /// 缓存的文件夹
+        /// </summary>
+        public static string CachePathFolder = Environment.GetEnvironmentVariable("windir").Substring(0, 1) + @":/UAS_MES/XmlAnalysor/";
+        /// <summary>
+        /// 需要解析的文件名
+        /// </summary>
+        List<string> _FileName = new List<string>();
+
+        ftpOperater ftp = new ftpOperater();
+
+        public AutoAnalysisDeviceKS()
+        {
+            tipform = new Tip();
+            InitializeComponent();
+            StartPosition = FormStartPosition.CenterScreen;
+        }
+
+        public AutoAnalysisDeviceKS(string iUserName, string iSource, string iMaster)
+        {
+            tipform = new Tip();
+            InitializeComponent();
+            iusercode = iUserName;
+            isource = iSource.ToUpper();
+            StartPosition = FormStartPosition.CenterScreen;
+        }
+        string IPAddress = "";
+
+        private void Form1_Load(object sender, EventArgs e)
+        {
+            tipform.Show();
+            CheckForIllegalCrossThreadCalls = false;
+            FormBorderStyle = FormBorderStyle.FixedSingle;
+            InitDB = new Thread(ConnectDB);
+            //添加监控事件
+            XmlWatcher.Changed += new FileSystemEventHandler(XmlWatcher_Created);
+            //ATEFile.Changed += new FileSystemEventHandler(XmlWatcher_Created);
+            SetLoadingWindow stw = new SetLoadingWindow(InitDB, "正在启动程序");
+            stw.StartPosition = FormStartPosition.CenterScreen;
+            stw.ShowDialog();
+            List<string> CacheInf = new List<string>();
+
+            IPHostEntry IpEntry = Dns.GetHostEntry(Dns.GetHostName());
+            for (int i = 0; i < IpEntry.AddressList.Length; i++)
+            {
+                if (IpEntry.AddressList[i].AddressFamily == AddressFamily.InterNetwork)
+                    IPAddress = IpEntry.AddressList[i].ToString();
+            }
+            //获取缓存信息
+            try
+            {
+                FolderPath.Text = BaseUtil.GetCacheData("FolderPath").ToString();
+                Device.Text = BaseUtil.GetCacheData("Device").ToString();
+                //BackUpFolderPath.Text = BaseUtil.GetCacheData("BackUpFolderPath").ToString();
+                //Master.Text = BaseUtil.GetCacheData("Master").ToString();
+                //AutoStart.Checked = (bool)BaseUtil.GetCacheData("AutoStart");
+            }
+            catch (Exception ex) { MessageBox.Show(ex.Message); }
+            //获取岗位资源相关信息
+            StartWatch.PerformClick();
+        }
+
+        private void ConnectDB()
+        {
+            DataHelper.DBConnectionString = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=N_MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.3.7)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+            dh = new DataHelper();
+        }
+
+        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.EnableRaisingEvents = true;
+            XmlWatcher.NotifyFilter = NotifyFilters.FileName | NotifyFilters.LastWrite;
+            //设置缓存数据
+            BaseUtil.SetCacheData("FolderPath", FolderPath.Text);
+            BaseUtil.SetCacheData("Device", Device.Text);
+            Timer.Interval = 1000 * 60;
+            Timer.Start();
+            //设置按钮不可点击
+            StartWatch.Enabled = false;
+            ChooseFolder.Enabled = false;
+            StopWatch.Enabled = true;
+            OperateResult.AppendText("开始执行监控\n");
+        }
+
+        private void XmlWatcher_Created(object sender, FileSystemEventArgs e)
+        {
+            OperateResult.AppendText("文件修改:" + e.FullPath + "\n");
+            TxtHandleProcess(e.FullPath);
+        }
+
+        string nextLine;
+        private void TxtHandleProcess(string FileName)
+        {
+
+        }
+
+        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 Clean_Click(object sender, EventArgs e)
+        {
+            OperateResult.Clear();
+        }
+
+        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 ChooseBackUpFolder_Click(object sender, EventArgs e)
+        {
+            FolderBrowserDialog folder = new FolderBrowserDialog();
+            folder.Description = "选择备份文件夹";
+            DialogResult result = folder.ShowDialog();
+            if (result == DialogResult.OK)
+            {
+
+            }
+        }
+
+        private void Form1_FormClosing(object sender, FormClosingEventArgs e)
+        {
+            string ExitConfirm = MessageBox.Show(this, "确认退出?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
+            if (ExitConfirm != "Yes")
+            {
+                WindowState = FormWindowState.Minimized;
+                e.Cancel = true;
+            }
+        }
+
+        private void AutoStart_CheckedChanged(object sender, EventArgs e)
+        {
+            SetAutoRun();
+        }
+        private void SetAutoRun()
+        {
+            if (AutoStart.Checked) //设置开机自启动  
+            {
+                string path = Application.ExecutablePath;
+                RegistryKey rk = Registry.LocalMachine;
+                RegistryKey rk2 = rk.CreateSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run");
+                rk2.SetValue("FileWatcher.exe", path);
+                rk2.Close();
+                rk.Close();
+            }
+            else //取消开机自启动  
+            {
+                string path = Application.ExecutablePath;
+                RegistryKey rk = Registry.LocalMachine;
+                RegistryKey rk2 = rk.CreateSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run");
+                rk2.DeleteValue("FileWatcher.exe", false);
+                rk2.Close();
+                rk.Close();
+            }
+        }
+
+        private void Timer_Tick(object sender, EventArgs e)
+        {
+            string filePath = FolderPath.Text+ @"\LotLog.csv";
+            string connectionString = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=N_MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.3.7)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+            // 读取Excel文件
+            var data = ReadExcelFile(filePath);
+            // 插入Oracle数据库
+            InsertDataIntoOracle(data, connectionString);
+        }
+
+        static List<Dictionary<string, string>> ReadExcelFile(string filePath)
+        {
+            var data = new List<Dictionary<string, string>>();
+
+            using (FileStream file = new FileStream(filePath, FileMode.Open, FileAccess.Read))
+            {
+                XSSFWorkbook workbook = new XSSFWorkbook(file);
+                ISheet sheet = workbook.GetSheetAt(0); // 获取第一个工作表
+
+                IRow headerRow = sheet.GetRow(0); // 获取表头行
+                int cellCount = headerRow.LastCellNum;
+
+                for (int i = 1; i <= sheet.LastRowNum; i++) // 从第二行开始读取数据
+                {
+                    IRow row = sheet.GetRow(i);
+                    if (row == null) continue;
+
+                    var rowData = new Dictionary<string, string>();
+
+                    for (int j = 0; j < cellCount; j++)
+                    {
+                        ICell cell = row.GetCell(j);
+                        string cellValue = cell?.ToString() ?? string.Empty;
+                        string header = headerRow.GetCell(j).ToString();
+
+                        rowData[header] = cellValue;
+                    }
+
+                    data.Add(rowData);
+                }
+            }
+
+            return data;
+        }
+
+        static void InsertDataIntoOracle(List<Dictionary<string, string>> data, string connectionString)
+        {
+            using (OracleConnection connection = new OracleConnection(connectionString))
+            {
+                connection.Open();
+
+                foreach (var row in data)
+                {
+                    string query = @"
+                        INSERT INTO your_table_name (psl_program, psl_begintime, psl_endtime, psl_stop, psl_repair, psl_boards, psl_waitupper, psl_waitlower, psl_move, psl_points, psl_consumes, psl_plat)
+                        VALUES (:psl_program, :psl_begintime, :psl_endtime, :psl_stop, :psl_repair, :psl_boards, :psl_waitupper, :psl_waitlower, :psl_move, :psl_points, :psl_consumes, :psl_plat)";
+
+                    using (OracleCommand command = new OracleCommand(query, connection))
+                    {
+                        command.Parameters.Add("psl_program", OracleDbType.Varchar2).Value = row["基板名"];
+                        command.Parameters.Add("psl_begintime", OracleDbType.Date).Value = DateTime.Parse(row["生产开始时间"]);
+                        command.Parameters.Add("psl_endtime", OracleDbType.Date).Value = DateTime.Parse(row["生产完成时间"]);
+                        command.Parameters.Add("psl_stop", OracleDbType.Int32).Value = int.Parse(row["出错停止时间(秒)"]);
+                        command.Parameters.Add("psl_repair", OracleDbType.Int32).Value = int.Parse(row["出错修复时间(秒)"]);
+                        command.Parameters.Add("psl_boards", OracleDbType.Int32).Value = int.Parse(row["完成贴装的拼板数"]);
+                        command.Parameters.Add("psl_waitupper", OracleDbType.Int32).Value = int.Parse(row["因上游待机的时间(秒)"]);
+                        command.Parameters.Add("psl_waitlower", OracleDbType.Int32).Value = int.Parse(row["因下游待机的时间(秒)"]);
+                        command.Parameters.Add("psl_move", OracleDbType.Int32).Value = int.Parse(row["可动率(%)"]);
+                        command.Parameters.Add("psl_points", OracleDbType.Int32).Value = int.Parse(row["贴装点数"]);
+                        command.Parameters.Add("psl_consumes", OracleDbType.Int32).Value = int.Parse(row["元件消耗数"]);
+                        command.Parameters.Add("psl_plat", OracleDbType.Varchar2).Value = row["输送台"];
+
+                        command.ExecuteNonQuery();
+                    }
+                }
+            }
+        }
+    }
+}

+ 132 - 0
FileWatcher/AutoAnalysisDeviceKS.resx

@@ -0,0 +1,132 @@
+<?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="XmlWatcher.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </metadata>
+  <metadata name="XmlFolder.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>164, 17</value>
+  </metadata>
+  <metadata name="Timer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>296, 17</value>
+  </metadata>
+  <metadata name="ATEFile.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>435, 17</value>
+  </metadata>
+</root>

+ 4 - 3
FileWatcher/AutoAnalysisXmlByStep.cs

@@ -38,7 +38,7 @@ namespace FileWatcher
         Thread InitDB;
         /// <summary>
         /// 线别
-        /// </summary>
+        /// </summary> 
         string ilinecode;
         /// <summary>
         /// 不良代码组
@@ -104,7 +104,7 @@ namespace FileWatcher
             FormBorderStyle = FormBorderStyle.FixedSingle;
             InitDB = new Thread(ConnectDB);
             //添加监控事件
-            XmlWatcher.Created += new FileSystemEventHandler(XmlWatcher_Created);
+            //XmlWatcher.Created += new FileSystemEventHandler(XmlWatcher_Created);
             SetLoadingWindow stw = new SetLoadingWindow(InitDB, "正在启动程序");
             stw.StartPosition = FormStartPosition.CenterScreen;
             stw.ShowDialog();
@@ -227,6 +227,7 @@ namespace FileWatcher
                 string SN = FileName.Substring(FileName.LastIndexOf(@"\") + 1);
                 string filetype = FileName.Substring(FileName.LastIndexOf(".") + 1);
                 {
+                    Console.WriteLine(FileName);
                     try
                     {
                         string sn1 = SN.Split('.')[0];
@@ -464,7 +465,7 @@ namespace FileWatcher
         {
             if (deleteFile.Checked)
             {
-                var AllXmls = Directory.GetFiles(FolderPath.Text, "*.*", SearchOption.AllDirectories).Where(s => s.EndsWith(".txt") || s.EndsWith(".ini"));
+                var AllXmls = Directory.GetFiles(FolderPath.Text, "*.*", SearchOption.AllDirectories).Where(s => s.ToUpper().EndsWith(".TXT") || s.ToUpper().EndsWith(".INI"));
                 foreach (var Xml in AllXmls)
                 {
                     try

+ 45 - 3
FileWatcher/AutoMakeQTY.Designer.cs

@@ -50,6 +50,9 @@
             this.li_code = new FileWatcher.SearchTextBox();
             this.label5 = new System.Windows.Forms.Label();
             this.ma_code = new FileWatcher.SearchTextBox();
+            this.ChooseFolder = new System.Windows.Forms.Button();
+            this.FolderPath = new System.Windows.Forms.TextBox();
+            this.label6 = new System.Windows.Forms.Label();
             ((System.ComponentModel.ISupportInitialize)(this.XmlWatcher)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.ATEFile)).BeginInit();
             this.SuspendLayout();
@@ -134,7 +137,8 @@
             this.Type.FormattingEnabled = true;
             this.Type.Items.AddRange(new object[] {
             "投入",
-            "产出"});
+            "产出",
+            "印刷机"});
             this.Type.Location = new System.Drawing.Point(204, 366);
             this.Type.Name = "Type";
             this.Type.Size = new System.Drawing.Size(436, 32);
@@ -195,7 +199,7 @@
             // 
             // NowQTY
             // 
-            this.NowQTY.Location = new System.Drawing.Point(204, 443);
+            this.NowQTY.Location = new System.Drawing.Point(204, 487);
             this.NowQTY.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.NowQTY.Name = "NowQTY";
             this.NowQTY.Size = new System.Drawing.Size(146, 35);
@@ -205,7 +209,7 @@
             // 
             this.label4.AutoSize = true;
             this.label4.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label4.Location = new System.Drawing.Point(34, 440);
+            this.label4.Location = new System.Drawing.Point(34, 484);
             this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label4.Name = "label4";
             this.label4.Size = new System.Drawing.Size(133, 38);
@@ -266,11 +270,46 @@
             this.ma_code.TableName = null;
             this.ma_code.TextBoxEnable = false;
             // 
+            // 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(672, 420);
+            this.ChooseFolder.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+            this.ChooseFolder.Name = "ChooseFolder";
+            this.ChooseFolder.Size = new System.Drawing.Size(156, 48);
+            this.ChooseFolder.TabIndex = 32;
+            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(204, 426);
+            this.FolderPath.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+            this.FolderPath.Name = "FolderPath";
+            this.FolderPath.Size = new System.Drawing.Size(436, 35);
+            this.FolderPath.TabIndex = 31;
+            // 
+            // label6
+            // 
+            this.label6.AutoSize = true;
+            this.label6.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label6.Location = new System.Drawing.Point(34, 426);
+            this.label6.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label6.Name = "label6";
+            this.label6.Size = new System.Drawing.Size(162, 38);
+            this.label6.TabIndex = 30;
+            this.label6.Text = "监控文件夹";
+            // 
             // AutoMakeQTY
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(1443, 640);
+            this.Controls.Add(this.ChooseFolder);
+            this.Controls.Add(this.FolderPath);
+            this.Controls.Add(this.label6);
             this.Controls.Add(this.ma_code);
             this.Controls.Add(this.li_code);
             this.Controls.Add(this.label5);
@@ -324,6 +363,9 @@
         private SearchTextBox li_code;
         private System.Windows.Forms.Label label5;
         private SearchTextBox ma_code;
+        private System.Windows.Forms.Button ChooseFolder;
+        private System.Windows.Forms.TextBox FolderPath;
+        private System.Windows.Forms.Label label6;
     }
 }
 

+ 71 - 21
FileWatcher/AutoMakeQTY.cs

@@ -10,6 +10,7 @@ using System.Net;
 using System.Net.Sockets;
 using System.IO.Ports;
 using System.Linq.Expressions;
+using System.Linq;
 
 namespace FileWatcher
 {
@@ -217,28 +218,35 @@ namespace FileWatcher
                 OperateResult.AppendText("线别不能为空\n");
                 return;
             }
-            string ExitConfirm = MessageBox.Show(this, "确认计数器是否置为0?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
-            if (ExitConfirm != "Yes")
-            {
-                return;
-            }
-            //设置按钮不可点击
-            StartWatch.Enabled = false;
-            ma_code.Enabled = false;
-            StopWatch.Enabled = true;
-            try
+            if (Type.Text == "印刷机")
             {
-                serialPort1.PortName = ComPort.Text;
-                serialPort1.BaudRate = int.Parse(BaudRate.Text);
-                serialPort1.Open();
                 Timer.Start();
             }
-            catch (Exception mes)
+            else
             {
-                if (BaudRate.Text == "" || BaudRate.Text == "")
-                    OperateResult.AppendText(">>请先维护波特率和串口\n");
-                else
-                    OperateResult.AppendText(">>" + mes.Message + "\n");
+                string ExitConfirm = MessageBox.Show(this, "确认计数器是否置为0?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
+                if (ExitConfirm != "Yes")
+                {
+                    return;
+                }
+                //设置按钮不可点击
+                StartWatch.Enabled = false;
+                ma_code.Enabled = false;
+                StopWatch.Enabled = true;
+                try
+                {
+                    serialPort1.PortName = ComPort.Text;
+                    serialPort1.BaudRate = int.Parse(BaudRate.Text);
+                    serialPort1.Open();
+                    Timer.Start();
+                }
+                catch (Exception mes)
+                {
+                    if (BaudRate.Text == "" || BaudRate.Text == "")
+                        OperateResult.AppendText(">>请先维护波特率和串口\n");
+                    else
+                        OperateResult.AppendText(">>" + mes.Message + "\n");
+                }
             }
             OperateResult.AppendText("开始执行监控\n");
         }
@@ -286,10 +294,42 @@ namespace FileWatcher
 
         private void Timer_Tick(object sender, EventArgs e)
         {
-            if (serialPort1.IsOpen)
+            if (Type.Text == "印刷机")
+            {
+                DateTime targetDate = new DateTime(2025, 3, 17);
+                var AllXmls = Directory.GetFiles(FolderPath.Text, "*.*", SearchOption.AllDirectories).Where(s => s.ToUpper().EndsWith(".CSV") || s.ToUpper().EndsWith(".INI"));
+                foreach (var Xml in AllXmls)
+                {
+                    //解析当天日志
+                    if (Xml.Contains(DateTime.Now.ToString("yyyy-MM-dd")))
+                    {
+                        var filteredLines = File.ReadLines(Xml).Skip(1) // 跳过标题行
+                        .Where(line =>
+                        {
+                            string[] parts = line.Split(',');
+                            if (parts.Length < 2) return false;
+                            if (DateTime.TryParse(parts[1], out DateTime timestamp))
+                            {
+                                return timestamp > DateTime.Now.AddDays(-10);
+                            }
+                            return false;
+                        });
+                        int pcbcount = int.Parse(dh.getFieldDataByCondition("make left join product on ma_prodcode=pr_code", "nvl(pr_pcbacount,1)", "ma_code='" + ma_code.Text + "'").ToString());
+                        foreach (var line in filteredLines)
+                        {
+                            dh.ExecuteSql("insert into makehourcount(mhc_id,mhc_macode,mhc_indate,mhc_type,mhc_qty,mhc_linecode)" +
+                            "values(makehourcount_seq.nextval,'" + ma_code.Text + "',sysdate,'" + Type.Text + "','" + pcbcount + "','" + li_code.Text + "')", "insert");
+                        }
+                    }
+                }
+            }
+            else
             {
-                byte[] data = HexStringToBytes("01 03 00 01 00 06 94 08");
-                serialPort1.Write(data, 0, data.Length);
+                if (serialPort1.IsOpen)
+                {
+                    byte[] data = HexStringToBytes("01 03 00 01 00 06 94 08");
+                    serialPort1.Write(data, 0, data.Length);
+                }
             }
         }
 
@@ -348,5 +388,15 @@ namespace FileWatcher
             return b;
         }
 
+        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;
+            }
+        }
     }
 }

+ 9 - 5
FileWatcher/AutoMakeQTYRZ.cs

@@ -175,7 +175,6 @@ namespace FileWatcher
         {
             try
             {
-
                 int len = serialPort1.BytesToRead;
                 Byte[] readBuffer = new Byte[len];
                 serialPort1.Read(readBuffer, 0, len); //将数据读入缓存
@@ -195,11 +194,15 @@ namespace FileWatcher
                     if (电流数据 == 0)
                     {
                         writedata = false;
-                        if (电流数据 == 0 && !writedata)
-                        {
-                            writedata = true;
-                        }
+                        //if (电流数据 == 0 && !writedata)
+                        //{
+                        //    writedata = true;
+                        //}
+                    }
+                    else {
+                        writedata = true;
                     }
+                    //如果电流不为0,则获取数据,本次获取的数据判断有效
                     if (writedata)
                     {
                         if (电流数据 != 0)
@@ -212,6 +215,7 @@ namespace FileWatcher
                             serialPort1.Write(data, 0, data.Length);
                         }
                     }
+                    //写入获取电流数据2秒后的数据
                     if (realwritedata)
                     {
                         if (电流数据 > 0)

+ 26 - 6
FileWatcher/DataHelper.cs

@@ -8,14 +8,20 @@ namespace FileWatcher
 {
     public class DataHelper
     {
-        // 系统默认的的连接字符串
-        private string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=N_MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=113.98.196.181)(PORT=1520)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
-        //用户选择的数据库的连接字符串
-        public static string DBConnectionString = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=N_MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=113.98.196.181)(PORT=1520)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+        ////次元
+        //private string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=YD_CYZZ;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.1.81.208)(PORT=11701)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+        ////用户选择的数据库的连接字符串
+        //public static string DBConnectionString = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=YD_CYZZ;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.1.81.208)(PORT=11701)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
 
-        //private string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=YD_CYZZ;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.0.85)(PORT=1520)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+        //华耘
+        //private string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=N_MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.1.81.208)(PORT=11697)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
         ////用户选择的数据库的连接字符串
-        //public static string DBConnectionString = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=YD_CYZZ;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.0.85)(PORT=1520)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+        //public static string DBConnectionString = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=N_MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.1.81.208)(PORT=11697)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+
+        //柯赛
+        private string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=N_MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.3.7)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+        //用户选择的数据库的连接字符串
+        public static string DBConnectionString = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=N_MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.3.7)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
 
         public static OracleConnection connection = null;
         OracleCommand command = null;
@@ -40,6 +46,20 @@ namespace FileWatcher
             }
         }
 
+        public DataHelper(string str)
+        {
+            try
+            {
+                //如果选择的是默认数据则直接用配置文件的信息连接,否则选择数据库的账套信息
+                    connection = new OracleConnection(str);
+                connection.Open();
+            }
+            catch (Exception e)
+            {
+
+            }
+        }
+
         /// <summary>
         /// 根据表名获取该表字段数据类型
         /// </summary>

+ 18 - 0
FileWatcher/FileWatcher.csproj

@@ -96,12 +96,24 @@
     </Reference>
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="AutoAnalysisDeviceKS.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="AutoAnalysisDeviceKS.Designer.cs">
+      <DependentUpon>AutoAnalysisDeviceKS.cs</DependentUpon>
+    </Compile>
     <Compile Include="AutoAnalysisXLSJC.cs">
       <SubType>Form</SubType>
     </Compile>
     <Compile Include="AutoAnalysisXLSJC.Designer.cs">
       <DependentUpon>AutoAnalysisXLSJC.cs</DependentUpon>
     </Compile>
+    <Compile Include="UploadMakePlan.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="UploadMakePlan.Designer.cs">
+      <DependentUpon>UploadMakePlan.cs</DependentUpon>
+    </Compile>
     <Compile Include="AutoMakeQTYRZ.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -278,9 +290,15 @@
     <Compile Include="测试记录解析DCW.Designer.cs">
       <DependentUpon>测试记录解析DCW.cs</DependentUpon>
     </Compile>
+    <EmbeddedResource Include="AutoAnalysisDeviceKS.resx">
+      <DependentUpon>AutoAnalysisDeviceKS.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="AutoAnalysisXLSJC.resx">
       <DependentUpon>AutoAnalysisXLSJC.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="UploadMakePlan.resx">
+      <DependentUpon>UploadMakePlan.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="AutoMakeQTYRZ.resx">
       <DependentUpon>AutoMakeQTYRZ.cs</DependentUpon>
     </EmbeddedResource>

+ 28 - 5
FileWatcher/Form4.Designer.cs

@@ -43,6 +43,8 @@
             this.button1 = new System.Windows.Forms.Button();
             this.pictureBox1 = new System.Windows.Forms.PictureBox();
             this.label7 = new System.Windows.Forms.Label();
+            this.comboBox1 = new System.Windows.Forms.ComboBox();
+            this.label8 = new System.Windows.Forms.Label();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
             this.SuspendLayout();
             // 
@@ -54,7 +56,7 @@
             this.StartWatch.Name = "StartWatch";
             this.StartWatch.Size = new System.Drawing.Size(128, 52);
             this.StartWatch.TabIndex = 17;
-            this.StartWatch.Text = "播放";
+            this.StartWatch.Text = "取消";
             this.StartWatch.UseVisualStyleBackColor = true;
             // 
             // textBox1
@@ -135,9 +137,9 @@
             this.label6.AutoSize = true;
             this.label6.Location = new System.Drawing.Point(61, 154);
             this.label6.Name = "label6";
-            this.label6.Size = new System.Drawing.Size(94, 24);
+            this.label6.Size = new System.Drawing.Size(58, 24);
             this.label6.TabIndex = 32;
-            this.label6.Text = "选择SOP";
+            this.label6.Text = "备注";
             // 
             // textBox5
             // 
@@ -154,7 +156,7 @@
             this.button1.Name = "button1";
             this.button1.Size = new System.Drawing.Size(128, 52);
             this.button1.TabIndex = 33;
-            this.button1.Text = "搜索";
+            this.button1.Text = "确定";
             this.button1.UseVisualStyleBackColor = true;
             // 
             // pictureBox1
@@ -174,11 +176,30 @@
             this.label7.TabIndex = 35;
             this.label7.Text = "图片表格";
             // 
+            // comboBox1
+            // 
+            this.comboBox1.FormattingEnabled = true;
+            this.comboBox1.Location = new System.Drawing.Point(185, 62);
+            this.comboBox1.Name = "comboBox1";
+            this.comboBox1.Size = new System.Drawing.Size(121, 32);
+            this.comboBox1.TabIndex = 36;
+            // 
+            // label8
+            // 
+            this.label8.AutoSize = true;
+            this.label8.Location = new System.Drawing.Point(61, 65);
+            this.label8.Name = "label8";
+            this.label8.Size = new System.Drawing.Size(58, 24);
+            this.label8.TabIndex = 37;
+            this.label8.Text = "原因";
+            // 
             // Form4
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(1419, 820);
+            this.Controls.Add(this.label8);
+            this.Controls.Add(this.comboBox1);
             this.Controls.Add(this.label7);
             this.Controls.Add(this.pictureBox1);
             this.Controls.Add(this.button1);
@@ -198,7 +219,7 @@
             this.Text = "Form4";
             this.Load += new System.EventHandler(this.Form4_Load);
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
-            this.ResumeLayout(true);
+            this.ResumeLayout(false);
             this.PerformLayout();
 
         }
@@ -219,5 +240,7 @@
         private System.Windows.Forms.Button button1;
         private System.Windows.Forms.PictureBox pictureBox1;
         private System.Windows.Forms.Label label7;
+        private System.Windows.Forms.ComboBox comboBox1;
+        private System.Windows.Forms.Label label8;
     }
 }

+ 5 - 1
FileWatcher/Program.cs

@@ -45,7 +45,11 @@ namespace FileWatcher
                 Application.EnableVisualStyles();
                 Application.SetCompatibleTextRenderingDefault(false);
                 if (principal.IsInRole(WindowsBuiltInRole.Administrator))
-                    Application.Run(new AutoAnalysisXmlByStep());
+                {
+                    Application.Run(new UploadMakePlan());
+                    //Application.Run(new SOP("", ""));
+                    //Application.Run(new AutoMakeQTY());
+                }
                 else
                 {
                     //创建启动对象

+ 9 - 7
FileWatcher/SOP.cs

@@ -90,13 +90,15 @@ namespace FileWatcher
             {
                 for (int i = 0; i < workbook.Worksheets.Count; i++)
                 {
-                    OperatResult.AppendText("正在解析Sheet" + workbook.Worksheets[i].Name + "\n");
-                    Worksheet she = workbook.Worksheets[i];
-                    if (JPG.Checked)
-                    {
-                        var myThread = new Thread(() => SaveFileToJPG(she));
-                        myThread.Start();
-                        filename.Add(she.Name + ".jpg");
+                    if (workbook.Worksheets[i].Name != "物料清单") {
+                        OperatResult.AppendText("正在解析Sheet" + workbook.Worksheets[i].Name + "\n");
+                        Worksheet she = workbook.Worksheets[i];
+                        if (JPG.Checked)
+                        {
+                            var myThread = new Thread(() => SaveFileToJPG(she));
+                            myThread.Start();
+                            filename.Add(she.Name + ".jpg");
+                        }
                     }
                 }
             }

+ 163 - 0
FileWatcher/UploadMakePlan.Designer.cs

@@ -0,0 +1,163 @@
+namespace FileWatcher
+{
+    partial class UploadMakePlan
+    {
+        /// <summary>
+        /// 必需的设计器变量。
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// 清理所有正在使用的资源。
+        /// </summary>
+        /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows 窗体设计器生成的代码
+
+        /// <summary>
+        /// 设计器支持所需的方法 - 不要修改
+        /// 使用代码编辑器修改此方法的内容。
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.components = new System.ComponentModel.Container();
+            this.XmlWatcher = new System.IO.FileSystemWatcher();
+            this.XmlFolder = new System.Windows.Forms.FolderBrowserDialog();
+            this.OperateResult = new System.Windows.Forms.RichTextBox();
+            this.Timer = new System.Windows.Forms.Timer(this.components);
+            this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components);
+            this.DateTime = new System.Windows.Forms.DateTimePicker();
+            this.FilePath = new System.Windows.Forms.TextBox();
+            this.label8 = new System.Windows.Forms.Label();
+            this.label2 = new System.Windows.Forms.Label();
+            this.ImportExcel1 = new System.Windows.Forms.OpenFileDialog();
+            this.Upload = new System.Windows.Forms.Button();
+            this.ChooseFile = new System.Windows.Forms.Button();
+            ((System.ComponentModel.ISupportInitialize)(this.XmlWatcher)).BeginInit();
+            this.SuspendLayout();
+            // 
+            // XmlWatcher
+            // 
+            this.XmlWatcher.EnableRaisingEvents = true;
+            this.XmlWatcher.Filter = "*.xml";
+            this.XmlWatcher.IncludeSubdirectories = true;
+            this.XmlWatcher.SynchronizingObject = this;
+            // 
+            // OperateResult
+            // 
+            this.OperateResult.Location = new System.Drawing.Point(979, 12);
+            this.OperateResult.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+            this.OperateResult.Name = "OperateResult";
+            this.OperateResult.Size = new System.Drawing.Size(506, 564);
+            this.OperateResult.TabIndex = 7;
+            this.OperateResult.Text = "";
+            // 
+            // DateTime
+            // 
+            this.DateTime.Location = new System.Drawing.Point(211, 107);
+            this.DateTime.Name = "DateTime";
+            this.DateTime.Size = new System.Drawing.Size(200, 35);
+            this.DateTime.TabIndex = 8;
+            // 
+            // FilePath
+            // 
+            this.FilePath.Enabled = false;
+            this.FilePath.Location = new System.Drawing.Point(211, 200);
+            this.FilePath.Name = "FilePath";
+            this.FilePath.Size = new System.Drawing.Size(395, 35);
+            this.FilePath.TabIndex = 204;
+            // 
+            // label8
+            // 
+            this.label8.AutoSize = true;
+            this.label8.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label8.Location = new System.Drawing.Point(48, 194);
+            this.label8.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label8.Name = "label8";
+            this.label8.Size = new System.Drawing.Size(146, 41);
+            this.label8.TabIndex = 203;
+            this.label8.Text = "文件路径";
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label2.Location = new System.Drawing.Point(48, 102);
+            this.label2.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(146, 41);
+            this.label2.TabIndex = 205;
+            this.label2.Text = "计划日期";
+            // 
+            // ImportExcel1
+            // 
+            this.ImportExcel1.FileName = "ImportExcel";
+            // 
+            // Upload
+            // 
+            this.Upload.Location = new System.Drawing.Point(211, 313);
+            this.Upload.Name = "Upload";
+            this.Upload.Size = new System.Drawing.Size(185, 43);
+            this.Upload.TabIndex = 206;
+            this.Upload.Text = "上传";
+            this.Upload.UseVisualStyleBackColor = true;
+            this.Upload.Click += new System.EventHandler(this.Upload_Click);
+            // 
+            // ChooseFile
+            // 
+            this.ChooseFile.Location = new System.Drawing.Point(642, 197);
+            this.ChooseFile.Name = "ChooseFile";
+            this.ChooseFile.Size = new System.Drawing.Size(185, 43);
+            this.ChooseFile.TabIndex = 207;
+            this.ChooseFile.Text = "选择文件";
+            this.ChooseFile.UseVisualStyleBackColor = true;
+            this.ChooseFile.Click += new System.EventHandler(this.ChooseFile_Click);
+            // 
+            // UploadMakePlan
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(1498, 640);
+            this.Controls.Add(this.ChooseFile);
+            this.Controls.Add(this.Upload);
+            this.Controls.Add(this.label2);
+            this.Controls.Add(this.FilePath);
+            this.Controls.Add(this.label8);
+            this.Controls.Add(this.DateTime);
+            this.Controls.Add(this.OperateResult);
+            this.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+            this.MaximizeBox = false;
+            this.Name = "UploadMakePlan";
+            this.Text = "生产计划上传";
+            this.Load += new System.EventHandler(this.Form1_Load);
+            ((System.ComponentModel.ISupportInitialize)(this.XmlWatcher)).EndInit();
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private System.IO.FileSystemWatcher XmlWatcher;
+        private System.Windows.Forms.FolderBrowserDialog XmlFolder;
+        private System.Windows.Forms.RichTextBox OperateResult;
+        private System.Windows.Forms.Timer Timer;
+        private System.Windows.Forms.NotifyIcon notifyIcon1;
+        private System.Windows.Forms.DateTimePicker DateTime;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.TextBox FilePath;
+        private System.Windows.Forms.Label label8;
+        private System.Windows.Forms.OpenFileDialog ImportExcel1;
+        private System.Windows.Forms.Button Upload;
+        private System.Windows.Forms.Button ChooseFile;
+    }
+}
+

+ 179 - 0
FileWatcher/UploadMakePlan.cs

@@ -0,0 +1,179 @@
+using System;
+using System.Data;
+using System.IO;
+using System.Windows.Forms;
+using System.Text;
+using NPOI.SS.UserModel;
+using NPOI.XSSF.UserModel;
+using Oracle.ManagedDataAccess.Client;
+
+namespace FileWatcher
+{
+    public partial class UploadMakePlan : Form
+    {
+
+        string connectionString = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=N_MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.3.7)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+
+
+        StringBuilder sql = new StringBuilder();
+
+        DataHelper dh;
+
+        string imaster;
+
+        public UploadMakePlan()
+        {
+            InitializeComponent();
+            StartPosition = FormStartPosition.CenterScreen;
+        }
+
+        string fieltype = "";
+        string ftpulr = "";
+        private void Form1_Load(object sender, EventArgs e)
+        {
+            dh = new DataHelper(connectionString);
+        }
+
+        private void Upload_Click(object sender, EventArgs e)
+        {
+            DateTime today = DateTime.Value;
+            string todayDate = today.ToString("MMdd");
+            string code = dh.GetSerialNumberByCaller("MakePlan");
+            string id = "";
+            DataTable dt = (DataTable)dh.ExecuteSql("select mp_id from MakePlan where to_char(mp_begintime,'yyyymmdd')='" + today.ToString("yyyyMMdd") + "'", "select");
+            if (dt.Rows.Count == 0)
+            {
+                id = dh.GetSEQ("MakePlan_seq");
+                dh.ExecuteSql("insert into MakePlan(MP_ID, MP_CODE, MP_KIND, MP_INDATE, MP_STATUS, MP_STATUSCODE, MP_BEGINTIME)" +
+                    "values(" + id + ",'" + code + "','日计划',sysdate,'在录入','ENTERING',to_date('" + today.ToString("yyyyMMdd") + "','yyyymmdd'))", "insert");
+            }
+            else
+            {
+                id = dt.Rows[0]["mp_id"].ToString();
+                dh.ExecuteSql("delete from MakePlandetail where mpd_mpid=" + id, "delete");
+            }
+
+            using (FileStream file = new FileStream(FilePath.Text, FileMode.Open, FileAccess.Read))
+            {
+                XSSFWorkbook workbook = new XSSFWorkbook(file);
+                int detno = 1;
+
+                for (int i = 0; i < workbook.NumberOfSheets; i++)
+                {
+                    ISheet sheet = workbook.GetSheetAt(i);
+                    string sheetName = sheet.SheetName;
+                    if (sheetName.Contains(todayDate))
+                    {
+                        OperateResult.AppendText(sheetName);
+                        OperateResult.AppendText($"Processing sheet: {sheetName}\n");
+                        //Console.WriteLine($"Processing sheet: {sheetName}");
+
+                        // 获取标题行(第4行)
+                        IRow headerRow = sheet.GetRow(3); // 第4行索引为3
+                        if (headerRow == null)
+                        {
+                            Console.WriteLine("Header row not found.");
+                            continue;
+                        }
+
+                        // 获取标题列的索引
+                        int wccodeIndex = -1;
+                        int orderdetnoIndex = -1;
+                        int ordercodeIndex = -1;
+                        int planqtyIndex = -1;
+                        int remarkIndex = -1;
+
+                        for (int colIndex = 0; colIndex < headerRow.LastCellNum; colIndex++)
+                        {
+                            ICell cell = headerRow.GetCell(colIndex);
+                            if (cell != null)
+                            {
+                                string headerValue = cell.ToString().Trim().Replace("\r\n", "").Replace("\n", "").Replace("\r", "");
+                                if (headerValue == "工作中心")
+                                {
+                                    wccodeIndex = colIndex;
+                                }
+                                else if (headerValue == "订单序号")
+                                {
+                                    orderdetnoIndex = colIndex;
+                                }
+                                else if (headerValue == "订单编号")
+                                {
+                                    ordercodeIndex = colIndex;
+                                }
+                                else if (headerValue == "计划数量")
+                                {
+                                    planqtyIndex = colIndex;
+                                }
+                                else if (headerValue.Contains("备注") && !headerValue.Contains("生产异常备注"))
+                                {
+                                    remarkIndex = colIndex;
+                                }
+                            }
+                        }
+
+                        if (wccodeIndex == -1 || orderdetnoIndex == -1 || ordercodeIndex == -1 || planqtyIndex == -1 || remarkIndex == -1)
+                        {
+                            Console.WriteLine("Required columns not found in the header.");
+                            continue;
+                        }
+
+                        using (OracleConnection conn = new OracleConnection(connectionString))
+                        {
+                            conn.Open();
+                            for (int rowIndex = 4; rowIndex <= sheet.LastRowNum; rowIndex++) // 从第5行开始解析数据
+                            {
+                                IRow row = sheet.GetRow(rowIndex);
+                                if (row != null)
+                                {
+                                    string wccode = row.GetCell(wccodeIndex, MissingCellPolicy.CREATE_NULL_AS_BLANK).StringCellValue.ToString();
+                                    if (wccode == "")
+                                    {
+                                        continue;
+                                    }
+                                    string orderdetno = row.GetCell(orderdetnoIndex, MissingCellPolicy.CREATE_NULL_AS_BLANK).ToString();
+                                    string ordercode = row.GetCell(ordercodeIndex, MissingCellPolicy.CREATE_NULL_AS_BLANK).ToString();
+                                    string planqty = row.GetCell(planqtyIndex, MissingCellPolicy.CREATE_NULL_AS_BLANK).NumericCellValue.ToString();
+                                    string remark = row.GetCell(remarkIndex, MissingCellPolicy.CREATE_NULL_AS_BLANK).ToString();
+                                    if (!string.IsNullOrEmpty(wccode) && !string.IsNullOrEmpty(orderdetno) && !string.IsNullOrEmpty(ordercode))
+                                    {
+                                        if (!dh.CheckExist("MakePlanDetail left join makeplan on mpd_mpid=mp_id ", "trunc(mp_begintime)=trunc(sysdate) and mpd_orderdetno='" + orderdetno + "' and mpd_ordercode='" + ordercode + "' and mpd_wccode='" + wccode + "'"))
+                                        {
+                                            string insertQuery = "INSERT INTO MakePlanDetail (mpd_mpid,mpd_detno,mpd_id,mpd_wccode, mpd_orderdetno, mpd_ordercode,mpd_outqty,mpd_remark) VALUES (" + id + "," + detno + ",MakePlanDetail_seq.nextval,:1, :2, :3,:4,:5)";
+                                            using (OracleCommand cmd = new OracleCommand(insertQuery, conn))
+                                            {
+                                                cmd.Parameters.Add(new OracleParameter(":1", wccode));
+                                                cmd.Parameters.Add(new OracleParameter(":2", orderdetno));
+                                                cmd.Parameters.Add(new OracleParameter(":3", ordercode));
+                                                cmd.Parameters.Add(new OracleParameter(":4", planqty));
+                                                cmd.Parameters.Add(new OracleParameter(":5", remark));
+                                                cmd.ExecuteNonQuery();
+                                            }
+                                        }
+                                        else
+                                        {
+                                            OperateResult.AppendText(" 序号'" + orderdetno + "' 销售订单'" + ordercode + "' 工作中心'" + wccode + "' 重复");
+                                        }
+                                    }
+                                }
+                                detno = detno + 1;
+                            }
+                        }
+                        dh.ExecuteSql("delete from MakePlanDetail where mpd_orderdetno is null", "delete");
+                        OperateResult.AppendText("计划上传成功");
+                    }
+                }
+            }
+        }
+
+        private void ChooseFile_Click(object sender, EventArgs e)
+        {
+            DialogResult result;
+            result = ImportExcel1.ShowDialog();
+            if (result == DialogResult.OK)
+            {
+                FilePath.Text = ImportExcel1.FileName;
+            }
+        }
+    }
+}

+ 138 - 0
FileWatcher/UploadMakePlan.resx

@@ -0,0 +1,138 @@
+<?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="XmlWatcher.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </metadata>
+  <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>81</value>
+  </metadata>
+  <metadata name="XmlFolder.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>164, 17</value>
+  </metadata>
+  <metadata name="Timer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>296, 17</value>
+  </metadata>
+  <metadata name="notifyIcon1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>435, 17</value>
+  </metadata>
+  <metadata name="ImportExcel1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>1470, 17</value>
+  </metadata>
+</root>

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

@@ -78,7 +78,7 @@
             this.Name = "ChangeMaster";
             this.Text = "切换账套";
             this.Load += new System.EventHandler(this.ChangeMaster_Load);
-            this.ResumeLayout(false);
+            this.ResumeLayout(true);
             this.PerformLayout();
 
         }

+ 1 - 1
UAS-出货标签管理(贸易版)/CustomControl/BlurSearch.Designer.cs

@@ -73,7 +73,7 @@
             this.Size = new System.Drawing.Size(154, 120);
             this.Load += new System.EventHandler(this.BlurSearch_Load);
             this.Leave += new System.EventHandler(this.BlurSearch_Leave);
-            this.ResumeLayout(false);
+            this.ResumeLayout(true);
             this.PerformLayout();
 
         }

+ 1 - 1
UAS-出货标签管理(贸易版)/CustomControl/DataGridViewWithSerialNum.Designer.cs

@@ -40,7 +40,7 @@ namespace UAS_LabelMachine.CustomControl
             this.RowTemplate.Height = 23;
             this.CellPainting += new System.Windows.Forms.DataGridViewCellPaintingEventHandler(this.DataGridViewWithSerialNum_CellPainting);
             ((System.ComponentModel.ISupportInitialize)(this)).EndInit();
-            this.ResumeLayout(false);
+            this.ResumeLayout(true);
         }
         #endregion
     }

+ 1 - 1
UAS-出货标签管理(贸易版)/CustomControl/EnterTextBox.Designer.cs

@@ -35,7 +35,7 @@
             this.Size = new System.Drawing.Size(196, 21);
             this.Enter += new System.EventHandler(this.EnterTextBox_Enter);
             this.Leave += new System.EventHandler(this.EnterTextBox_Leave);
-            this.ResumeLayout(false);
+            this.ResumeLayout(true);
 
         }
 

+ 1 - 1
UAS-出货标签管理(贸易版)/CustomControl/HeadBar.Designer.cs

@@ -61,7 +61,7 @@
             this.Name = "HeadBar";
             ((System.ComponentModel.ISupportInitialize)(this.MinWindow)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.CloseWindow)).EndInit();
-            this.ResumeLayout(false);
+            this.ResumeLayout(true);
 
         }
 

+ 1 - 1
UAS-出货标签管理(贸易版)/CustomControl/NumOnlyTextBox.Designer.cs

@@ -35,7 +35,7 @@
             this.Enter += new System.EventHandler(this.NumOnlyTextBox_Enter);
             this.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.NumOnlyTextBox_KeyPress);
             this.Leave += new System.EventHandler(this.NumOnlyTextBox_Leave);
-            this.ResumeLayout(false);
+            this.ResumeLayout(true);
 
         }
 

+ 2 - 2
UAS-出货标签管理(贸易版)/CustomControl/Pagination.Designer.cs

@@ -233,7 +233,7 @@ namespace UAS_LabelMachine.CustomControl
             this.Cursor = System.Windows.Forms.Cursors.Hand;
             this.Name = "Pagination";
             this.Size = new System.Drawing.Size(543, 32);
-            this.panel1.ResumeLayout(false);
+            this.panel1.ResumeLayout(true);
             this.panel1.PerformLayout();
             ((System.ComponentModel.ISupportInitialize)(this.UpLoadData)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.DownLoadTemplet)).EndInit();
@@ -243,7 +243,7 @@ namespace UAS_LabelMachine.CustomControl
             ((System.ComponentModel.ISupportInitialize)(this.LastPage)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.NextPage)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.FirstPage)).EndInit();
-            this.ResumeLayout(false);
+            this.ResumeLayout(true);
 
         }
 

+ 1 - 1
UAS-出货标签管理(贸易版)/CustomControl/PrinterCombox.Designer.cs

@@ -50,7 +50,7 @@
             this.Name = "PrinterCombox";
             this.Size = new System.Drawing.Size(189, 19);
             this.Load += new System.EventHandler(this.PrinterCombox_Load);
-            this.ResumeLayout(false);
+            this.ResumeLayout(true);
 
         }
 

+ 1 - 1
UAS-出货标签管理(贸易版)/CustomControl/SearchTextBox.Designer.cs

@@ -64,7 +64,7 @@
             this.Name = "SearchTextBox";
             this.Size = new System.Drawing.Size(247, 21);
             ((System.ComponentModel.ISupportInitialize)(this.Search_Icon)).EndInit();
-            this.ResumeLayout(false);
+            this.ResumeLayout(true);
             this.PerformLayout();
 
         }

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

@@ -139,7 +139,7 @@
             this.Text = "客户规则";
             this.Load += new System.EventHandler(this.CustomerRule_Load);
             this.SizeChanged += new System.EventHandler(this.CustomerRule_SizeChanged);
-            this.ResumeLayout(false);
+            this.ResumeLayout(true);
             this.PerformLayout();
 
         }

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

@@ -174,7 +174,7 @@
             this.Name = "DateCodeSetAndPrint";
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
             this.Text = "更新批号";
-            this.ResumeLayout(false);
+            this.ResumeLayout(true);
             this.PerformLayout();
 
         }

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

@@ -72,7 +72,7 @@
             this.Load += new System.EventHandler(this.DbFind_Load);
             this.SizeChanged += new System.EventHandler(this.DbFind_SizeChanged);
             ((System.ComponentModel.ISupportInitialize)(this.DbFindGridView)).EndInit();
-            this.ResumeLayout(false);
+            this.ResumeLayout(true);
 
         }
 

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

@@ -157,7 +157,7 @@
             this.Load += new System.EventHandler(this.ExportColumns_Load);
             ((System.ComponentModel.ISupportInitialize)(this.FirstPage)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.DataPage)).EndInit();
-            this.ResumeLayout(false);
+            this.ResumeLayout(true);
             this.PerformLayout();
 
         }

+ 3 - 3
UAS-出货标签管理(贸易版)/ExportExcel.Designer.cs

@@ -609,11 +609,11 @@
             this.Name = "ExportExcel";
             this.Text = "导出数据";
             this.Load += new System.EventHandler(this.ExportExcel_Load);
-            this.groupBox1.ResumeLayout(false);
+            this.groupBox1.ResumeLayout(true);
             this.groupBox1.PerformLayout();
-            this.groupBox2.ResumeLayout(false);
+            this.groupBox2.ResumeLayout(true);
             this.groupBox2.PerformLayout();
-            this.ResumeLayout(false);
+            this.ResumeLayout(true);
             this.PerformLayout();
 
         }

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

@@ -192,7 +192,7 @@ namespace UAS_LabelMachine
                 {
                     FilePath = eh.JINYUAN(dt1, dt, ExportFileDialog.SelectedPath, inoutno, SplitType, int.Parse(RowNum.Text), conditionbox);
                 }
-                else if (pi_cardcode == dh.GetConfig("LIPUXIN", "ExportProdExcel").ToString())
+                else if (pi_cardcode == dh.GetConfig("LIPUXIN", "ExportProdExcel").ToString()|| pi_cardcode== "101269")
                 {
                     FilePath = eh.LIPIUXIN(dt1, dt, ExportFileDialog.SelectedPath, inoutno, SplitType, int.Parse(RowNum.Text), conditionbox);
                 }

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

@@ -200,7 +200,7 @@
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.LoginIcon)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.ComData)).EndInit();
-            this.ResumeLayout(false);
+            this.ResumeLayout(true);
             this.PerformLayout();
 
         }

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

@@ -253,7 +253,7 @@
             this.Text = "权限设置";
             this.Load += new System.EventHandler(this.PowerSetting_Load);
             ((System.ComponentModel.ISupportInitialize)(this.PowerSetDGV)).EndInit();
-            this.ResumeLayout(false);
+            this.ResumeLayout(true);
             this.PerformLayout();
 
         }

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

@@ -55,7 +55,7 @@
             this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.PreViewWindow_FormClosed);
             this.Load += new System.EventHandler(this.PreViewWindow_Load);
             ((System.ComponentModel.ISupportInitialize)(this.LabelPreView)).EndInit();
-            this.ResumeLayout(false);
+            this.ResumeLayout(true);
 
         }
 

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

@@ -12,18 +12,18 @@ namespace UAS_LabelMachine
     public class DataHelper
     {
 
-        ////深爱地址
-        //private readonly string ConnectionStrings = "Data Source=172.16.0.22/orcl;User ID=SZSI_P;PassWord=select!#%*(";
+        //深爱地址
+        private readonly string ConnectionStrings = "Data Source=172.16.0.22/orcl;User ID=SZSI_P;PassWord=select!#%*(";
 
-        //private readonly string IPConnectionStrings = "Data Source=172.16.0.22/orcl;User ID=SZSI_P;PassWord=select!#%*(";
-        ////深爱ERP地址
-        //public static readonly string ERPAddesss = "http://172.16.0.20:8099/ERP/";
-        ////深爱FTP
-        //public static readonly string FTPAddress = "ftp://172.16.0.22|vsftpd|vsftpd";
+        private readonly string IPConnectionStrings = "Data Source=172.16.0.22/orcl;User ID=SZSI_P;PassWord=select!#%*(";
+        //深爱ERP地址
+        public static readonly string ERPAddesss = "http://172.16.0.20:8099/ERP/";
+        //深爱FTP
+        public static readonly string FTPAddress = "ftp://172.16.0.22|vsftpd|vsftpd";
 
-        //public static readonly string InnerFTPAddress = "ftp://172.16.0.22|vsftpd|vsftpd";
-        ////Oracle端口
-        //public static readonly string OraclePort = "1521";
+        public static readonly string InnerFTPAddress = "ftp://172.16.0.22|vsftpd|vsftpd";
+        //Oracle端口
+        public static readonly string OraclePort = "1521";
 
         //private readonly string ConnectionStrings = "Data Source=183.238.26.45/orcl;User ID=N_HC;PassWord=select!#%*(";
 
@@ -50,17 +50,17 @@ namespace UAS_LabelMachine
         ////Oracle端口
         //public static readonly string OraclePort = "1521";
 
-        private readonly string ConnectionStrings = "Data Source=in.ysksemi.com/orcl;User ID=YSK_DATACENTER;PassWord=select!#%*(";
+        //private readonly string ConnectionStrings = "Data Source=in.ysksemi.com/orcl;User ID=YSK_DATACENTER;PassWord=select!#%*(";
 
-        private readonly string IPConnectionStrings = "Data Source=in.ysksemi.com/orcl;User ID=YSK_DATACENTER;PassWord=select!#%*(";
-        //永顺康地址
-        public static readonly string ERPAddesss = "http://in.ysksemi.com:8099/ERP/";
-        //永顺康FTP
-        public static readonly string FTPAddress = "ftp://in.ysksemi.com:30000|vsftpd|vsftpd3cd79014ec";
+        //private readonly string IPConnectionStrings = "Data Source=in.ysksemi.com/orcl;User ID=YSK_DATACENTER;PassWord=select!#%*(";
+        ////永顺康地址
+        //public static readonly string ERPAddesss = "http://in.ysksemi.com:8099/ERP/";
+        ////永顺康FTP
+        //public static readonly string FTPAddress = "ftp://in.ysksemi.com:30000|vsftpd|vsftpd3cd79014ec";
 
-        public static readonly string InnerFTPAddress = "ftp://192.168.0.251:30000|vsftpd|vsftpd3cd79014ec";
-        //Oracle端口
-        public static readonly string OraclePort = "1521";
+        //public static readonly string InnerFTPAddress = "ftp://192.168.0.251:30000|vsftpd|vsftpd3cd79014ec";
+        ////Oracle端口
+        //public static readonly string OraclePort = "1521";
 
         ////凯而高地址
         //private readonly string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=KRG_TEST;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=112.25.154.186)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";

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

@@ -78,7 +78,7 @@
             this.Name = "ReSetMaxNum";
             this.Text = "流水设置";
             this.Load += new System.EventHandler(this.ReSetMaxNum_Load);
-            this.ResumeLayout(false);
+            this.ResumeLayout(true);
             this.PerformLayout();
 
         }

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

@@ -74,7 +74,7 @@
             this.Text = "SetLoadingWindow";
             this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.SetLoadingWindow_FormClosing);
             this.Load += new System.EventHandler(this.SetLoadingWindow_Load);
-            this.ResumeLayout(false);
+            this.ResumeLayout(true);
 
         }
 

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

@@ -180,7 +180,7 @@
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
             this.Text = "DateCodeSetAndPrint";
             this.Load += new System.EventHandler(this.DateCodeSetAndPrint_Load);
-            this.ResumeLayout(false);
+            this.ResumeLayout(true);
             this.PerformLayout();
 
         }

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 370 - 69
UAS-出货标签管理(贸易版)/UAS_出货标签管理.Designer.cs


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

@@ -261,12 +261,22 @@ namespace UAS_LabelMachine
             {
                 try
                 {
-                    lbl = new ApplicationClass();
+                    engine = new Engine(true);
+                    PrintMethod = "BarTender";
                 }
-                catch (Exception)
+                catch (Exception ex)
                 {
-                    MessageBox.Show("未安装CodeSoft软件或者版本不正确");
+                    MessageLog.AppendText(ex.Message + ex.StackTrace);
+                    //MessageBox.Show(ex.Message + ex.StackTrace);
                 }
+                //try
+                //{
+                //    lbl = new ApplicationClass();
+                //}
+                //catch (Exception)
+                //{
+                //    MessageBox.Show("未安装CodeSoft软件或者版本不正确");
+                //}
             }
             else
             {
@@ -289,6 +299,8 @@ namespace UAS_LabelMachine
 
         private void Sg_code_DbChange(object sender, EventArgs e)
         {
+            Form f = Form.ActiveForm;
+          
             DataTable dt = sg_code.ReturnData;
             BaseUtil.SetFormValue(this.Controls, dt);
         }
@@ -1188,7 +1200,7 @@ namespace UAS_LabelMachine
 
                     if (dh.GetConfig("AutoBarcode", "ProdInOut!Sale").ToString() != "")
                     {
-                        string[] param = new string[] { PI_ID, "", "" };
+                        string[] param = new string[] { PI_ID, ""};
                         dh.CallProcedure("GetCustBarcode", ref param);
                     }
                     if (dh.GetConfig("PassOrNeg", "FTPModel").ToString() != "Y")
@@ -2124,20 +2136,7 @@ namespace UAS_LabelMachine
                         MidDoc.Close();
                     if (MidFormat != null)
                         MidFormat.Close(SaveOptions.DoNotSaveChanges);
-                    if (MidLabelCombox.Text != "" && MidLabelCombox.SelectedValue != null && !GetGridOnly.Checked)
-                    {
-                        System.DateTime time = Convert.ToDateTime(MidLabelCombox.SelectedValue.ToString().Split('#')[2]);
-                        if (PrintMethod == "CodeSoft")
-                        {
-                            MidDoc = lbl.Documents.Open(BaseUtil.GetLabelUrl(MidLabelCombox.SelectedValue.ToString().Split('#')[1], MidLabelCombox.Text, time));
-                            MidDoc.Printer.Name = MidLabelPrinter.Text;
-                        }
-                        else
-                        {
-                            MidFormat = engine.Documents.Open(BaseUtil.GetLabelUrl(MidLabelCombox.SelectedValue.ToString().Split('#')[1], MidLabelCombox.Text, time));
-                            MidFormat.PrintSetup.PrinterName = MidLabelPrinter.Text;
-                        }
-                    }
+                    MidFormat = engine.Documents.Open(ftpOperater.DownLoadTo + MidLabelCombox.Text);
                 }
             }
             catch (Exception) { }

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

@@ -458,7 +458,7 @@
             this.Load += new System.EventHandler(this.生成条码_Load);
             this.SizeChanged += new System.EventHandler(this.生成条码_SizeChanged);
             ((System.ComponentModel.ISupportInitialize)(this.ProdIoInfDGV)).EndInit();
-            this.ResumeLayout(false);
+            this.ResumeLayout(true);
             this.PerformLayout();
 
         }

+ 1 - 1
UAS-出货标签管理(贸易版)/采集策略.Designer.cs

@@ -1566,7 +1566,7 @@
             this.Text = "采集策略";
             this.Load += new System.EventHandler(this.采集策略_Load);
             this.SizeChanged += new System.EventHandler(this.采集策略_SizeChanged);
-            this.ResumeLayout(false);
+            this.ResumeLayout(true);
             this.PerformLayout();
 
         }

+ 1 - 1
UAS-出货标签管理(贸易版)/附件内容打印.Designer.cs

@@ -506,7 +506,7 @@
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
             this.Text = "附加内容打印";
             this.Load += new System.EventHandler(this.附件内容打印_Load);
-            this.ResumeLayout(false);
+            this.ResumeLayout(true);
             this.PerformLayout();
 
         }

+ 2 - 2
UAS_BARCODEIO/DataHelper.cs

@@ -13,9 +13,9 @@ namespace UAS_BARCODEIO
         ////用户选择的数据库的连接字符串
         //public static string DBConnectionString = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=SENGWILL;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=sengwill.hicp.net)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
 
-        private string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=N_JICE_ZS;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=172.16.9.2)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+        private string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=N_MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.1.81.208)(PORT=11702)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
         //用户选择的数据库的连接字符串
-        public static string DBConnectionString = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=N_JICE_ZS;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=172.16.9.2)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+        public static string DBConnectionString = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=N_MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.1.81.208)(PORT=11702)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
 
         public static OracleConnection connection = null;
         OracleCommand command = null;

+ 13 - 0
UAS_BARCODEIO/极测_出货清单打印.Designer.cs

@@ -49,6 +49,7 @@
             this.PrintBarCode = new System.Windows.Forms.Button();
             this.label3 = new System.Windows.Forms.Label();
             this.spl_code = new UAS_BARCODEIO.SearchTextBox();
+            this.Refresh = new System.Windows.Forms.Button();
             ((System.ComponentModel.ISupportInitialize)(this.BarcodeIO)).BeginInit();
             this.SuspendLayout();
             // 
@@ -262,11 +263,22 @@
             this.spl_code.TextBoxEnable = false;
             this.spl_code.UserControlTextChanged += new UAS_BARCODEIO.SearchTextBox.OnTextChange(this.spl_code_UserControlTextChanged);
             // 
+            // Refresh
+            // 
+            this.Refresh.Location = new System.Drawing.Point(1439, 34);
+            this.Refresh.Name = "Refresh";
+            this.Refresh.Size = new System.Drawing.Size(169, 45);
+            this.Refresh.TabIndex = 42;
+            this.Refresh.Text = "刷新数据";
+            this.Refresh.UseVisualStyleBackColor = true;
+            this.Refresh.Click += new System.EventHandler(this.Refresh_Click);
+            // 
             // 极测_出货清单打印
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(2136, 1338);
+            this.Controls.Add(this.Refresh);
             this.Controls.Add(this.spl_code);
             this.Controls.Add(this.label3);
             this.Controls.Add(this.ChooseAll);
@@ -309,6 +321,7 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn spld_sncode;
         private System.Windows.Forms.DataGridViewTextBoxColumn spld_wjqty;
         private System.Windows.Forms.DataGridViewTextBoxColumn spld_remark;
+        private System.Windows.Forms.Button Refresh;
     }
 }
 

+ 10 - 5
UAS_BARCODEIO/极测_出货清单打印.cs

@@ -55,7 +55,7 @@ namespace UAS_BARCODEIO
         private void Form1_Load(object sender, EventArgs e)
         {
             SystemInf.dh = dh;
-            spl_code.TableName = "SnPartsList ";
+            spl_code.TableName = "SnPartsList@ERP";
             spl_code.SelectField = "spl_code # 单据编号";
             spl_code.FormName = Name;
             spl_code.DBTitle = "解析规则查询";
@@ -126,7 +126,7 @@ namespace UAS_BARCODEIO
                 {
                     string barcode = "";
                     string[] param = new string[] { "", "", barcode };
-                    dh.CallProcedure("SP_GETBARCODE", ref param);
+                    dh.CallProcedure("SP_GETBARCODE@ERP", ref param);
                     barcode = param[2].Replace("BARCODE:", "");
                     format.SubStrings["BARCODE"].Value = barcode;
                     format.SubStrings["PRSPEC"].Value = BarcodeIO.Rows[i].Cells["spld_prodspec"].Value.ToString();
@@ -135,8 +135,8 @@ namespace UAS_BARCODEIO
                     format.SubStrings["QTY"].Value = BarcodeIO.Rows[i].Cells["spld_thisqty"].Value.ToString();
                     format.SubStrings["DC"].Value = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
 
-                    dh.ExecuteSql("insert into prodiobarcode(pib_id,pib_prodcode,pib_inoutno,pib_barcode,pib_indate,pib_qty)" +
-                        "values(prodiobarcode_seq.nextval,'" + BarcodeIO.Rows[i].Cells["spld_prodcode"].Value.ToString() + "','" + spl_code.Text + "','" + barcode + "',sysdate,'" + BarcodeIO.Rows[i].Cells["spld_thisqty"].Value.ToString() + "')", "insert");
+                    dh.ExecuteSql("insert into prodiobarcode@ERP(pib_id,pib_prodcode,pib_inoutno,pib_barcode,pib_indate,pib_qty)" +
+                        "values(prodiobarcode_seq.nextval@ERP,'" + BarcodeIO.Rows[i].Cells["spld_prodcode"].Value.ToString() + "','" + spl_code.Text + "','" + barcode + "',sysdate,'" + BarcodeIO.Rows[i].Cells["spld_thisqty"].Value.ToString() + "')", "insert");
 
                     format.PrintSetup.PrinterName = PrinterList.Text;
                     format.PrintSetup.IdenticalCopiesOfLabel = 1;
@@ -205,7 +205,7 @@ namespace UAS_BARCODEIO
         {
             DataTable dt = (DataTable)dh.ExecuteSql("select spld_detno,spld_module,spld_prodcode,spld_proddetail" +
                 ",spld_prodspec,spld_produnit,spld_baseqty,spld_qty,spld_sncode,spld_sndetno,spld_thisqty,spld_remark " +
-                " from SnPartsList left join SNPARTSLISTDETAIL on spl_id=spld_splid where spl_code='" + spl_code.Text + "'", "select");
+                " from SnPartsList@ERP left join SNPARTSLISTDETAIL@ERP on spl_id=spld_splid where spl_code='" + spl_code.Text + "'", "select");
             if (dt.Rows.Count == 0)
             {
                 MessageBox.Show("单据编号不存在");
@@ -213,5 +213,10 @@ namespace UAS_BARCODEIO
             }
             BarcodeIO.DataSource = dt;
         }
+
+        private void Refresh_Click(object sender, EventArgs e)
+        {
+            LoadGridData();
+        }
     }
 }

+ 42 - 0
UAS_BARCODEIO/极测_出货清单打印.resx

@@ -159,4 +159,46 @@
   <metadata name="spld_remark.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
+  <metadata name="CheckBox.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="spld_detno.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="spld_module.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="spld_prodcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="spld_proddetail.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="spld_prodspec.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="spld_produnit.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="spld_baseqty.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="spld_qty.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="spld_thisqty.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="spld_sndetno.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="spld_sncode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="spld_wjqty.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="spld_remark.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
 </root>

+ 3 - 0
UAS_MES_JC/CustomControl/HeadBar/HeadBar.Designer.cs

@@ -105,6 +105,9 @@
             // 
             resources.ApplyResources(this.UpperCollection, "UpperCollection");
             this.UpperCollection.Name = "UpperCollection";
+            // 
+            // 
+            // 
             this.UpperCollection.Properties.Appearance.Font = ((System.Drawing.Font)(resources.GetObject("UpperCollection.Properties.Appearance.Font")));
             this.UpperCollection.Properties.Appearance.Options.UseFont = true;
             this.UpperCollection.Properties.OffText = resources.GetString("UpperCollection.Properties.OffText");

+ 48 - 24
UAS_MES_JC/CustomControl/HeadBar/HeadBar.resx

@@ -130,13 +130,13 @@
     <value>NoControl</value>
   </data>
   <data name="TitleLabel.Location" type="System.Drawing.Point, System.Drawing">
-    <value>8, 6</value>
+    <value>16, 12</value>
   </data>
   <data name="TitleLabel.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
-    <value>2, 0, 2, 0</value>
+    <value>4, 0, 4, 0</value>
   </data>
   <data name="TitleLabel.Size" type="System.Drawing.Size, System.Drawing">
-    <value>0, 22</value>
+    <value>0, 42</value>
   </data>
   <data name="TitleLabel.TabIndex" type="System.Int32, mscorlib">
     <value>7</value>
@@ -160,10 +160,13 @@
     <value>NoControl</value>
   </data>
   <data name="MinWindow2.Location" type="System.Drawing.Point, System.Drawing">
-    <value>491, 0</value>
+    <value>978, 0</value>
+  </data>
+  <data name="MinWindow2.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
+    <value>6, 6, 6, 6</value>
   </data>
   <data name="MinWindow2.Size" type="System.Drawing.Size, System.Drawing">
-    <value>15, 28</value>
+    <value>30, 52</value>
   </data>
   <data name="MinWindow2.SizeMode" type="System.Windows.Forms.PictureBoxSizeMode, System.Windows.Forms">
     <value>StretchImage</value>
@@ -190,10 +193,13 @@
     <value>NoControl</value>
   </data>
   <data name="MinWindow.Location" type="System.Drawing.Point, System.Drawing">
-    <value>506, 0</value>
+    <value>1008, 0</value>
+  </data>
+  <data name="MinWindow.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
+    <value>6, 6, 6, 6</value>
   </data>
   <data name="MinWindow.Size" type="System.Drawing.Size, System.Drawing">
-    <value>30, 28</value>
+    <value>60, 52</value>
   </data>
   <data name="MinWindow.SizeMode" type="System.Windows.Forms.PictureBoxSizeMode, System.Windows.Forms">
     <value>StretchImage</value>
@@ -220,10 +226,13 @@
     <value>NoControl</value>
   </data>
   <data name="MinWindow1.Location" type="System.Drawing.Point, System.Drawing">
-    <value>536, 0</value>
+    <value>1068, 0</value>
+  </data>
+  <data name="MinWindow1.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
+    <value>6, 6, 6, 6</value>
   </data>
   <data name="MinWindow1.Size" type="System.Drawing.Size, System.Drawing">
-    <value>15, 28</value>
+    <value>30, 52</value>
   </data>
   <data name="MinWindow1.SizeMode" type="System.Windows.Forms.PictureBoxSizeMode, System.Windows.Forms">
     <value>StretchImage</value>
@@ -250,10 +259,13 @@
     <value>NoControl</value>
   </data>
   <data name="CloseWindow.Location" type="System.Drawing.Point, System.Drawing">
-    <value>551, 0</value>
+    <value>1098, 0</value>
+  </data>
+  <data name="CloseWindow.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
+    <value>6, 6, 6, 6</value>
   </data>
   <data name="CloseWindow.Size" type="System.Drawing.Size, System.Drawing">
-    <value>30, 28</value>
+    <value>60, 52</value>
   </data>
   <data name="CloseWindow.SizeMode" type="System.Windows.Forms.PictureBoxSizeMode, System.Windows.Forms">
     <value>StretchImage</value>
@@ -273,6 +285,9 @@
   <data name="&gt;&gt;CloseWindow.ZOrder" xml:space="preserve">
     <value>7</value>
   </data>
+  <metadata name="LoginOut.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </metadata>
   <data name="LoginOut.Appearance.Font" type="System.Drawing.Font, System.Drawing">
     <value>微软雅黑, 12pt</value>
   </data>
@@ -283,13 +298,13 @@
     <value>NoControl</value>
   </data>
   <data name="LoginOut.Location" type="System.Drawing.Point, System.Drawing">
-    <value>411, 0</value>
+    <value>818, 0</value>
   </data>
   <data name="LoginOut.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
-    <value>2, 2, 2, 2</value>
+    <value>4, 4, 4, 4</value>
   </data>
   <data name="LoginOut.Size" type="System.Drawing.Size, System.Drawing">
-    <value>80, 28</value>
+    <value>160, 52</value>
   </data>
   <data name="LoginOut.TabIndex" type="System.Int32, mscorlib">
     <value>9</value>
@@ -309,6 +324,9 @@
   <data name="&gt;&gt;LoginOut.ZOrder" xml:space="preserve">
     <value>2</value>
   </data>
+  <metadata name="Change_psw.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>199, 17</value>
+  </metadata>
   <data name="Change_psw.Appearance.Font" type="System.Drawing.Font, System.Drawing">
     <value>微软雅黑, 12pt</value>
   </data>
@@ -319,13 +337,13 @@
     <value>NoControl</value>
   </data>
   <data name="Change_psw.Location" type="System.Drawing.Point, System.Drawing">
-    <value>298, 0</value>
+    <value>592, 0</value>
   </data>
   <data name="Change_psw.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
-    <value>2, 2, 2, 2</value>
+    <value>4, 4, 4, 4</value>
   </data>
   <data name="Change_psw.Size" type="System.Drawing.Size, System.Drawing">
-    <value>113, 28</value>
+    <value>226, 52</value>
   </data>
   <data name="Change_psw.TabIndex" type="System.Int32, mscorlib">
     <value>11</value>
@@ -345,14 +363,17 @@
   <data name="&gt;&gt;Change_psw.ZOrder" xml:space="preserve">
     <value>1</value>
   </data>
+  <metadata name="UpperCollection.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>419, 17</value>
+  </metadata>
   <data name="UpperCollection.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
     <value>Right</value>
   </data>
-  <data name="UpperCollection.EditValue" type="System.Boolean, mscorlib">
-    <value>True</value>
-  </data>
   <data name="UpperCollection.Location" type="System.Drawing.Point, System.Drawing">
-    <value>166, 0</value>
+    <value>328, 0</value>
+  </data>
+  <data name="UpperCollection.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
+    <value>6, 6, 6, 6</value>
   </data>
   <data name="UpperCollection.Properties.Appearance.Font" type="System.Drawing.Font, System.Drawing">
     <value>微软雅黑, 9pt</value>
@@ -364,7 +385,7 @@
     <value>大写采集</value>
   </data>
   <data name="UpperCollection.Size" type="System.Drawing.Size, System.Drawing">
-    <value>132, 28</value>
+    <value>264, 52</value>
   </data>
   <assembly alias="DevExpress.Utils.v15.2" name="DevExpress.Utils.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
   <data name="UpperCollection.SuperTip" type="DevExpress.Utils.SuperToolTip, DevExpress.Utils.v15.2" mimetype="application/x-microsoft.net.object.bytearray.base64">
@@ -418,10 +439,13 @@
     <value>True</value>
   </metadata>
   <data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
-    <value>6, 12</value>
+    <value>12, 24</value>
+  </data>
+  <data name="$this.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
+    <value>6, 6, 6, 6</value>
   </data>
   <data name="$this.Size" type="System.Drawing.Size, System.Drawing">
-    <value>581, 28</value>
+    <value>1158, 52</value>
   </data>
   <data name="&gt;&gt;$this.Name" xml:space="preserve">
     <value>HeadBar</value>

+ 1 - 1
UAS_MES_JC/Entity/SystemInf.cs

@@ -72,7 +72,7 @@ namespace UAS_MES_NEW.Entity
         /// </summary>
         public static string CacheFilePath = Environment.GetEnvironmentVariable("windir").Substring(0, 1) + @":\UAS_MES\CacheFile\CacheInfo.xml";
 
-        public static bool UpperCollection = true;
+        public static bool UpperCollection = false;
 
         public static DataOperate.DataHelper dh;
 

+ 8 - 1
UAS_MES_JC/FunctionCode/Query/Query_SN.cs

@@ -139,14 +139,21 @@ namespace UAS_MES_NEW.Query
                 MessageBox.Show("工单号不存在");
                 return;
             }
-            DataTable dt = (DataTable)dh.ExecuteSql("select '机柜' pr_exbarcode,ma_qty from make left join product on ma_prodcode=pr_code where ma_code='" + ma_code.Text + "'", "select");
+            DataTable dt = (DataTable)dh.ExecuteSql("select '机柜' pr_exbarcode,pr_spec3_user,ma_qty from make left join product on ma_prodcode=pr_code where ma_code='" + ma_code.Text + "'", "select");
             string pr_exbarcode = "";
             string ma_qty = "";
+            string pr_spec3_user = "";
             if (dt.Rows.Count > 0)
             {
                 pr_exbarcode = dt.Rows[0]["pr_exbarcode"].ToString();
+                pr_spec3_user = dt.Rows[0]["pr_spec3_user"].ToString();
                 ma_qty = dt.Rows[0]["ma_qty"].ToString();
             }
+            if (pr_spec3_user == "")
+            {
+                MessageBox.Show("未维护产品资料信息");
+                return;
+            }
             if (dh.getRowCount("makesnlist", "msl_makecode='" + ma_code.Text + "'") + PrintNum.Value > int.Parse(ma_qty))
             {
                 MessageBox.Show("工单号" + ma_code.Text + "生产序列号超出工单数");

+ 15 - 4
UAS_MES_JC/PublicMethod/LogicHandler.cs

@@ -1168,15 +1168,26 @@ namespace UAS_MES_NEW.PublicMethod
                             return false;
                         }
                     }
+                    string pr_isvalid = dh.getFieldDataByCondition("product", "nvl(pr_isvalid,0)", "pr_code='" + iFSonCode + "'").ToString();
+                    //pr_isvalid
                     dt = (DataTable)dh.ExecuteSql("select ms_status from makeserial where ms_sncode='" + iSN + "'", "select");
                     if (dt.Rows.Count > 0)
                     {
                         if (dt.Rows[0]["ms_status"].ToString() != "2")
                         {
-                          /*  ErrMessage = "条码" + iSN + "未完成测试,不允许上料";
-                            return false;*/
+                            ErrMessage = "条码" + iSN + "未完成测试,不允许上料";
+                            return false;
+                        }
+                    }
+                    else
+                    {
+                        if (pr_isvalid == "-1")
+                        {
+                            ErrMessage = "条码" + iSN + "未完成测试,不允许上料";
+                            return false;
                         }
                     }
+
                     //若有多个,以|分割
                     string[] pres = iPrefix.Split('|');
                     bool f = false;
@@ -1193,7 +1204,7 @@ namespace UAS_MES_NEW.PublicMethod
                                 if (iSN.Length > index1)
                                 {
                                     //先截取长度
-                                    if (pres[i] == "" ? true : (iSN.Substring(index1 - 1).StartsWith(str)|| iSN.Substring(index1 - 1).EndsWith(str)))
+                                    if (pres[i] == "" ? true : (iSN.Substring(index1 - 1).StartsWith(str) || iSN.Substring(index1 - 1).EndsWith(str)))
                                     {
                                         //满足其中一条即可
                                         f = true;
@@ -1212,7 +1223,7 @@ namespace UAS_MES_NEW.PublicMethod
                                 return false;
                             }
                         }
-                        if (pres[i] == "" ? true : (iSN.StartsWith(pres[i])|| iSN.EndsWith(pres[i])))
+                        if (pres[i] == "" ? true : (iSN.StartsWith(pres[i]) || iSN.EndsWith(pres[i])))
                         {
                             //满足其中一条即可
                             f = true;

+ 49 - 30
UAS_MES_LGDZ/DataOperate/ExcelHandler.cs

@@ -14,6 +14,8 @@ using DevExpress.XtraPrinting.Native.LayoutAdjustment;
 using DevExpress.XtraExport.Implementation;
 using NPOI.HSSF.Record.CF;
 using UAS_MES_NEW.Entity;
+using DevExpress.Schedule;
+using System.Runtime.Remoting.Metadata.W3cXsd2001;
 
 namespace UAS_MES_NEW.DataOperate
 {
@@ -40,11 +42,11 @@ namespace UAS_MES_NEW.DataOperate
             return filePath;
         }
 
-        public string ExportExcel_LIANGAN(DataTable dt, string FolderPath)
+        public string ExportExcel_LIANGAN(DataTable dt, string FolderPath, string custname, string spec, string bomversion, string workdate, string softname, string filecode, string releasedate, string tableab, string ecn, string machinename, string mademan)
         {
             //创建一个内存流,用来接收转换成Excel的内容
             MemoryStream ms;
-            ms = DataTableToExcel_LIANGAN(dt, FolderPath);
+            ms = DataTableToExcel_LIANGAN(dt, FolderPath, custname, spec, bomversion, workdate, softname, filecode, releasedate, tableab, ecn, machinename, mademan);
             //以系统当前时间命名文件,FileMode.Create表示创建文件,FileAccess.Write表示拥有写的权限
             string filePath = FolderPath;
             FileStream fs = new FileStream(filePath, FileMode.Create, FileAccess.Write);
@@ -57,7 +59,7 @@ namespace UAS_MES_NEW.DataOperate
             return filePath;
         }
 
-        public MemoryStream DataTableToExcel_LIANGAN(DataTable DataTable, string FolderPath)
+        public MemoryStream DataTableToExcel_LIANGAN(DataTable DataTable, string FolderPath, string custname, string spec, string bomversion, string workdate, string softname, string filecode, string releasedate, string tableab, string ecn, string machinename, string mademan)
         {
             //创建内存流
             MemoryStream ms = new MemoryStream();
@@ -77,11 +79,13 @@ namespace UAS_MES_NEW.DataOperate
             //表格数据游标
             int DataRowCount = 8;
             string sumqty = "";
+            int endrow = 0;
             for (int i = 0; i < 10; i++)
             {
                 if (sumqty == "")
                     sumqty = DataTable.Rows[i]["sumqty"].ToString();
             }
+            List<int> id=new List<int>();
             for (int i = 0; i < DataTable.Rows.Count; i++)
             {
                 if (DataTable.Rows[i]["STF_MACHINE"].ToString() != "" && DataTable.Rows[i]["STF_MACHINE"].ToString() != "***" && i != DataTable.Rows.Count - 1)
@@ -120,11 +124,11 @@ namespace UAS_MES_NEW.DataOperate
                     sheet1.AddMergedRegion(cellRangeAddress3);
                     row2.CreateCell(0); row2.CreateCell(1); row2.Cells[0].SetCellValue("客户名称:");
                     row2.Cells[0].CellStyle = style; row2.Cells[1].CellStyle = style;
-                    row2.CreateCell(2); row2.CreateCell(3); row2.Cells[2].SetCellValue("CY"); row2.Cells[2].CellStyle = style;
+                    row2.CreateCell(2); row2.CreateCell(3); row2.Cells[2].SetCellValue(custname); row2.Cells[2].CellStyle = style;
                     row2.Cells[2].CellStyle = style; row2.Cells[3].CellStyle = style;
-                    row2.CreateCell(4); row2.CreateCell(5); row2.Cells[4].SetCellValue("文件编号://"); row2.Cells[4].CellStyle = style;
+                    row2.CreateCell(4); row2.CreateCell(5); row2.Cells[4].SetCellValue("文件编号:"+ filecode); row2.Cells[4].CellStyle = style;
                     row2.Cells[4].CellStyle = style; row2.Cells[5].CellStyle = style;
-                    row2.CreateCell(6); row2.CreateCell(7); row2.Cells[6].SetCellValue("发行日期:" + DateTime.Now.ToString("yyyy-MM-dd")); row2.Cells[6].CellStyle = style;
+                    row2.CreateCell(6); row2.CreateCell(7); row2.Cells[6].SetCellValue("发行日期:" + releasedate); row2.Cells[6].CellStyle = style;
                     row2.Cells[6].CellStyle = style; row2.Cells[7].CellStyle = style;
 
                     //产品型号
@@ -139,11 +143,11 @@ namespace UAS_MES_NEW.DataOperate
                     sheet1.AddMergedRegion(cellRangeAddress7);
                     row3.CreateCell(0); row3.CreateCell(1); row3.Cells[0].SetCellValue("产品型号:");
                     row3.Cells[0].CellStyle = style; row3.Cells[1].CellStyle = style;
-                    row3.CreateCell(2); row3.CreateCell(3); row3.Cells[2].SetCellValue("it9220-LS2404-B1-V2.0-MB");
+                    row3.CreateCell(2); row3.CreateCell(3); row3.Cells[2].SetCellValue(spec);
                     row3.Cells[2].CellStyle = style; row3.Cells[3].CellStyle = style;
-                    row3.CreateCell(4); row3.CreateCell(5); row3.Cells[4].SetCellValue("BOM编号:EN-CY-BOM-143(A0)");
+                    row3.CreateCell(4); row3.CreateCell(5); row3.Cells[4].SetCellValue("BOM编号:"+bomversion);
                     row3.Cells[4].CellStyle = style; row3.Cells[5].CellStyle = style;
-                    row3.CreateCell(6); row3.CreateCell(7); row3.Cells[6].SetCellValue("生效日期:" + DateTime.Now.ToString("yyyy-MM-dd"));
+                    row3.CreateCell(6); row3.CreateCell(7); row3.Cells[6].SetCellValue("生效日期:" + workdate);
                     row3.Cells[6].CellStyle = style; row3.Cells[7].CellStyle = style;
                     //程序名称
                     IRow row4 = sheet1.CreateRow(3);
@@ -153,43 +157,44 @@ namespace UAS_MES_NEW.DataOperate
                     sheet1.AddMergedRegion(cellRangeAddress8);
                     sheet1.AddMergedRegion(cellRangeAddress9);
                     sheet1.AddMergedRegion(cellRangeAddress10);
-                    row4.CreateCell(0); row4.CreateCell(1); row4.Cells[0].SetCellValue("程序名称\t\r\n");
+                    row4.CreateCell(0); row4.CreateCell(1); row4.Cells[0].SetCellValue("程序名称");
                     row4.Cells[0].CellStyle = style; row4.Cells[1].CellStyle = style;
-                    row4.CreateCell(2); row4.CreateCell(3); row4.Cells[2].SetCellValue(DataTable.Rows[i]["STF_CODE"].ToString() + "\t\r\n");
+                    row4.CreateCell(2); row4.CreateCell(3); row4.Cells[2].SetCellValue(machinename);
                     row4.Cells[2].CellStyle = style; row4.Cells[3].CellStyle = style;
-                    row4.CreateCell(4); row4.CreateCell(5); row4.Cells[4].SetCellValue("面别:    AB面\t\r\n");
+                    row4.CreateCell(4); row4.CreateCell(5); row4.Cells[4].SetCellValue("面别:    "+ tableab + "");
                     row4.Cells[4].CellStyle = style; row4.Cells[5].CellStyle = style;
+                    row4.CreateCell(6); row4.CreateCell(7); row4.Cells[6].SetCellValue("ECN记录:" + ecn);
+                    row4.Cells[6].CellStyle = style; row4.Cells[7].CellStyle = style;
                     //机器名称
                     IRow row5 = sheet1.CreateRow(4);
-                    CellRangeAddress cellRangeAddress14 = new CellRangeAddress(5, 5, 0, 1);
-                    CellRangeAddress cellRangeAddress15 = new CellRangeAddress(5, 5, 2, 3);
-                    CellRangeAddress cellRangeAddress16 = new CellRangeAddress(5, 5, 4, 5);
-                    CellRangeAddress cellRangeAddress20 = new CellRangeAddress(5, 6, 6, 7);
-                    sheet1.AddMergedRegion(cellRangeAddress20);
+                    CellRangeAddress cellRangeAddress14 = new CellRangeAddress(4, 4, 0, 1);
+                    CellRangeAddress cellRangeAddress15 = new CellRangeAddress(4, 4, 2, 3);
+                    CellRangeAddress cellRangeAddress16 = new CellRangeAddress(4, 4, 4, 5);
+                    CellRangeAddress cellRangeAddress20 = new CellRangeAddress(4, 5, 6, 7);
                     sheet1.AddMergedRegion(cellRangeAddress14);
                     sheet1.AddMergedRegion(cellRangeAddress15);
                     sheet1.AddMergedRegion(cellRangeAddress16);
                     sheet1.AddMergedRegion(cellRangeAddress20);
-                    row5.CreateCell(0); row5.CreateCell(1); row5.Cells[0].SetCellValue("机器名称\t\r\n");
+                    row5.CreateCell(0); row5.CreateCell(1); row5.Cells[0].SetCellValue("机器名称");
                     row5.Cells[0].CellStyle = style; row5.Cells[1].CellStyle = style;
-                    row5.CreateCell(2); row5.CreateCell(3); row5.Cells[2].SetCellValue("TX2I+TX2I+TX2I+TX2+SX1\t\r\n");
+                    row5.CreateCell(2); row5.CreateCell(3); row5.Cells[2].SetCellValue(machinename);
                     row5.Cells[2].CellStyle = style; row5.Cells[3].CellStyle = style;
-                    row5.CreateCell(4); row5.CreateCell(5); row5.Cells[4].SetCellValue("QA确认:\t\r\n");
+                    row5.CreateCell(4); row5.CreateCell(5); row5.Cells[4].SetCellValue("QA确认:");
                     row5.Cells[4].CellStyle = style; row5.Cells[5].CellStyle = style;
                     row5.CreateCell(6); row5.CreateCell(7); row5.Cells[6].SetCellValue("文控签章:");
                     row5.Cells[6].CellStyle = style; row5.Cells[7].CellStyle = style;
 
                     //制作
                     IRow row6 = sheet1.CreateRow(5);
-                    CellRangeAddress cellRangeAddress17 = new CellRangeAddress(6, 6, 0, 1);
-                    CellRangeAddress cellRangeAddress18 = new CellRangeAddress(6, 6, 2, 3);
-                    CellRangeAddress cellRangeAddress19 = new CellRangeAddress(6, 6, 4, 5);
+                    CellRangeAddress cellRangeAddress17 = new CellRangeAddress(5, 5, 0, 1);
+                    CellRangeAddress cellRangeAddress18 = new CellRangeAddress(5, 5, 2, 3);
+                    CellRangeAddress cellRangeAddress19 = new CellRangeAddress(5, 5, 4, 5);
                     sheet1.AddMergedRegion(cellRangeAddress17);
                     sheet1.AddMergedRegion(cellRangeAddress18);
                     sheet1.AddMergedRegion(cellRangeAddress19);
-                    row6.CreateCell(0); row6.CreateCell(1); row6.Cells[0].SetCellValue("制作:");
+                    row6.CreateCell(0); row6.CreateCell(1); row6.Cells[0].SetCellValue("制作:" );
                     row6.Cells[0].CellStyle = style; row6.Cells[1].CellStyle = style;
-                    row6.CreateCell(2); row6.CreateCell(3); row6.Cells[2].SetCellValue(User.CurrentStepName);
+                    row6.CreateCell(2); row6.CreateCell(3); row6.Cells[2].SetCellValue(mademan);
                     row6.Cells[2].CellStyle = style; row6.Cells[3].CellStyle = style;
                     row6.CreateCell(4); row6.CreateCell(5); row6.Cells[4].SetCellValue("QA审核:");
                     row6.Cells[4].CellStyle = style; row6.Cells[5].CellStyle = style;
@@ -251,16 +256,30 @@ namespace UAS_MES_NEW.DataOperate
                         row.CreateCell(5);
                         row.CreateCell(6);
                         row.CreateCell(7);
+                        Console.WriteLine(DataTable.Rows[i]["STF_MODEL"].ToString() + " " + DataTable.Rows[i]["STF_FEEDER"].ToString() + " " + DataTable.Rows[i]["STF_FEEDERNO"].ToString());
+                        for (int k = i+1; k < DataTable.Rows.Count; k++)
+                        {
+                            if (k < DataTable.Rows.Count && DataTable.Rows[k]["STF_MODEL"].ToString() == "" &&
+                            DataTable.Rows[k]["STF_FEEDER"].ToString() == "" &&
+                            DataTable.Rows[k]["STF_FEEDERNO"].ToString() != "" && !id.Contains(k))
+                            {
+                                endrow++;
+                                id.Add(k);
+                            }
+                            else
+                            {
+                                break;
+                            }
+                        }
                         //位置编号
-                        if (i + 1 < DataTable.Rows.Count && DataTable.Rows[i + 1]["STF_MODEL"].ToString() == "" &&
-                            DataTable.Rows[i + 1]["STF_FEEDER"].ToString() == "" &&
-                            DataTable.Rows[i + 1]["STF_FEEDERNO"].ToString() != "")
+                        if (i + endrow < DataTable.Rows.Count && DataTable.Rows[i]["STF_MODEL"].ToString() != "")
                         {
-                            CellRangeAddress cellRangeAddress = new CellRangeAddress(DataRowCount, DataRowCount + 1, 0, 0);
+                            CellRangeAddress cellRangeAddress = new CellRangeAddress(DataRowCount, DataRowCount + endrow, 0, 0);
                             sheet.AddMergedRegion(cellRangeAddress);
                             //飞达规格
-                            CellRangeAddress cellRangeAddress1 = new CellRangeAddress(DataRowCount, DataRowCount + 1, 1, 1);
+                            CellRangeAddress cellRangeAddress1 = new CellRangeAddress(DataRowCount, DataRowCount + endrow, 1, 1);
                             sheet.AddMergedRegion(cellRangeAddress1);
+                            endrow = 0;
                         }
                         row.Cells[0].SetCellValue(DataTable.Rows[i]["STF_MODEL"].ToString());
                         row.Cells[0].CellStyle = style;

+ 66 - 66
UAS_MES_LGDZ/FunctionCode/Make/Make_ColorBoxLabelPrint_WN.cs

@@ -20,12 +20,12 @@ namespace UAS_MES_NEW.Make
         DataTable dt;
         LogStringBuilder sql = new LogStringBuilder();
         AutoSizeFormClass asc = new AutoSizeFormClass();
-        //保存StepProduct查询出来的数据
+        // Save StepProduct query data
         DataTable ListA = new DataTable();
-        //制造单号
+        // Manufacturing order number
         string macode;
-        //当前提示的索引
-        //保存TSN编号
+        // Current prompt index
+        // Save TSN number
         string ms_id = null;
 
         string PR_CHECKCARTONW = "0";
@@ -49,20 +49,20 @@ namespace UAS_MES_NEW.Make
             sncode.Focus();
             asc.controllInitializeSize(this);
             InitPrint = new Thread(InPrint);
-            SetLoadingWindow stw = new SetLoadingWindow(InitPrint, "初始化打印程序");
+            SetLoadingWindow stw = new SetLoadingWindow(InitPrint, "Initializing print program");
             BaseUtil.SetFormCenter(stw);
             stw.ShowDialog();
-            //设置锁定工单
+            // Set locked work order
             LockMakeCode.GetMakeCodeCtl(ma_code);
             ma_code.SetLockCheckBox(LockMakeCode);
-            //工单号放大镜配置
+            // Work order number magnifier configuration
             ma_code.TableName = "make left join product on ma_prodcode=pr_code";
-            ma_code.SelectField = "ma_code # 工单号,pr_code # 产品编号,pr_detail # 产品名称";
+            ma_code.SelectField = "ma_code # Work Order,pr_code # Product Code,pr_detail # Product Name";
             ma_code.FormName = Name;
             ma_code.SetValueField = new string[] { "ma_code", "pr_code", "pr_detail" };
             ma_code.Condition = "ma_statuscode='STARTED'";
             ma_code.DbChange += Ma_code_DbChange;
-            OperateResult.AppendText(">>请输入TSN\n", Color.Black);
+            OperateResult.AppendText(">>Please enter TSN\n", Color.Black);
             dh = SystemInf.dh;
             StepCount.StepCode = User.CurrentStepCode;
             StepCount.Source = User.UserSourceCode;
@@ -75,7 +75,7 @@ namespace UAS_MES_NEW.Make
         {
             Dbfind = ma_code.ReturnData;
             BaseUtil.SetFormValue(this.Controls, Dbfind);
-            //获取工单的其他信息
+            // Get other information of the work order
             sql.Clear();
             sql.Append("select ma_code,nvl(mcd_okqty,0) mcd_okqty,ma_prodcode as pr_code ,pr_detail,");
             sql.Append("pr_spec,ma_qty - nvl(mcd_inqty, 0) mcd_remainqty from make left join makecraftdetail on ");
@@ -95,7 +95,7 @@ namespace UAS_MES_NEW.Make
             }
             catch (Exception)
             {
-                OperateResult.AppendText("未正确安装BarTender软件\n", Color.Red);
+                OperateResult.AppendText("BarTender software is not installed correctly\n", Color.Red);
             }
         }
 
@@ -107,8 +107,8 @@ namespace UAS_MES_NEW.Make
                 {
                     if (sncode.Text == "")
                     {
-                        OperateResult.AppendText(">>TSN不能为空\n", Color.Red);
-                        OperateResult.AppendText(">>请输入TSN\n", Color.Black);
+                        OperateResult.AppendText(">>TSN cannot be empty\n", Color.Red);
+                        OperateResult.AppendText(">>Please enter TSN\n", Color.Black);
                         return;
                     }
                     OperateResult.AppendText(">>" + sncode.Text + "\n", Color.Black);
@@ -119,19 +119,19 @@ namespace UAS_MES_NEW.Make
                     {
                         ms_id = dt.Rows[0][0].ToString();
                         sncode.Focus();
-                        OperateResult.AppendText(">>请输入SN\n", Color.Black, sncode);
+                        OperateResult.AppendText(">>Please enter SN\n", Color.Black, sncode);
                         return;
                     }
                     else
                     {
-                        OperateResult.AppendText(">>TSN" + sncode.Text + "错误,不存在\n", Color.Red, sncode);
-                        OperateResult.AppendText(">>请输入TSN\n", Color.Black);
+                        OperateResult.AppendText(">>TSN" + sncode.Text + "is incorrect, does not exist\n", Color.Red, sncode);
+                        OperateResult.AppendText(">>Please enter TSN\n", Color.Black);
                         return;
                     }
                 }
                 if (sncode.Text == "")
                 {
-                    OperateResult.AppendText(">>序列号不能为空\n", Color.Red);
+                    OperateResult.AppendText(">>Serial number cannot be empty\n", Color.Red);
                     return;
                 }
                 OperateResult.AppendText(">>" + sncode.Text + "\n", Color.Black);
@@ -142,12 +142,12 @@ namespace UAS_MES_NEW.Make
                     dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                     if (dt.Rows.Count > 0)
                     {
-                        OperateResult.AppendText(">>TSN和SN一致\n", Color.Green);
+                        OperateResult.AppendText(">>TSN and SN match\n", Color.Green);
                     }
                     else
                     {
-                        OperateResult.AppendText(">>TSN和SN不一致\n", Color.Red, sncode);
-                        OperateResult.AppendText(">>请输入TSN\n", Color.Black);
+                        OperateResult.AppendText(">>TSN and SN do not match\n", Color.Red, sncode);
+                        OperateResult.AppendText(">>Please enter TSN\n", Color.Black);
                         ms_id = null;
                         return;
                     }
@@ -157,8 +157,8 @@ namespace UAS_MES_NEW.Make
                 string oMakeCode;
                 if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out ErrorMessage))
                 {
-                    //判断界面工单是否为空时的序列号是否自动归属工单
-                    // 获取工单归属工单下一工序是否正确
+                    // Check if the serial number automatically belongs to the work order when the work order is empty
+                    // Check if the next process of the work order is correct
                     string status = "";
                     dt = (DataTable)dh.ExecuteSql("select ms_sncode from makeserial where ms_code='" + sncode.Text + "' or ms_imei1='" + sncode.Text + "' order by ms_id desc", "select");
                     if (dt.Rows.Count > 0)
@@ -196,15 +196,15 @@ namespace UAS_MES_NEW.Make
                         if (nextstepcode != User.CurrentStepCode)
                         {
                             string stname = dh.getFieldDataByCondition("step", "st_name", "st_code='" + nextstepcode + "'").ToString();
-                            OperateResult.AppendText("<<序列号:" + sncode.Text + "下一工序是" + stname + ",不是当前岗位的工序\n", Color.Red, sncode);
+                            OperateResult.AppendText("<<Serial number:" + sncode.Text + "next process is" + stname + ", not the current process\n", Color.Red, sncode);
                             return;
                         }
                         if (locksalecode.Checked && ma_code.Text != "" && ma_code.Text != oMakeCode)
                         {
-                            OperateResult.AppendText(">>序列号" + sncode.Text + "所属工单号" + oMakeCode + "与界面工单号" + ma_code.Text + "不同,无法采集\n", Color.Red, sncode);
+                            OperateResult.AppendText(">>Serial number" + sncode.Text + "belongs to work order" + oMakeCode + "which is different from the interface work order" + ma_code.Text + ", cannot collect\n", Color.Red, sncode);
                             return;
                         }
-                        //获取工单的其他信息
+                        // Get other information of the work order
                         sql.Clear();
                         sql.Append("select ma_code,nvl(ma_unlimitin,0)ma_unlimitin,pr_code,pr_detail,pr_spec from  ");
                         sql.Append("make left join product on pr_code=ma_prodcode where ma_code='" + oMakeCode + "'");
@@ -214,21 +214,21 @@ namespace UAS_MES_NEW.Make
                             PR_CHECKCARTONW = dh.getFieldDataByCondition("craftdetail left join craft on cr_id=cd_crid left join makeserial on ms_craftcode =cr_code and cr_prodcode = ms_prodcode", "nvl(cd_ifweigh,'0') cd_ifweigh", "ms_sncode='" + sncode.Text + "' and ms_makecode='" + oMakeCode + "' and cd_stepcode = '" + User.CurrentStepCode + "'").ToString();
                             if (PR_CHECKCARTONW != "0")
                             {
-                                OperateResult.AppendText(">>彩盒" + sncode.Text + "当前处于称重工序,无法在此界面采集,需去彩盒称重界面进行采集\n", Color.Black, sncode);
+                                OperateResult.AppendText(">>Color box" + sncode.Text + "is currently in the weighing process, cannot be collected in this interface, please go to the color box weighing interface for collection\n", Color.Black, sncode);
                                 return;
                             }
                             BaseUtil.SetFormValue(this.Controls, dt);
                             LockMakeCode.Checked = true;
-                            //提示用户“<<工单号:取ma_makecode”
-                            OperateResult.AppendText("<<工单号:" + ma_code.Text + "\n", Color.Black);
-                            //提示用户“<< 序列号:XXXX”
-                            OperateResult.AppendText("<<序列号:" + sncode.Text + "\n", Color.Black);
+                            // Prompt user "<<Work order: take ma_makecode"
+                            OperateResult.AppendText("<<Work order:" + ma_code.Text + "\n", Color.Black);
+                            // Prompt user "<< Serial number: XXXX"
+                            OperateResult.AppendText("<<Serial number:" + sncode.Text + "\n", Color.Black);
                             if (pr_change)
                             {
-                                String dialog = MessageBox.Show("是否使用当前标签模板", "提示", MessageBoxButtons.OKCancel).ToString();
+                                String dialog = MessageBox.Show("Do you want to use the current label template?", "Prompt", MessageBoxButtons.OKCancel).ToString();
                                 if (dialog != "OK")
                                 {
-                                    OperateResult.AppendText(">>请重新选择标签模板\n", Color.Green);
+                                    OperateResult.AppendText(">>Please reselect the label template\n", Color.Green);
                                     return;
                                 }
                                 else pr_change = false;
@@ -236,42 +236,42 @@ namespace UAS_MES_NEW.Make
                         }
                         else
                         {
-                            OperateResult.AppendText(">>无序列号" + sncode.Text + "对应工单信息\n", Color.Red, sncode);
+                            OperateResult.AppendText(">>No serial number" + sncode.Text + "corresponding work order information\n", Color.Red, sncode);
                             sncode.Focus();
                             return;
                         }
                         //if (int.Parse(mcd_remainqty.Text) <= 0 && dt.Rows[0]["ma_unlimitin"].ToString() == "0")
                         //{
                         //    macode = ma_code.Text;
-                        //    ErrorMessage = "工单" + macode + "打印结束\n>请输入SN";
+                        //    ErrorMessage = "Work order" + macode + "print completed\n>Please enter SN";
                         //    OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Green);
                         //    sncode.Focus();
                         //}
                         //else
                         //{
-                        //所选标签不为空
+                        // Selected label is not empty
                         if (PrintLabel.SelectedValue != null)
                         {
-                            //如果打印张数为空,返回
+                            // If the number of prints is empty, return
                             if (PrintNum.Text == "" || int.Parse(PrintNum.Text) == 0)
                             {
-                                OperateResult.AppendText(">>打印张数不可空或者为0\n", Color.Red, sncode);
-                                //清空输入框的值,聚焦
+                                OperateResult.AppendText(">>Number of prints cannot be empty or 0\n", Color.Red, sncode);
+                                // Clear the input box value, focus
                                 sncode.Focus();
-                                //提示用户“>>请输入SN”
-                                OperateResult.AppendText(">>请输入SN\n", Color.Black);
+                                // Prompt user ">>Please enter SN"
+                                OperateResult.AppendText(">>Please enter SN\n", Color.Black);
                                 return;
                             }
-                            //更新至下一步工序
-                            if (LogicHandler.SetStepResult(oMakeCode, User.UserSourceCode, sncode.Text, "彩盒打印", "彩盒打印成功", User.UserCode, out ErrorMessage))
+                            // Update to the next process
+                            if (LogicHandler.SetStepResult(oMakeCode, User.UserSourceCode, sncode.Text, "Color box print", "Color box print successful", User.UserCode, out ErrorMessage))
                             {
-                                //提示正确返回时传递的信息
+                                // Prompt correct return information
                                 if (ErrorMessage.Contains("AFTERSUCCESS"))
                                     OperateResult.AppendText(">>" + ErrorMessage + "\n");
-                                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.BarTender(Tag.ToString(), ref engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, sncode.Text, int.Parse(PrintNum.Text), oMakeCode, pr_code.Text, "Color box label", "0", out ErrorMessage))
                                 {
-                                    //提示用户打印成功
-                                    OperateResult.AppendText(">>序列号:" + sncode.Text + "打印结束\n", Color.Green);
+                                    // Prompt user print successful
+                                    OperateResult.AppendText(">>Serial number:" + sncode.Text + "print completed\n", Color.Green);
                                 }
                                 else
                                 {
@@ -279,9 +279,9 @@ namespace UAS_MES_NEW.Make
                                 }
                                 if (PrintSecond.Checked)
                                 {
-                                    if (Print.BarTender(Tag.ToString(), ref engine, PrintLabel1.Text, PrintLabel1.SelectedValue.ToString(), PrintList1.Text, sncode.Text, int.Parse(PrintNum1.Text), oMakeCode, pr_code.Text, "彩盒标", "0", out ErrorMessage))
+                                    if (Print.BarTender(Tag.ToString(), ref engine, PrintLabel1.Text, PrintLabel1.SelectedValue.ToString(), PrintList1.Text, sncode.Text, int.Parse(PrintNum1.Text), oMakeCode, pr_code.Text, "Color box label", "0", out ErrorMessage))
                                     {
-                                        OperateResult.AppendText(">>序列号:" + sncode.Text + "打印结束\n", Color.Green);
+                                        OperateResult.AppendText(">>Serial number:" + sncode.Text + "print completed\n", Color.Green);
                                     }
                                     else
                                     {
@@ -292,8 +292,8 @@ namespace UAS_MES_NEW.Make
                                 {
                                     LogicHandler.CollectRemarkInf(sncode.Text, "", "", oMakeCode, pr_code.Text, Remark.Text);
                                 }
-                                LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "彩盒打印", "彩盒打印成功", sncode.Text, "");
-                                //刷新打印数量和剩余数量
+                                LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "Color box print", "Color box print successful", sncode.Text, "");
+                                // Refresh print quantity and remaining quantity
                                 dt = (DataTable)dh.ExecuteSql("select ma_qty - nvl(mcd_inqty, 0) mcd_remainqty,mcd_okqty from make left join makecraftdetail on mcd_macode=ma_code where ma_code='" + ma_code.Text + "' and mcd_stepcode='" + User.CurrentStepCode + "'", "select");
                                 BaseUtil.SetFormValue(Controls, dt);
                                 sncode.Text = "";
@@ -309,16 +309,16 @@ namespace UAS_MES_NEW.Make
                         }
                         else
                         {
-                            OperateResult.AppendText(">>产品编号:" + pr_code.Text + "未维护彩盒标签\n", Color.Red, sncode);
+                            OperateResult.AppendText(">>Product code:" + pr_code.Text + "has no color box label maintained\n", Color.Red, sncode);
                             return;
                         }
                         if (CheckTSN.Checked == true)
                         {
-                            OperateResult.AppendText(">>请输入TSN\n", Color.Black);
+                            OperateResult.AppendText(">>Please enter TSN\n", Color.Black);
                             ms_id = null;
                         }
                         else
-                            OperateResult.AppendText(">>请输入SN\n", Color.Black);
+                            OperateResult.AppendText(">>Please enter SN\n", Color.Black);
                         //}
                     }
                     else
@@ -326,11 +326,11 @@ namespace UAS_MES_NEW.Make
                         OperateResult.AppendText(ErrorMessage + "\n", Color.Red, sncode);
                         if (CheckTSN.Checked == true)
                         {
-                            OperateResult.AppendText(">>请输入TSN\n", Color.Black);
+                            OperateResult.AppendText(">>Please enter TSN\n", Color.Black);
                             ms_id = null;
                         }
                         else
-                            OperateResult.AppendText(">>请输入SN\n", Color.Black);
+                            OperateResult.AppendText(">>Please enter SN\n", Color.Black);
                     }
                 }
                 else
@@ -338,27 +338,27 @@ namespace UAS_MES_NEW.Make
                     OperateResult.AppendText(ErrorMessage + "\n", Color.Red, sncode);
                     if (CheckTSN.Checked == true)
                     {
-                        OperateResult.AppendText(">>请输入TSN\n", Color.Black);
+                        OperateResult.AppendText(">>Please enter TSN\n", Color.Black);
                         ms_id = null;
                     }
                     else
-                        OperateResult.AppendText(">>请输入SN\n", Color.Black);
+                        OperateResult.AppendText(">>Please enter SN\n", Color.Black);
                 }
             }
         }
         DataTable _dt;
-        //根据产品编号获取打印模板
+        // Get print template based on product code
         private void pr_code_TextChanged(object sender, EventArgs e)
         {
-            _dt = (DataTable)dh.ExecuteSql("select la_id,la_url,la_isdefault,replace(LA_SOFTTYPE,';',',')LA_SOFTTYPE from label where la_prodcode='" + pr_code.Text + "' and la_templatetype='彩盒标' and la_statuscode='AUDITED' order by la_isdefault", "select");
+            _dt = (DataTable)dh.ExecuteSql("select la_id,la_url,la_isdefault,replace(LA_SOFTTYPE,';',',')LA_SOFTTYPE from label where la_prodcode='" + pr_code.Text + "' and la_templatetype='Color box label' and la_statuscode='AUDITED' order by la_isdefault", "select");
             if (_dt.Rows.Count == 0)
             {
-                _dt = (DataTable)dh.ExecuteSql("select la_id,la_url,la_isdefault,replace(LA_SOFTTYPE,';',',')LA_SOFTTYPE from label where la_prodcode is null and la_templatetype='彩盒标' and la_statuscode='AUDITED' order by la_isdefault", "select");
+                _dt = (DataTable)dh.ExecuteSql("select la_id,la_url,la_isdefault,replace(LA_SOFTTYPE,';',',')LA_SOFTTYPE from label where la_prodcode is null and la_templatetype='Color box label' and la_statuscode='AUDITED' order by la_isdefault", "select");
             }
             if (_dt.Rows.Count > 0)
             {
                 string la_id = _dt.Rows[0]["la_id"].ToString();
-                _dt = (DataTable)dh.ExecuteSql("select fp_name la_url,'" + la_id + "' la_id from FILEPATH where fp_id in (select *  from table(select parsestring(LA_SOFTTYPE,';') from label where la_templatetype='彩盒标' and la_id='" + la_id + "') where COLUMN_VALUE is not null)", "select");
+                _dt = (DataTable)dh.ExecuteSql("select fp_name la_url,'" + la_id + "' la_id from FILEPATH where fp_id in (select *  from table(select parsestring(LA_SOFTTYPE,';') from label where la_templatetype='Color box label' and la_id='" + la_id + "') where COLUMN_VALUE is not null)", "select");
                 PrintLabel.DataSource = _dt;
                 PrintLabel.DisplayMember = "la_url";
                 PrintLabel.ValueMember = "la_id";
@@ -390,7 +390,7 @@ namespace UAS_MES_NEW.Make
         {
             if (ma_code.Text.Length > 4)
             {
-                //获取工单的其他信息
+                // Get other information of the work order
                 sql.Clear();
                 sql.Append("select ma_code,nvl(mcd_okqty,0) mcd_okqty,ma_prodcode as pr_code ,pr_detail,");
                 sql.Append("pr_spec,ma_qty - nvl(mcd_inqty, 0) mcd_remainqty from make left join makecraftdetail on ");
@@ -412,15 +412,15 @@ namespace UAS_MES_NEW.Make
             if (CheckTSN.Checked == true)
             {
                 ms_id = null;
-                OperateResult.AppendText(">>切换至检查TSN\n", Color.Green);
-                OperateResult.AppendText(">>请输入TSN\n", Color.Black, sncode);
+                OperateResult.AppendText(">>Switched to check TSN\n", Color.Green);
+                OperateResult.AppendText(">>Please enter TSN\n", Color.Black, sncode);
                 sncode.Focus();
             }
             else
             {
                 ms_id = null;
-                OperateResult.AppendText(">>切换至不检查TSN\n", Color.Green);
-                OperateResult.AppendText(">>请输入SN\n", Color.Black, sncode);
+                OperateResult.AppendText(">>Switched to not check TSN\n", Color.Green);
+                OperateResult.AppendText(">>Please enter SN\n", Color.Black, sncode);
                 sncode.Focus();
             }
         }

+ 3 - 3
UAS_MES_LGDZ/FunctionCode/Make/Make_FeedingCollection.cs

@@ -239,7 +239,7 @@ namespace UAS_MES_NEW.Make
                                 //刷新界面值
                                 sql.Clear();
                                 sql.Append("select mcd_inqty,ma_qty-mcd_inqty mcd_remainqty ");
-                                sql.Append("from make left join makecraftdetail_view on mcd_macode=ma_code where ");
+                                sql.Append("from make left join makecraftdetail on mcd_macode=ma_code where ");
                                 sql.Append("ma_code='" + oMakeCode + "' and mcd_stepcode='" + User.CurrentStepCode + "'");
                                 dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                                 BaseUtil.SetFormValue(Controls, dt);
@@ -387,7 +387,7 @@ namespace UAS_MES_NEW.Make
                         sql.Clear();
                         sql.Append("select ma_code,ma_softversion,ma_ecncode,ma_prodcode,pr_spec,ma_qty from makeserial left join product ");
                         sql.Append(" on ms_prodcode=pr_code left join make on ms_makecode=ma_code left join ");
-                        sql.Append("makecraftdetail_view on mcd_macode=ms_makecode where ms_id='" + oMsid + "' and mcd_stepcode='" + User.CurrentStepCode + "'");
+                        sql.Append("makecraftdetail on mcd_macode=ms_makecode where ms_id='" + oMsid + "' and mcd_stepcode='" + User.CurrentStepCode + "'");
                         dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                         BaseUtil.SetFormValue(this.Controls, dt);
                         OperateResult.AppendText(">>获取序列号" + code.Text + "成功\n", Color.Green);
@@ -574,7 +574,7 @@ namespace UAS_MES_NEW.Make
                     mcd_remainqty.Text = "";
                     sql.Clear();
                     sql.Append("select mcd_inqty,ma_qty-mcd_inqty mcd_remainqty ");
-                    sql.Append("from make left join makecraftdetail_view on mcd_macode=ma_code where ");
+                    sql.Append("from make left join makecraftdetail on mcd_macode=ma_code where ");
                     sql.Append("ma_code='" + ma_code.Text + "' and mcd_stepcode='" + User.CurrentStepCode + "'");
                     DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                     if (dt.Rows.Count > 0)

+ 0 - 5
UAS_MES_LGDZ/FunctionCode/Query/Query_BarcodeIn1.cs

@@ -148,11 +148,6 @@ namespace UAS_MES_NEW.Query
                 dh.ExecuteSql("insert into barcodeio(bi_id,bi_piid,bi_barcode,bi_inoutno,bi_prodcode,bi_indate,bi_inqty,bi_vendbarcode,bi_madedate,bi_sourcecode,bi_printstatus)" +
                     "values(barcodeio_seq.nextval,'" + pi_id + "','" + barcode.Text + "','" + pi_inoutno.Text + "','" + bar_prodcode + "',sysdate,'" + bar_remain + "','" + bar_vendbarcode + "',to_date('" + bar_madedate + "','yyyy-mm-dd'),'" + bar_code + "',1)", "insert");
                 LoadGridData();
-                string ErrorMessage = "";
-                //if (Print.BarTender(Tag.ToString(), ref engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrinterList.Text, newbarcode, int.Parse("1"), pi_inoutno.Text, bar_prodcode, "自定义", "0", out ErrorMessage))
-                //{
-
-                //}
             }
         }
 

+ 347 - 11
UAS_MES_LGDZ/FunctionCode/Query/Query_SpecialReport.Designer.cs

@@ -43,6 +43,28 @@
             this.XY = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
             this.XYFilePath = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.dataGridView1 = new System.Windows.Forms.DataGridView();
+            this.label3 = new System.Windows.Forms.Label();
+            this.label4 = new System.Windows.Forms.Label();
+            this.label7 = new System.Windows.Forms.Label();
+            this.label8 = new System.Windows.Forms.Label();
+            this.label9 = new System.Windows.Forms.Label();
+            this.label10 = new System.Windows.Forms.Label();
+            this.label11 = new System.Windows.Forms.Label();
+            this.label12 = new System.Windows.Forms.Label();
+            this.label13 = new System.Windows.Forms.Label();
+            this.label14 = new System.Windows.Forms.Label();
+            this.label15 = new System.Windows.Forms.Label();
+            this.custname = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.spec = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.softname = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.machinename = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.mademan = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.tableab = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.bomversion = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.filecode = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.ecn = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.releasedate = new System.Windows.Forms.DateTimePicker();
+            this.workdate = new System.Windows.Forms.DateTimePicker();
             ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
             this.SuspendLayout();
             // 
@@ -50,7 +72,7 @@
             // 
             this.label5.AutoSize = true;
             this.label5.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label5.Location = new System.Drawing.Point(212, 143);
+            this.label5.Location = new System.Drawing.Point(47, 439);
             this.label5.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label5.Name = "label5";
             this.label5.Size = new System.Drawing.Size(210, 41);
@@ -65,7 +87,7 @@
             // 
             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(212, 74);
+            this.label1.Location = new System.Drawing.Point(47, 370);
             this.label1.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label1.Name = "label1";
             this.label1.Size = new System.Drawing.Size(146, 41);
@@ -86,7 +108,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(891, 149);
+            this.label2.Location = new System.Drawing.Point(726, 445);
             this.label2.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label2.Name = "label2";
             this.label2.Size = new System.Drawing.Size(82, 41);
@@ -97,7 +119,7 @@
             // 
             this.label6.AutoSize = true;
             this.label6.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label6.Location = new System.Drawing.Point(180, 336);
+            this.label6.Location = new System.Drawing.Point(15, 632);
             this.label6.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label6.Name = "label6";
             this.label6.Size = new System.Drawing.Size(242, 41);
@@ -109,7 +131,7 @@
             this.TraceFilePath.AllPower = null;
             this.TraceFilePath.BackColor = System.Drawing.Color.White;
             this.TraceFilePath.ID = null;
-            this.TraceFilePath.Location = new System.Drawing.Point(434, 342);
+            this.TraceFilePath.Location = new System.Drawing.Point(269, 638);
             this.TraceFilePath.Margin = new System.Windows.Forms.Padding(6);
             this.TraceFilePath.Name = "TraceFilePath";
             this.TraceFilePath.Power = null;
@@ -126,7 +148,7 @@
             this.TraceFile.DownImage = ((System.Drawing.Image)(resources.GetObject("TraceFile.DownImage")));
             this.TraceFile.Image = null;
             this.TraceFile.IsShowBorder = true;
-            this.TraceFile.Location = new System.Drawing.Point(434, 403);
+            this.TraceFile.Location = new System.Drawing.Point(269, 699);
             this.TraceFile.Margin = new System.Windows.Forms.Padding(6);
             this.TraceFile.MoveImage = ((System.Drawing.Image)(resources.GetObject("TraceFile.MoveImage")));
             this.TraceFile.Name = "TraceFile";
@@ -146,7 +168,7 @@
             this.pr_code.DBTitle = "选择物料";
             this.pr_code.Font = new System.Drawing.Font("微软雅黑", 9F);
             this.pr_code.FormName = null;
-            this.pr_code.Location = new System.Drawing.Point(434, 74);
+            this.pr_code.Location = new System.Drawing.Point(269, 370);
             this.pr_code.Margin = new System.Windows.Forms.Padding(5);
             this.pr_code.Name = "pr_code";
             this.pr_code.Power = "ifspecial";
@@ -166,7 +188,7 @@
             this.XY.DownImage = ((System.Drawing.Image)(resources.GetObject("XY.DownImage")));
             this.XY.Image = null;
             this.XY.IsShowBorder = true;
-            this.XY.Location = new System.Drawing.Point(434, 223);
+            this.XY.Location = new System.Drawing.Point(269, 519);
             this.XY.Margin = new System.Windows.Forms.Padding(6);
             this.XY.MoveImage = ((System.Drawing.Image)(resources.GetObject("XY.MoveImage")));
             this.XY.Name = "XY";
@@ -183,7 +205,7 @@
             this.XYFilePath.AllPower = null;
             this.XYFilePath.BackColor = System.Drawing.Color.White;
             this.XYFilePath.ID = null;
-            this.XYFilePath.Location = new System.Drawing.Point(434, 149);
+            this.XYFilePath.Location = new System.Drawing.Point(269, 445);
             this.XYFilePath.Margin = new System.Windows.Forms.Padding(6);
             this.XYFilePath.Name = "XYFilePath";
             this.XYFilePath.Power = null;
@@ -197,18 +219,310 @@
             // dataGridView1
             // 
             this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
-            this.dataGridView1.Location = new System.Drawing.Point(41, 482);
+            this.dataGridView1.Location = new System.Drawing.Point(41, 1007);
             this.dataGridView1.Name = "dataGridView1";
             this.dataGridView1.RowHeadersWidth = 82;
             this.dataGridView1.RowTemplate.Height = 37;
-            this.dataGridView1.Size = new System.Drawing.Size(1416, 535);
+            this.dataGridView1.Size = new System.Drawing.Size(1416, 10);
             this.dataGridView1.TabIndex = 246;
             // 
+            // label3
+            // 
+            this.label3.AutoSize = true;
+            this.label3.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label3.Location = new System.Drawing.Point(49, 20);
+            this.label3.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(146, 41);
+            this.label3.TabIndex = 247;
+            this.label3.Text = "客户名称";
+            // 
+            // label4
+            // 
+            this.label4.AutoSize = true;
+            this.label4.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label4.Location = new System.Drawing.Point(951, 190);
+            this.label4.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label4.Name = "label4";
+            this.label4.Size = new System.Drawing.Size(147, 41);
+            this.label4.TabIndex = 248;
+            this.label4.Text = "ECN记录";
+            // 
+            // label7
+            // 
+            this.label7.AutoSize = true;
+            this.label7.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label7.Location = new System.Drawing.Point(530, 176);
+            this.label7.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label7.Name = "label7";
+            this.label7.Size = new System.Drawing.Size(82, 41);
+            this.label7.TabIndex = 249;
+            this.label7.Text = "面别";
+            // 
+            // label8
+            // 
+            this.label8.AutoSize = true;
+            this.label8.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label8.Location = new System.Drawing.Point(49, 176);
+            this.label8.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label8.Name = "label8";
+            this.label8.Size = new System.Drawing.Size(146, 41);
+            this.label8.TabIndex = 250;
+            this.label8.Text = "程序名称";
+            // 
+            // label9
+            // 
+            this.label9.AutoSize = true;
+            this.label9.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label9.Location = new System.Drawing.Point(951, 95);
+            this.label9.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label9.Name = "label9";
+            this.label9.Size = new System.Drawing.Size(146, 41);
+            this.label9.TabIndex = 251;
+            this.label9.Text = "生效日期";
+            // 
+            // label10
+            // 
+            this.label10.AutoSize = true;
+            this.label10.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label10.Location = new System.Drawing.Point(530, 95);
+            this.label10.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label10.Name = "label10";
+            this.label10.Size = new System.Drawing.Size(159, 41);
+            this.label10.TabIndex = 252;
+            this.label10.Text = "BOM编号";
+            // 
+            // label11
+            // 
+            this.label11.AutoSize = true;
+            this.label11.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label11.Location = new System.Drawing.Point(49, 95);
+            this.label11.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label11.Name = "label11";
+            this.label11.Size = new System.Drawing.Size(146, 41);
+            this.label11.TabIndex = 253;
+            this.label11.Text = "产品型号";
+            // 
+            // label12
+            // 
+            this.label12.AutoSize = true;
+            this.label12.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label12.Location = new System.Drawing.Point(951, 20);
+            this.label12.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label12.Name = "label12";
+            this.label12.Size = new System.Drawing.Size(146, 41);
+            this.label12.TabIndex = 254;
+            this.label12.Text = "发行日期";
+            // 
+            // label13
+            // 
+            this.label13.AutoSize = true;
+            this.label13.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label13.Location = new System.Drawing.Point(530, 20);
+            this.label13.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label13.Name = "label13";
+            this.label13.Size = new System.Drawing.Size(146, 41);
+            this.label13.TabIndex = 255;
+            this.label13.Text = "文件编号";
+            // 
+            // label14
+            // 
+            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(49, 260);
+            this.label14.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label14.Name = "label14";
+            this.label14.Size = new System.Drawing.Size(146, 41);
+            this.label14.TabIndex = 257;
+            this.label14.Text = "机器名称";
+            // 
+            // label15
+            // 
+            this.label15.AutoSize = true;
+            this.label15.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label15.Location = new System.Drawing.Point(530, 260);
+            this.label15.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label15.Name = "label15";
+            this.label15.Size = new System.Drawing.Size(82, 41);
+            this.label15.TabIndex = 256;
+            this.label15.Text = "制作";
+            // 
+            // custname
+            // 
+            this.custname.AllPower = null;
+            this.custname.BackColor = System.Drawing.Color.White;
+            this.custname.ID = null;
+            this.custname.Location = new System.Drawing.Point(207, 26);
+            this.custname.Margin = new System.Windows.Forms.Padding(6);
+            this.custname.Name = "custname";
+            this.custname.Power = null;
+            this.custname.Size = new System.Drawing.Size(260, 35);
+            this.custname.Str = null;
+            this.custname.Str1 = null;
+            this.custname.Str2 = null;
+            this.custname.TabIndex = 258;
+            // 
+            // spec
+            // 
+            this.spec.AllPower = null;
+            this.spec.BackColor = System.Drawing.Color.White;
+            this.spec.ID = null;
+            this.spec.Location = new System.Drawing.Point(207, 104);
+            this.spec.Margin = new System.Windows.Forms.Padding(6);
+            this.spec.Name = "spec";
+            this.spec.Power = null;
+            this.spec.Size = new System.Drawing.Size(260, 35);
+            this.spec.Str = null;
+            this.spec.Str1 = null;
+            this.spec.Str2 = null;
+            this.spec.TabIndex = 259;
+            // 
+            // softname
+            // 
+            this.softname.AllPower = null;
+            this.softname.BackColor = System.Drawing.Color.White;
+            this.softname.ID = null;
+            this.softname.Location = new System.Drawing.Point(207, 190);
+            this.softname.Margin = new System.Windows.Forms.Padding(6);
+            this.softname.Name = "softname";
+            this.softname.Power = null;
+            this.softname.Size = new System.Drawing.Size(260, 35);
+            this.softname.Str = null;
+            this.softname.Str1 = null;
+            this.softname.Str2 = null;
+            this.softname.TabIndex = 260;
+            // 
+            // machinename
+            // 
+            this.machinename.AllPower = null;
+            this.machinename.BackColor = System.Drawing.Color.White;
+            this.machinename.ID = null;
+            this.machinename.Location = new System.Drawing.Point(207, 269);
+            this.machinename.Margin = new System.Windows.Forms.Padding(6);
+            this.machinename.Name = "machinename";
+            this.machinename.Power = null;
+            this.machinename.Size = new System.Drawing.Size(260, 35);
+            this.machinename.Str = null;
+            this.machinename.Str1 = null;
+            this.machinename.Str2 = null;
+            this.machinename.TabIndex = 261;
+            // 
+            // mademan
+            // 
+            this.mademan.AllPower = null;
+            this.mademan.BackColor = System.Drawing.Color.White;
+            this.mademan.ID = null;
+            this.mademan.Location = new System.Drawing.Point(689, 266);
+            this.mademan.Margin = new System.Windows.Forms.Padding(6);
+            this.mademan.Name = "mademan";
+            this.mademan.Power = null;
+            this.mademan.Size = new System.Drawing.Size(260, 35);
+            this.mademan.Str = null;
+            this.mademan.Str1 = null;
+            this.mademan.Str2 = null;
+            this.mademan.TabIndex = 262;
+            // 
+            // tableab
+            // 
+            this.tableab.AllPower = null;
+            this.tableab.BackColor = System.Drawing.Color.White;
+            this.tableab.ID = null;
+            this.tableab.Location = new System.Drawing.Point(689, 190);
+            this.tableab.Margin = new System.Windows.Forms.Padding(6);
+            this.tableab.Name = "tableab";
+            this.tableab.Power = null;
+            this.tableab.Size = new System.Drawing.Size(260, 35);
+            this.tableab.Str = null;
+            this.tableab.Str1 = null;
+            this.tableab.Str2 = null;
+            this.tableab.TabIndex = 263;
+            // 
+            // bomversion
+            // 
+            this.bomversion.AllPower = null;
+            this.bomversion.BackColor = System.Drawing.Color.White;
+            this.bomversion.ID = null;
+            this.bomversion.Location = new System.Drawing.Point(689, 101);
+            this.bomversion.Margin = new System.Windows.Forms.Padding(6);
+            this.bomversion.Name = "bomversion";
+            this.bomversion.Power = null;
+            this.bomversion.Size = new System.Drawing.Size(260, 35);
+            this.bomversion.Str = null;
+            this.bomversion.Str1 = null;
+            this.bomversion.Str2 = null;
+            this.bomversion.TabIndex = 264;
+            // 
+            // filecode
+            // 
+            this.filecode.AllPower = null;
+            this.filecode.BackColor = System.Drawing.Color.White;
+            this.filecode.ID = null;
+            this.filecode.Location = new System.Drawing.Point(689, 29);
+            this.filecode.Margin = new System.Windows.Forms.Padding(6);
+            this.filecode.Name = "filecode";
+            this.filecode.Power = null;
+            this.filecode.Size = new System.Drawing.Size(260, 35);
+            this.filecode.Str = null;
+            this.filecode.Str1 = null;
+            this.filecode.Str2 = null;
+            this.filecode.TabIndex = 265;
+            // 
+            // ecn
+            // 
+            this.ecn.AllPower = null;
+            this.ecn.BackColor = System.Drawing.Color.White;
+            this.ecn.ID = null;
+            this.ecn.Location = new System.Drawing.Point(1144, 196);
+            this.ecn.Margin = new System.Windows.Forms.Padding(6);
+            this.ecn.Name = "ecn";
+            this.ecn.Power = null;
+            this.ecn.Size = new System.Drawing.Size(260, 35);
+            this.ecn.Str = null;
+            this.ecn.Str1 = null;
+            this.ecn.Str2 = null;
+            this.ecn.TabIndex = 266;
+            // 
+            // releasedate
+            // 
+            this.releasedate.Location = new System.Drawing.Point(1144, 25);
+            this.releasedate.Name = "releasedate";
+            this.releasedate.Size = new System.Drawing.Size(200, 35);
+            this.releasedate.TabIndex = 267;
+            // 
+            // workdate
+            // 
+            this.workdate.Location = new System.Drawing.Point(1144, 100);
+            this.workdate.Name = "workdate";
+            this.workdate.Size = new System.Drawing.Size(200, 35);
+            this.workdate.TabIndex = 268;
+            // 
             // Query_SpecialReport
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(1494, 1075);
+            this.Controls.Add(this.workdate);
+            this.Controls.Add(this.releasedate);
+            this.Controls.Add(this.ecn);
+            this.Controls.Add(this.filecode);
+            this.Controls.Add(this.bomversion);
+            this.Controls.Add(this.tableab);
+            this.Controls.Add(this.mademan);
+            this.Controls.Add(this.machinename);
+            this.Controls.Add(this.softname);
+            this.Controls.Add(this.spec);
+            this.Controls.Add(this.custname);
+            this.Controls.Add(this.label14);
+            this.Controls.Add(this.label15);
+            this.Controls.Add(this.label13);
+            this.Controls.Add(this.label12);
+            this.Controls.Add(this.label11);
+            this.Controls.Add(this.label10);
+            this.Controls.Add(this.label9);
+            this.Controls.Add(this.label8);
+            this.Controls.Add(this.label7);
+            this.Controls.Add(this.label4);
+            this.Controls.Add(this.label3);
             this.Controls.Add(this.dataGridView1);
             this.Controls.Add(this.TraceFilePath);
             this.Controls.Add(this.label6);
@@ -247,5 +561,27 @@
         private CustomControl.TextBoxWithIcon.EnterTextBox TraceFilePath;
         private System.Windows.Forms.Label label6;
         private System.Windows.Forms.DataGridView dataGridView1;
+        private System.Windows.Forms.Label label3;
+        private System.Windows.Forms.Label label4;
+        private System.Windows.Forms.Label label7;
+        private System.Windows.Forms.Label label8;
+        private System.Windows.Forms.Label label9;
+        private System.Windows.Forms.Label label10;
+        private System.Windows.Forms.Label label11;
+        private System.Windows.Forms.Label label12;
+        private System.Windows.Forms.Label label13;
+        private System.Windows.Forms.Label label14;
+        private System.Windows.Forms.Label label15;
+        private CustomControl.TextBoxWithIcon.EnterTextBox custname;
+        private CustomControl.TextBoxWithIcon.EnterTextBox spec;
+        private CustomControl.TextBoxWithIcon.EnterTextBox softname;
+        private CustomControl.TextBoxWithIcon.EnterTextBox machinename;
+        private CustomControl.TextBoxWithIcon.EnterTextBox mademan;
+        private CustomControl.TextBoxWithIcon.EnterTextBox tableab;
+        private CustomControl.TextBoxWithIcon.EnterTextBox bomversion;
+        private CustomControl.TextBoxWithIcon.EnterTextBox filecode;
+        private CustomControl.TextBoxWithIcon.EnterTextBox ecn;
+        private System.Windows.Forms.DateTimePicker releasedate;
+        private System.Windows.Forms.DateTimePicker workdate;
     }
 }

+ 18 - 6
UAS_MES_LGDZ/FunctionCode/Query/Query_SpecialReport.cs

@@ -88,7 +88,7 @@ namespace UAS_MES_NEW.Query
                 for (int i = 0; i < importdata.Rows.Count; i++)
                 {
                     string Refer = importdata.Rows[i]["Refer"].ToString();
-                    DataTable bom = (DataTable)dh.ExecuteSql("select bd_soncode,replace(wm_concat(bd_location||';'||nvl(bd_soncode,PRE_SONCODE)||' '||PRE_REPCODE),',',' ') from BOMDetail " +
+                    DataTable bom = (DataTable)dh.ExecuteSql("select bd_soncode,replace(wm_concat(distinct bd_location),',',' ')||';'||replace(wm_concat(distinct bd_soncode),',',' ')||' '||replace(wm_concat(distinct PRE_REPCODE),',',' ') from BOMDetail " +
                         "LEFT JOIN bom on bd_bomid=bo_id left join Product ON bd_soncode=pr_code left join ProdReplace on pre_bdid =bd_id where " +
                         "bo_mothercode='" + pr_code.Text + "' and instr(','||bd_location||',','," + Refer + ",')>0 group by bd_soncode", "select");
                     if (bom.Rows.Count > 0)
@@ -196,18 +196,30 @@ namespace UAS_MES_NEW.Query
                     STF_MACHINE.Add(dt.Rows[i][1].ToString());
                 }
                 dh.ExecuteSql("delete from SMTTRACEFILE where stf_code='" + stf_code + "'", "delete");
-                dh.BatchInsert("insert into SMTTRACEFILE(STF_ID,stf_prodcode, STF_MODEL, STF_FEEDER, STF_FEEDERNO, STF_LOCATION,STF_MACHINE, STF_CODE, STF_INDATE, STF_INMAN)" +
-                    "values(SMTTRACEFILE_SEQ.nextval,'" + pr_code.Text + "',:STF_MODEL,:STF_FEEDER,:STF_FEEDERNO,:STF_LOCATION,:STF_MACHINE,'" + stf_code + "',sysdate,'" + User.UserName + "')",
+                dh.BatchInsert("insert into  SMTTRACEFILE  (STF_ID,stf_prodcode, STF_MODEL, STF_FEEDER, STF_FEEDERNO, STF_LOCATION,STF_MACHINE, STF_CODE, STF_INDATE, STF_INMAN,custname,spec,bomversion,workdate,softname,filecode,releasedate,tableab,ecn,machinename,mademan)" +
+                    "values(SMTTRACEFILE_SEQ.nextval,'" + pr_code.Text + "',:STF_MODEL,:STF_FEEDER,:STF_FEEDERNO,:STF_LOCATION,:STF_MACHINE,'" + stf_code + "',sysdate,'" + User.UserName + "'," +
+                    "'" + custname.Text + "','" + spec.Text + "','" + bomversion.Text + "',to_date('" + workdate.Value.ToString("yyyy-MM-dd") + "','yyyy-mm-dd'),'" + softname.Text + "','" + filecode.Text + "'," +
+                    "to_date('" + releasedate.Value.ToString("yyyy-MM-dd") + "','yyyy-mm-dd'),'" + tableab.Text + "','" + ecn.Text + "','" + machinename.Text + "','" + mademan.Text + "')",
                     new string[] { "STF_MODEL", "STF_FEEDER", "STF_FEEDERNO", "STF_LOCATION", "STF_MACHINE" }, STF_MODEL.ToArray(), STF_FEEDER.ToArray(), STF_FEEDERNO.ToArray(), STF_LOCATION.ToArray(), STF_MACHINE.ToArray());
                 dh.ExecuteSql("delete from SMTTRACEFILE where ( STF_MODEL is null and  STF_FEEDER is null and STF_FEEDERNO is null and STF_MACHINE is null ) or stf_model in ('料槽','数量','印刷板') or STF_MACHINE in('贴片生产线:','设置:','***') ", "delete");
                 dataGridView1.DataSource = dt;
-                DataTable dt1 = (DataTable)dh.ExecuteSql("select STF_ID, STF_MODEL,STF_MACHINE, STF_FEEDER, STF_FEEDERNO, STF_LOCATION,replace(pr_orispeccode,' ','\n')pr_orispeccode,bo_mothercode,bd_baseqty,bd_soncode,bd_location, STF_CODE, STF_INDATE, STF_INMAN,sumqty from SMTTRACEFILE left join (select bo_mothercode,bd_baseqty,bd_soncode,replace(bd_location,',',' ')bd_location from BOMDetail LEFT JOIN bom on bd_bomid=bo_id left join Product ON bd_soncode=pr_code where bo_mothercode='" + pr_code.Text + "' ) on bo_mothercode=stf_prodcode and bd_soncode=STF_LOCATION left join product on pr_code=STF_LOCATION " +
-                    "left join (select sum(bd_baseqty)sumqty,bo_mothercode mothercode from BOMDetail LEFT JOIN bom on bd_bomid=bo_id left join Product ON bd_soncode=pr_code where bo_mothercode='" + pr_code.Text + "' group by bo_mothercode)on mothercode=bo_mothercode where stf_prodcode='" + pr_code.Text + "' order by stf_id", "select");
+                //DataTable dt1 = (DataTable)dh.ExecuteSql("select STF_ID, STF_MODEL,STF_MACHINE, STF_FEEDER, STF_FEEDERNO, STF_LOCATION,replace(pr_orispeccode,' ','\n')pr_orispeccode,bo_mothercode,bd_baseqty,bd_soncode,bd_location, STF_CODE, STF_INDATE, STF_INMAN,sumqty from SMTTRACEFILE left join (select bo_mothercode,bd_baseqty,bd_soncode,replace(bd_location,',',' ')bd_location from BOMDetail LEFT JOIN bom on bd_bomid=bo_id left join Product ON bd_soncode=pr_code where bo_mothercode='" + pr_code.Text + "' ) on bo_mothercode=stf_prodcode and bd_soncode=STF_LOCATION left join product on pr_code=STF_LOCATION " +
+                //    "left join (select sum(bd_baseqty)-1 sumqty,bo_mothercode mothercode from BOMDetail LEFT JOIN bom on bd_bomid=bo_id left join Product ON bd_soncode=pr_code where bo_mothercode='" + pr_code.Text + "' group by bo_mothercode)on mothercode=bo_mothercode where stf_prodcode='" + pr_code.Text + "' order by stf_id", "select");
+                DataTable dt1 = (DataTable)dh.ExecuteSql("select * from (select STF_ID, STF_MODEL,STF_MACHINE, STF_FEEDER, STF_FEEDERNO, STF_LOCATION,replace(pr_orispeccode,' ','\n')pr_orispeccode, bo_mothercode,to_char(bd_baseqty)bd_baseqty,bd_soncode," +
+                    "bd_location, STF_CODE, STF_INDATE, STF_INMAN,sumqty from SMTTRACEFILE  left join (select bo_mothercode,bd_baseqty,bd_soncode,replace(bd_location,',',' ')bd_location from BOMDetail  " +
+                    "LEFT JOIN bom on bd_bomid=bo_id left join Product ON bd_soncode=pr_code where bo_mothercode='"+pr_code.Text+"') on bo_mothercode=stf_prodcode and bd_soncode=STF_LOCATION left join product on " +
+                    "pr_code=STF_LOCATION  left join (select sum(bd_baseqty)-1 sumqty,bo_mothercode mothercode from BOMDetail  LEFT JOIN bom on bd_bomid=bo_id left join Product ON bd_soncode=pr_code where " +
+                    "bo_mothercode='"+pr_code.Text+"'  group by bo_mothercode)on mothercode=bo_mothercode where stf_prodcode='"+pr_code.Text+"'  union  select max(stf_id),'',max(STF_MACHINE),''," +
+                    "'代',max(pr_code),replace(max(pr_orispeccode),' ','\n')pr_orispeccode, max(bo_mothercode),'',pr_code,'',max(STF_CODE),max(STF_INDATE),max(stf_inman),0  from " +
+                    " SMTTRACEFILE left join (select bd_repcode,bo_mothercode,bd_baseqty,bd_soncode,replace(bd_location,',',' ')bd_location from BOMDetail LEFT JOIN bom on bd_bomid=bo_id where " +
+                    "bo_mothercode='"+pr_code.Text+"' and bd_repcode is not null) on bo_mothercode=stf_prodcode  and bd_soncode=STF_LOCATION left join product  on instr(bd_repcode,pr_code)>0 where " +
+                    "stf_prodcode='"+pr_code.Text+ "' and bd_repcode is not null group by stf_id,bd_repcode,pr_code order by stf_id) ", "select");
+                
                 ExportFileDialog.Description = "选择导出的路径";
                 DialogResult result1 = ExportFileDialog.ShowDialog();
                 if (result1 == DialogResult.OK)
                 {
-                    excel.ExportExcel_LIANGAN(dt1, ExportFileDialog.SelectedPath + "\\" + pr_code.Text +"_"+ System.DateTime.Now.ToString("yyyy-MM-dd hh.mm.ss") + ".xls");
+                    excel.ExportExcel_LIANGAN(dt1, ExportFileDialog.SelectedPath + "\\" + pr_code.Text + "_" + System.DateTime.Now.ToString("yyyy-MM-dd hh.mm.ss") + ".xls", custname.Text, spec.Text, bomversion.Text, workdate.Text, softname.Text, filecode.Text, releasedate.Text, tableab.Text, ecn.Text, machinename.Text, mademan.Text);
                 }
             }
         }

+ 46 - 46
UAS_MES_LGDZ/FunctionCode/Query/Query_SpecialReport.resx

@@ -130,77 +130,77 @@
   <data name="TraceFile.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=
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFfSURBVFhH5dhNTsJgFIXhM2WiCxL2oAEHrJKhQSYM
+        JIgzjSLIX0sRKPSPtl+Lo2uOgVbWcJu8CzhP8nVwISIAUAFwA+AWQFNh3M39lZMHrgDUu91uyxjji8KP
+        u7mfDgCuiVLt958fkjSTie3I62iqLu7m/sHgpQ2gRpSG6/nmc2bL23imtuHMkp0f5ADuidIMoljev+bq
+        o8PpH4NmcIjlY7JQHx0KlPCQyHBqqY8OJUqcyGhuq48OBUoUJzJeLNVHhwLlkKQysRz10eECZbpcqe8C
+        JU6NzJ1v9dGhQElSI9Zqoz46lCgmE3u9VR8dCpTUZOJsXPXRoUTJclltd+qjQ4FislzW7l59dChR8lw2
+        e099dDijNA5xYnZBKFvPVxv3x0lanA5qT71eOzsexQsjcf1AXdzN/XQ4H5l4fqs/djqtIIzC/Pgj2uJu
+        7i/Okf8O11UAd6c3pS3u5v6/w/UvTaFspAxAMh4AAAAASUVORK5CYII=
 </value>
   </data>
   <data name="TraceFile.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==
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAF3SURBVFhH5djbSgJRFMbxHsP7wBfYT7jvu46QDIoI
+        C4QNQRAIgVBRSdpxpgZN83wYx5nZOjNqrvgEd73DGvhfzdX3g32ztohoS0iVElLtCakehVQdhmE39qfg
+        AZBtIdX70Y0TjsJ4SQw/7MZ+OAip0kDJnD3UdJAsyXIjKvWm7MJu7M+X6lpIlQWK3ZhEq8pgRvfdKdvK
+        /Rk1/XglpHKA0ulPF3Tb0eyDAzzWKL3pgq7bmn1wMChdPadiK2QfHAxKW8/pqhmwDw4GpRXOqdAI2AcH
+        g9IME7qs++yDg0H5DhK6qE3YBweD0vATOq967IODQfnyE1KOxz44GJTaJKb855h9cDAoVS+mU9tlHxwM
+        iuPFdGK57IPDH8o4ouO3EfvgYFA+xhEdvg7ZB4cNil3uhquc5dLBy5Bt2P/U0+Z0kN0tOhqHlpzt0v7z
+        gF3Yjf1w2ByZ0jjD7RSs8K7l/+Ant7Ab+8058t/hOiOkquBNMQy7sX99uP4F5D4U8hdr4uMAAAAASUVO
+        RK5CYII=
 </value>
   </data>
   <data name="TraceFile.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=
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAGpSURBVFhH5dg/ayJBGMfxB4YFXTARBAvBQhAsBEEQ
+        ZLnNzFu4I6aYV5kyF9tgbad1jrsYY9T4Z3fcnV2f45e38Sx8q6l+n2IWhpiZjDFVY8wPY8xPY4wVGHZj
+        fxUepLW+0Vrfz+fzR+fclgV+2I39cNBa31Icx/FisXi6XpnL8io27F8ul89xHN9RFEWTPM+ToihZet57
+        F0XRA43HYwsp7wvxwQEeNBqNbFmWnOW5+OAADxoOh7YoS3ZZJj44wIMGg4H1RcGpu4gPDvCgfr9vvfd8
+        TlPxwQEe1Ov1bO49H8+J+OAAD+p2uxaXzNfpJD44wIM6nY69ZDnvDkfxwQEe1G637SXLeLs/iA8O8KBW
+        q2XdJePNbi8+OMCDms2mxe9o/bkTHxzgQY1GwybO8WrzKT44wIPq9bpNUsdv64344AAPqtVq9pw6/vv+
+        IT44wIPCMJzsvg7Jv/UH/1m9iw3794ejC8PwgSqVyt3LbPZ8SpLvg9e3lbiwG/vhAA8KguA2CIL739Pp
+        42a73eNQWtiN/XCAB+GhVilVVUrFSqlfSikrMOzG/u+H6/+yQ4jdXN8e9AAAAABJRU5ErkJggg==
 </value>
   </data>
   <data name="XY.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=
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFfSURBVFhH5dhNTsJgFIXhM2WiCxL2oAEHrJKhQSYM
+        JIgzjSLIX0sRKPSPtl+Lo2uOgVbWcJu8CzhP8nVwISIAUAFwA+AWQFNh3M39lZMHrgDUu91uyxjji8KP
+        u7mfDgCuiVLt958fkjSTie3I62iqLu7m/sHgpQ2gRpSG6/nmc2bL23imtuHMkp0f5ADuidIMoljev+bq
+        o8PpH4NmcIjlY7JQHx0KlPCQyHBqqY8OJUqcyGhuq48OBUoUJzJeLNVHhwLlkKQysRz10eECZbpcqe8C
+        JU6NzJ1v9dGhQElSI9Zqoz46lCgmE3u9VR8dCpTUZOJsXPXRoUTJclltd+qjQ4FislzW7l59dChR8lw2
+        e099dDijNA5xYnZBKFvPVxv3x0lanA5qT71eOzsexQsjcf1AXdzN/XQ4H5l4fqs/djqtIIzC/Pgj2uJu
+        7i/Okf8O11UAd6c3pS3u5v6/w/UvTaFspAxAMh4AAAAASUVORK5CYII=
 </value>
   </data>
   <data name="XY.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==
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAF3SURBVFhH5djbSgJRFMbxHsP7wBfYT7jvu46QDIoI
+        C4QNQRAIgVBRSdpxpgZN83wYx5nZOjNqrvgEd73DGvhfzdX3g32ztohoS0iVElLtCakehVQdhmE39qfg
+        AZBtIdX70Y0TjsJ4SQw/7MZ+OAip0kDJnD3UdJAsyXIjKvWm7MJu7M+X6lpIlQWK3ZhEq8pgRvfdKdvK
+        /Rk1/XglpHKA0ulPF3Tb0eyDAzzWKL3pgq7bmn1wMChdPadiK2QfHAxKW8/pqhmwDw4GpRXOqdAI2AcH
+        g9IME7qs++yDg0H5DhK6qE3YBweD0vATOq967IODQfnyE1KOxz44GJTaJKb855h9cDAoVS+mU9tlHxwM
+        iuPFdGK57IPDH8o4ouO3EfvgYFA+xhEdvg7ZB4cNil3uhquc5dLBy5Bt2P/U0+Z0kN0tOhqHlpzt0v7z
+        gF3Yjf1w2ByZ0jjD7RSs8K7l/+Ant7Ab+8058t/hOiOkquBNMQy7sX99uP4F5D4U8hdr4uMAAAAASUVO
+        RK5CYII=
 </value>
   </data>
   <data name="XY.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=
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAGpSURBVFhH5dg/ayJBGMfxB4YFXTARBAvBQhAsBEEQ
+        ZLnNzFu4I6aYV5kyF9tgbad1jrsYY9T4Z3fcnV2f45e38Sx8q6l+n2IWhpiZjDFVY8wPY8xPY4wVGHZj
+        fxUepLW+0Vrfz+fzR+fclgV+2I39cNBa31Icx/FisXi6XpnL8io27F8ul89xHN9RFEWTPM+ToihZet57
+        F0XRA43HYwsp7wvxwQEeNBqNbFmWnOW5+OAADxoOh7YoS3ZZJj44wIMGg4H1RcGpu4gPDvCgfr9vvfd8
+        TlPxwQEe1Ov1bO49H8+J+OAAD+p2uxaXzNfpJD44wIM6nY69ZDnvDkfxwQEe1G637SXLeLs/iA8O8KBW
+        q2XdJePNbi8+OMCDms2mxe9o/bkTHxzgQY1GwybO8WrzKT44wIPq9bpNUsdv64344AAPqtVq9pw6/vv+
+        IT44wIPCMJzsvg7Jv/UH/1m9iw3794ejC8PwgSqVyt3LbPZ8SpLvg9e3lbiwG/vhAA8KguA2CIL739Pp
+        42a73eNQWtiN/XCAB+GhVilVVUrFSqlfSikrMOzG/u+H6/+yQ4jdXN8e9AAAAABJRU5ErkJggg==
 </value>
   </data>
 </root>

+ 3 - 3
UAS_MES_LGDZ/FunctionCode/Special/Special_ChangeMakeCodeBySN.cs

@@ -69,7 +69,7 @@ namespace UAS_MES_NEW.Special
                 pr_detail1.Text = dt.Rows[0]["pr_detail"].ToString();
             }
         }
-
+                                            
         private void Confirm_Click(object sender, EventArgs e)
         {
 
@@ -77,14 +77,14 @@ namespace UAS_MES_NEW.Special
             string sncode = "";
             if (dt.Rows.Count == 0)
             {
-                OperateResult.AppendText("S\n" + ms_sncode.Text + "不存在\n");
+                OperateResult.AppendText("" + ms_sncode.Text + "不存在\n");
                 return;
             }
             else
             {
                 if (dt.Rows[0]["ms_makecode"].ToString() != ma_code.Text)
                 {
-                    OperateResult.AppendText("S\n" + ms_sncode.Text + "不存在工单" + ma_code.Text + "\n");
+                    OperateResult.AppendText("" + ms_sncode.Text + "不存在工单" + ma_code.Text + "\n");
                     return;
                 }
                 sncode = dt.Rows[0]["ms_sncode"].ToString();

+ 1 - 1
UAS_MES_LGDZ/FunctionCode/Special/Special_DeleteWN.cs

@@ -82,7 +82,7 @@ namespace UAS_MES_NEW.Special
                 sqls.Add("delete from AGINGRECORD where ar_sncode='" + ms_sncode + "' and ar_macode='" + ms_makecode + "'");
                 sqls.Add("delete from steppassed where sp_sncode='" + ms_sncode + "' or sp_sncode='"+ms_code+"' and sp_makecode='" + ms_makecode + "'");
                 //删除IMIE分配记录
-                sqls.Add("update  makeimeilist set mil_status=0,mil_sncode='',mil_psn='' where mil_sncode='" + ms_sncode + "' and mil_makecode='" + ms_makecode + "'");
+                sqls.Add("update  makeimeilist set mil_status=0,mil_sncode='' where mil_sncode='" + ms_sncode + "' and mil_makecode='" + ms_makecode + "'");
                 //更新MAC使用记录
                 sqls.Add("update makeserial set ms_nextmacode='' where ms_sncode='" + ms_sncode + "' or ms_code='" + ms_code + "' and ms_nextmacode='" + ms_makecode + "'");
                 sqls.Add("update  makeaddresslist set mal_status=0,mal_sncode='' where mal_sncode='" + ms_sncode + "' and mal_makecode='" + ms_makecode + "'");

+ 9 - 0
UAS_MES_LGDZ/UAS_MES_LGDZ.csproj

@@ -1038,6 +1038,12 @@
       <DependentUpon>Packing_ProdWeightSet.cs</DependentUpon>
     </Compile>
     <Compile Include="FunctionCode\Query\ArrayList.cs" />
+    <Compile Include="FunctionCode\Query\Query_BarcodeIn1.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="FunctionCode\Query\Query_BarcodeIn1.Designer.cs">
+      <DependentUpon>Query_BarcodeIn1.cs</DependentUpon>
+    </Compile>
     <Compile Include="FunctionCode\Query\Query_BarcodeIn.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -1829,6 +1835,9 @@
     <EmbeddedResource Include="FunctionCode\Packing\Packing_ProdWeightSet.resx">
       <DependentUpon>Packing_ProdWeightSet.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="FunctionCode\Query\Query_BarcodeIn1.resx">
+      <DependentUpon>Query_BarcodeIn1.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="FunctionCode\Query\Query_BarcodeIn.resx">
       <DependentUpon>Query_BarcodeIn.cs</DependentUpon>
     </EmbeddedResource>

+ 36 - 2
UAS_MES_ODLF/FunctionCode/Packing/Packing_PackageCollectionWeigh.cs

@@ -262,6 +262,40 @@ namespace UAS_MES_NEW.Packing
             {
                 if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out ErrorMessage))
                 {
+                    dt = (DataTable)dh.ExecuteSql("select ms_sncode from makeserial where ms_imei1='" + sn_code.Text + "' order by ms_id desc", "select");
+                    if (dt.Rows.Count > 0)
+                    {
+                        sn_code.Text = dt.Rows[0]["ms_sncode"].ToString();
+                    }
+                    else
+                    {
+                        dt = (DataTable)dh.ExecuteSql("select ms_sncode from makeserial where ms_imei2='" + sn_code.Text + "' order by ms_id desc", "select");
+                        if (dt.Rows.Count > 0)
+                        {
+                            sn_code.Text = dt.Rows[0]["ms_sncode"].ToString();
+                        }
+                        else
+                        {
+                            dt = (DataTable)dh.ExecuteSql("select mil_sncode from makeimeilist where mil_imei1='" + sn_code.Text + "' order by mil_id desc", "select");
+                            if (dt.Rows.Count > 0)
+                            {
+                                sn_code.Text = dt.Rows[0]["mil_sncode"].ToString();
+                            }
+                            else
+                            {
+                                dt = (DataTable)dh.ExecuteSql("select mil_sncode from makeimeilist where mil_imei2='" + sn_code.Text + "' order by mil_id desc", "select");
+                                if (dt.Rows.Count > 0)
+                                {
+                                    sn_code.Text = dt.Rows[0]["mil_sncode"].ToString();
+                                }
+                            }
+                        }
+                    }
+                    dt = (DataTable)dh.ExecuteSql("select mil_imei1 from Makeimeilist where mil_psn='" + sn_code.Text + "' and mil_makecode='T1030B-1025' order by mil_id desc", "select");
+                    if (dt.Rows.Count > 0)
+                    {
+                        sn_code.Text = dt.Rows[0]["mil_imei1"].ToString();
+                    }
                     dt = (DataTable)dh.ExecuteSql("select ms_status,ms_id,ms_makecode,ms_craftcode,ms_prodcode from makeserial where ms_sncode ='" + sn_code.Text + "'  order by ms_id desc", "select");
                     if (LogicHandler.CheckStepSNAndMacode("", User.UserSourceCode, sn_code.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage) || (dt.Rows.Count > 0 && dt.Rows[0]["ms_status"].ToString() == "2"))
                     {
@@ -340,7 +374,7 @@ 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);
+                                    pa_outboxcode.Text = LogicHandler.GetOutBoxCode1("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);
                                 }
                             }
@@ -398,7 +432,7 @@ 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);
+                                    pa_outboxcode.Text = LogicHandler.GetOutBoxCode1("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))

+ 1260 - 0
UAS_MES_ODLF/FunctionCode/Packing/Packing_PackageCollectionWeigh2.Designer.cs

@@ -0,0 +1,1260 @@
+namespace UAS_MES_NEW.Packing
+{
+    partial class Packing_PackageCollectionWeigh2
+    {
+        /// <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();
+            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Packing_PackageCollectionWeigh));
+            this.pa_makecode = new System.Windows.Forms.Label();
+            this.label13 = new System.Windows.Forms.Label();
+            this.pa_code_label = new System.Windows.Forms.Label();
+            this.PrintList_label = new System.Windows.Forms.Label();
+            this.PrintNum_label = new System.Windows.Forms.Label();
+            this.Cancel = new System.Windows.Forms.CheckBox();
+            this.pa_id = new System.Windows.Forms.Label();
+            this.PrintLabel = new UAS_MES_NEW.CustomControl.ComBoxWithFocus.ComboxWithTip(this.components);
+            this.label3 = new System.Windows.Forms.Label();
+            this.pa_outboxcode = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SnCollectionBox();
+            this.PrintList = new UAS_MES_NEW.CustomControl.ComBoxWithFocus.PrinterCombox();
+            this.OperateResult = new UAS_MES_NEW.CustomControl.RichText.RichTextAutoBottom();
+            this.Printing = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
+            this.Clean = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
+            this.sn_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SnCollectionBox();
+            this.PackageDetail = new UAS_MES_NEW.CustomControl.DataGrid_View.DataGridViewWithSerialNum();
+            this.pd_barcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pa_outboxcode1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pa_prodcode1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pd_innerqty = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pa_indate = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pd_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.AutoPrint = new UAS_MES_NEW.CustomControl.CustomCheckBox.AutoPrintCheckBox();
+            this.groupBoxWithBorder1 = new UAS_MES_NEW.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
+            this.PreFix_label = new System.Windows.Forms.Label();
+            this.PreFix = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SnCollectionBox();
+            this.locksalecode = new System.Windows.Forms.CheckBox();
+            this.label5 = new System.Windows.Forms.Label();
+            this.ms_makecode_label = new System.Windows.Forms.Label();
+            this.ms_salecode = new System.Windows.Forms.Label();
+            this.ms_makecode = new System.Windows.Forms.Label();
+            this.OutBoxLength_label = new System.Windows.Forms.Label();
+            this.OutBoxLength = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SnCollectionBox();
+            this.pr_outboxinnerqty = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.DeleteAll = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
+            this.pa_currentqty_label = new System.Windows.Forms.Label();
+            this.pr_detail_label = new System.Windows.Forms.Label();
+            this.pa_currentqty = new System.Windows.Forms.Label();
+            this.pr_code_label = new System.Windows.Forms.Label();
+            this.pr_detail = new System.Windows.Forms.Label();
+            this.pr_outboxinnerqty_label = new System.Windows.Forms.Label();
+            this.pr_code = new System.Windows.Forms.Label();
+            this.AutoGenBoxCode = new System.Windows.Forms.CheckBox();
+            this.StepCount = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SourceStepCount();
+            this.groupBoxWithBorder2 = new UAS_MES_NEW.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
+            this.PrintNum = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.label1 = new System.Windows.Forms.Label();
+            this.checkweightlabel = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
+            this.ob_nowcheckqty = new System.Windows.Forms.Label();
+            this.ob_batchqty = new System.Windows.Forms.Label();
+            this.ob_nowcheckqty_label = new System.Windows.Forms.Label();
+            this.ob_batchqty_label = new System.Windows.Forms.Label();
+            this.SendCheck = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
+            this.Packing = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
+            this.ob_checkno = new System.Windows.Forms.Label();
+            this.pr_packrule = new System.Windows.Forms.Label();
+            this.pa_status = new System.Windows.Forms.Label();
+            this.groupBoxWithBorder3 = new UAS_MES_NEW.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
+            this.RefreshWeigh = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
+            this.pr_cartonunit1 = new System.Windows.Forms.Label();
+            this.pr_cartonunit = new System.Windows.Forms.Label();
+            this.pr_cartonboxgw = new System.Windows.Forms.Label();
+            this.label4 = new System.Windows.Forms.Label();
+            this.weight = new System.Windows.Forms.Label();
+            this.label2 = new System.Windows.Forms.Label();
+            this.Baurate = new System.Windows.Forms.Label();
+            this.ComList = new System.Windows.Forms.Label();
+            this.pa_downstatus = new System.Windows.Forms.Label();
+            this.pa_checkno = new System.Windows.Forms.Label();
+            this.pa_sccode = new System.Windows.Forms.Label();
+            this.pa_standardqty = new System.Windows.Forms.Label();
+            this.pr_sendchecktype = new System.Windows.Forms.Label();
+            this.mcd_remainqty_label = new System.Windows.Forms.Label();
+            this.mcd_remainqty = new System.Windows.Forms.Label();
+            this.mcd_inqty_label = new System.Windows.Forms.Label();
+            this.mcd_inqty = new System.Windows.Forms.Label();
+            this.pa_remark_label = new System.Windows.Forms.Label();
+            this.pa_remark = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.CollecRemark = new System.Windows.Forms.CheckBox();
+            this.AllowRepeat = new System.Windows.Forms.CheckBox();
+            this.label6 = new System.Windows.Forms.Label();
+            this.Remark_PreFix = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SnCollectionBox();
+            ((System.ComponentModel.ISupportInitialize)(this.PackageDetail)).BeginInit();
+            this.groupBoxWithBorder1.SuspendLayout();
+            this.groupBoxWithBorder2.SuspendLayout();
+            this.groupBoxWithBorder3.SuspendLayout();
+            this.SuspendLayout();
+            // 
+            // pa_makecode
+            // 
+            this.pa_makecode.AutoSize = true;
+            this.pa_makecode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pa_makecode.Location = new System.Drawing.Point(831, 429);
+            this.pa_makecode.Name = "pa_makecode";
+            this.pa_makecode.Size = new System.Drawing.Size(0, 21);
+            this.pa_makecode.TabIndex = 76;
+            this.pa_makecode.Visible = false;
+            // 
+            // label13
+            // 
+            this.label13.AutoSize = true;
+            this.label13.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label13.ForeColor = System.Drawing.Color.Black;
+            this.label13.Location = new System.Drawing.Point(10, 553);
+            this.label13.Name = "label13";
+            this.label13.Size = new System.Drawing.Size(58, 21);
+            this.label13.TabIndex = 105;
+            this.label13.Text = "序列号";
+            // 
+            // pa_code_label
+            // 
+            this.pa_code_label.AutoSize = true;
+            this.pa_code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pa_code_label.Location = new System.Drawing.Point(4, 45);
+            this.pa_code_label.Name = "pa_code_label";
+            this.pa_code_label.Size = new System.Drawing.Size(42, 21);
+            this.pa_code_label.TabIndex = 113;
+            this.pa_code_label.Text = "箱号";
+            // 
+            // PrintList_label
+            // 
+            this.PrintList_label.AutoSize = true;
+            this.PrintList_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.PrintList_label.Location = new System.Drawing.Point(6, 52);
+            this.PrintList_label.Name = "PrintList_label";
+            this.PrintList_label.Size = new System.Drawing.Size(90, 21);
+            this.PrintList_label.TabIndex = 116;
+            this.PrintList_label.Text = "打印机列表";
+            // 
+            // PrintNum_label
+            // 
+            this.PrintNum_label.AutoSize = true;
+            this.PrintNum_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.PrintNum_label.Location = new System.Drawing.Point(191, 128);
+            this.PrintNum_label.Name = "PrintNum_label";
+            this.PrintNum_label.Size = new System.Drawing.Size(42, 21);
+            this.PrintNum_label.TabIndex = 124;
+            this.PrintNum_label.Text = "份数";
+            // 
+            // Cancel
+            // 
+            this.Cancel.AutoSize = true;
+            this.Cancel.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.Cancel.Location = new System.Drawing.Point(281, 554);
+            this.Cancel.Name = "Cancel";
+            this.Cancel.Size = new System.Drawing.Size(93, 25);
+            this.Cancel.TabIndex = 129;
+            this.Cancel.Text = "取消装箱";
+            this.Cancel.UseVisualStyleBackColor = true;
+            // 
+            // pa_id
+            // 
+            this.pa_id.AutoSize = true;
+            this.pa_id.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pa_id.Location = new System.Drawing.Point(799, 429);
+            this.pa_id.Name = "pa_id";
+            this.pa_id.Size = new System.Drawing.Size(0, 21);
+            this.pa_id.TabIndex = 153;
+            this.pa_id.Visible = false;
+            // 
+            // PrintLabel
+            // 
+            this.PrintLabel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.PrintLabel.Font = new System.Drawing.Font("微软雅黑", 9F);
+            this.PrintLabel.FormattingEnabled = true;
+            this.PrintLabel.Location = new System.Drawing.Point(110, 91);
+            this.PrintLabel.Margin = new System.Windows.Forms.Padding(2);
+            this.PrintLabel.Name = "PrintLabel";
+            this.PrintLabel.Size = new System.Drawing.Size(150, 25);
+            this.PrintLabel.TabIndex = 159;
+            this.PrintLabel.SelectedValueChanged += new System.EventHandler(this.PrintLabel_SelectedValueChanged);
+            // 
+            // label3
+            // 
+            this.label3.AutoSize = true;
+            this.label3.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label3.Location = new System.Drawing.Point(6, 90);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(74, 21);
+            this.label3.TabIndex = 160;
+            this.label3.Text = "打印标签";
+            // 
+            // pa_outboxcode
+            // 
+            this.pa_outboxcode.AllPower = null;
+            this.pa_outboxcode.BackColor = System.Drawing.Color.White;
+            this.pa_outboxcode.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.pa_outboxcode.ForeColor = System.Drawing.Color.Black;
+            this.pa_outboxcode.ID = null;
+            this.pa_outboxcode.Location = new System.Drawing.Point(91, 45);
+            this.pa_outboxcode.Margin = new System.Windows.Forms.Padding(6, 7, 6, 7);
+            this.pa_outboxcode.Name = "pa_outboxcode";
+            this.pa_outboxcode.Power = null;
+            this.pa_outboxcode.Size = new System.Drawing.Size(138, 29);
+            this.pa_outboxcode.Str = null;
+            this.pa_outboxcode.Str1 = null;
+            this.pa_outboxcode.Str2 = null;
+            this.pa_outboxcode.TabIndex = 163;
+            this.pa_outboxcode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.pa_code_KeyDown);
+            // 
+            // PrintList
+            // 
+            this.PrintList.Font = new System.Drawing.Font("微软雅黑", 9F);
+            this.PrintList.Location = new System.Drawing.Point(110, 54);
+            this.PrintList.Margin = new System.Windows.Forms.Padding(6, 7, 6, 7);
+            this.PrintList.Name = "PrintList";
+            this.PrintList.Size = new System.Drawing.Size(149, 28);
+            this.PrintList.TabIndex = 158;
+            // 
+            // OperateResult
+            // 
+            this.OperateResult.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.OperateResult.Location = new System.Drawing.Point(4, 427);
+            this.OperateResult.Name = "OperateResult";
+            this.OperateResult.Size = new System.Drawing.Size(432, 120);
+            this.OperateResult.TabIndex = 155;
+            this.OperateResult.Text = "";
+            // 
+            // Printing
+            // 
+            this.Printing.AllPower = "ifall";
+            this.Printing.BackColor = System.Drawing.Color.Transparent;
+            this.Printing.DownImage = ((System.Drawing.Image)(resources.GetObject("Printing.DownImage")));
+            this.Printing.Font = new System.Drawing.Font("微软雅黑", 9F);
+            this.Printing.Image = null;
+            this.Printing.IsShowBorder = true;
+            this.Printing.Location = new System.Drawing.Point(303, 128);
+            this.Printing.MoveImage = ((System.Drawing.Image)(resources.GetObject("Printing.MoveImage")));
+            this.Printing.Name = "Printing";
+            this.Printing.NormalImage = ((System.Drawing.Image)(resources.GetObject("Printing.NormalImage")));
+            this.Printing.Power = null;
+            this.Printing.Size = new System.Drawing.Size(45, 24);
+            this.Printing.TabIndex = 150;
+            this.Printing.Tag = "ifread";
+            this.Printing.Text = "打印";
+            this.Printing.UseVisualStyleBackColor = true;
+            this.Printing.Click += new System.EventHandler(this.Print_Click);
+            // 
+            // Clean
+            // 
+            this.Clean.AllPower = null;
+            this.Clean.BackColor = System.Drawing.Color.Transparent;
+            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(376, 555);
+            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(60, 24);
+            this.Clean.TabIndex = 148;
+            this.Clean.Text = "清除";
+            this.Clean.UseVisualStyleBackColor = true;
+            this.Clean.Click += new System.EventHandler(this.Clean_Click);
+            // 
+            // sn_code
+            // 
+            this.sn_code.AllPower = "ifall";
+            this.sn_code.BackColor = System.Drawing.Color.White;
+            this.sn_code.ID = null;
+            this.sn_code.Location = new System.Drawing.Point(76, 554);
+            this.sn_code.Name = "sn_code";
+            this.sn_code.Power = "ifread";
+            this.sn_code.Size = new System.Drawing.Size(170, 21);
+            this.sn_code.Str = null;
+            this.sn_code.Str1 = null;
+            this.sn_code.Str2 = null;
+            this.sn_code.TabIndex = 135;
+            this.sn_code.Tag = "";
+            this.sn_code.KeyDown += new System.Windows.Forms.KeyEventHandler(this.barcode_KeyDown);
+            // 
+            // PackageDetail
+            // 
+            this.PackageDetail.AllowUserToAddRows = false;
+            this.PackageDetail.AllowUserToDeleteRows = false;
+            this.PackageDetail.BackgroundColor = System.Drawing.SystemColors.ButtonFace;
+            this.PackageDetail.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+            this.PackageDetail.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
+            this.pd_barcode,
+            this.pa_outboxcode1,
+            this.pa_prodcode1,
+            this.pd_innerqty,
+            this.pa_indate,
+            this.pd_id});
+            this.PackageDetail.EnableContentClick = true;
+            this.PackageDetail.Location = new System.Drawing.Point(4, 179);
+            this.PackageDetail.Name = "PackageDetail";
+            this.PackageDetail.ReadOnly = true;
+            this.PackageDetail.RowTemplate.Height = 23;
+            this.PackageDetail.Size = new System.Drawing.Size(621, 240);
+            this.PackageDetail.TabIndex = 134;
+            // 
+            // pd_barcode
+            // 
+            this.pd_barcode.DataPropertyName = "pd_barcode";
+            this.pd_barcode.HeaderText = "序列号";
+            this.pd_barcode.MinimumWidth = 250;
+            this.pd_barcode.Name = "pd_barcode";
+            this.pd_barcode.ReadOnly = true;
+            this.pd_barcode.Resizable = System.Windows.Forms.DataGridViewTriState.True;
+            this.pd_barcode.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic;
+            this.pd_barcode.Width = 250;
+            // 
+            // pa_outboxcode1
+            // 
+            this.pa_outboxcode1.DataPropertyName = "pa_outboxcode";
+            this.pa_outboxcode1.HeaderText = "箱号";
+            this.pa_outboxcode1.MinimumWidth = 200;
+            this.pa_outboxcode1.Name = "pa_outboxcode1";
+            this.pa_outboxcode1.ReadOnly = true;
+            this.pa_outboxcode1.Width = 201;
+            // 
+            // pa_prodcode1
+            // 
+            this.pa_prodcode1.DataPropertyName = "pa_prodcode";
+            this.pa_prodcode1.HeaderText = "产品编号";
+            this.pa_prodcode1.Name = "pa_prodcode1";
+            this.pa_prodcode1.ReadOnly = true;
+            this.pa_prodcode1.Visible = false;
+            // 
+            // pd_innerqty
+            // 
+            this.pd_innerqty.DataPropertyName = "pd_innerqty";
+            this.pd_innerqty.HeaderText = "箱内数量";
+            this.pd_innerqty.Name = "pd_innerqty";
+            this.pd_innerqty.ReadOnly = true;
+            this.pd_innerqty.Visible = false;
+            this.pd_innerqty.Width = 80;
+            // 
+            // pa_indate
+            // 
+            this.pa_indate.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.pa_indate.DataPropertyName = "pa_indate";
+            this.pa_indate.HeaderText = "装箱日期";
+            this.pa_indate.MinimumWidth = 300;
+            this.pa_indate.Name = "pa_indate";
+            this.pa_indate.ReadOnly = true;
+            this.pa_indate.Width = 300;
+            // 
+            // pd_id
+            // 
+            this.pd_id.DataPropertyName = "pd_id";
+            this.pd_id.HeaderText = "ID";
+            this.pd_id.Name = "pd_id";
+            this.pd_id.ReadOnly = true;
+            this.pd_id.Visible = false;
+            // 
+            // AutoPrint
+            // 
+            this.AutoPrint.Checked = false;
+            this.AutoPrint.Location = new System.Drawing.Point(78, 129);
+            this.AutoPrint.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
+            this.AutoPrint.Name = "AutoPrint";
+            this.AutoPrint.Size = new System.Drawing.Size(89, 22);
+            this.AutoPrint.TabIndex = 166;
+            // 
+            // groupBoxWithBorder1
+            // 
+            this.groupBoxWithBorder1.BorderColor = System.Drawing.Color.Black;
+            this.groupBoxWithBorder1.Controls.Add(this.PreFix_label);
+            this.groupBoxWithBorder1.Controls.Add(this.PreFix);
+            this.groupBoxWithBorder1.Controls.Add(this.locksalecode);
+            this.groupBoxWithBorder1.Controls.Add(this.label5);
+            this.groupBoxWithBorder1.Controls.Add(this.ms_makecode_label);
+            this.groupBoxWithBorder1.Controls.Add(this.ms_salecode);
+            this.groupBoxWithBorder1.Controls.Add(this.ms_makecode);
+            this.groupBoxWithBorder1.Controls.Add(this.OutBoxLength_label);
+            this.groupBoxWithBorder1.Controls.Add(this.OutBoxLength);
+            this.groupBoxWithBorder1.Controls.Add(this.pr_outboxinnerqty);
+            this.groupBoxWithBorder1.Controls.Add(this.DeleteAll);
+            this.groupBoxWithBorder1.Controls.Add(this.pa_currentqty_label);
+            this.groupBoxWithBorder1.Controls.Add(this.pr_detail_label);
+            this.groupBoxWithBorder1.Controls.Add(this.pa_currentqty);
+            this.groupBoxWithBorder1.Controls.Add(this.pr_code_label);
+            this.groupBoxWithBorder1.Controls.Add(this.pr_detail);
+            this.groupBoxWithBorder1.Controls.Add(this.pr_outboxinnerqty_label);
+            this.groupBoxWithBorder1.Controls.Add(this.pr_code);
+            this.groupBoxWithBorder1.Controls.Add(this.AutoGenBoxCode);
+            this.groupBoxWithBorder1.Controls.Add(this.pa_outboxcode);
+            this.groupBoxWithBorder1.Controls.Add(this.pa_code_label);
+            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(4, 6);
+            this.groupBoxWithBorder1.Margin = new System.Windows.Forms.Padding(2);
+            this.groupBoxWithBorder1.Name = "groupBoxWithBorder1";
+            this.groupBoxWithBorder1.Padding = new System.Windows.Forms.Padding(2);
+            this.groupBoxWithBorder1.Size = new System.Drawing.Size(411, 168);
+            this.groupBoxWithBorder1.TabIndex = 171;
+            this.groupBoxWithBorder1.TabStop = false;
+            this.groupBoxWithBorder1.Text = "装箱信息";
+            this.groupBoxWithBorder1.TextColor = System.Drawing.Color.Black;
+            // 
+            // PreFix_label
+            // 
+            this.PreFix_label.AutoSize = true;
+            this.PreFix_label.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.PreFix_label.Location = new System.Drawing.Point(176, 13);
+            this.PreFix_label.Name = "PreFix_label";
+            this.PreFix_label.Size = new System.Drawing.Size(37, 20);
+            this.PreFix_label.TabIndex = 205;
+            this.PreFix_label.Text = "前缀";
+            // 
+            // PreFix
+            // 
+            this.PreFix.AllPower = null;
+            this.PreFix.BackColor = System.Drawing.Color.White;
+            this.PreFix.Font = new System.Drawing.Font("微软雅黑", 9F);
+            this.PreFix.ID = null;
+            this.PreFix.Location = new System.Drawing.Point(223, 15);
+            this.PreFix.Margin = new System.Windows.Forms.Padding(6, 7, 6, 7);
+            this.PreFix.Name = "PreFix";
+            this.PreFix.Power = null;
+            this.PreFix.Size = new System.Drawing.Size(40, 23);
+            this.PreFix.Str = null;
+            this.PreFix.Str1 = null;
+            this.PreFix.Str2 = null;
+            this.PreFix.TabIndex = 204;
+            this.PreFix.KeyDown += new System.Windows.Forms.KeyEventHandler(this.PreFix_KeyDown);
+            // 
+            // locksalecode
+            // 
+            this.locksalecode.AutoSize = true;
+            this.locksalecode.Checked = true;
+            this.locksalecode.CheckState = System.Windows.Forms.CheckState.Checked;
+            this.locksalecode.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.locksalecode.ForeColor = System.Drawing.Color.Red;
+            this.locksalecode.Location = new System.Drawing.Point(298, 15);
+            this.locksalecode.Name = "locksalecode";
+            this.locksalecode.Size = new System.Drawing.Size(96, 16);
+            this.locksalecode.TabIndex = 203;
+            this.locksalecode.Text = "当前订单锁定";
+            this.locksalecode.UseVisualStyleBackColor = true;
+            // 
+            // label5
+            // 
+            this.label5.AutoSize = true;
+            this.label5.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label5.Location = new System.Drawing.Point(210, 136);
+            this.label5.Name = "label5";
+            this.label5.Size = new System.Drawing.Size(74, 21);
+            this.label5.TabIndex = 188;
+            this.label5.Text = "订单编号";
+            // 
+            // ms_makecode_label
+            // 
+            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(4, 136);
+            this.ms_makecode_label.Name = "ms_makecode_label";
+            this.ms_makecode_label.Size = new System.Drawing.Size(58, 21);
+            this.ms_makecode_label.TabIndex = 189;
+            this.ms_makecode_label.Text = "工单号";
+            // 
+            // ms_salecode
+            // 
+            this.ms_salecode.AutoSize = true;
+            this.ms_salecode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ms_salecode.Location = new System.Drawing.Point(294, 136);
+            this.ms_salecode.Name = "ms_salecode";
+            this.ms_salecode.Size = new System.Drawing.Size(0, 21);
+            this.ms_salecode.TabIndex = 191;
+            // 
+            // ms_makecode
+            // 
+            this.ms_makecode.AutoSize = true;
+            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(85, 136);
+            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, 21);
+            this.ms_makecode.TabIndex = 190;
+            // 
+            // OutBoxLength_label
+            // 
+            this.OutBoxLength_label.AutoSize = true;
+            this.OutBoxLength_label.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.OutBoxLength_label.Location = new System.Drawing.Point(85, 13);
+            this.OutBoxLength_label.Name = "OutBoxLength_label";
+            this.OutBoxLength_label.Size = new System.Drawing.Size(37, 20);
+            this.OutBoxLength_label.TabIndex = 187;
+            this.OutBoxLength_label.Text = "长度";
+            // 
+            // OutBoxLength
+            // 
+            this.OutBoxLength.AllPower = null;
+            this.OutBoxLength.BackColor = System.Drawing.Color.White;
+            this.OutBoxLength.Font = new System.Drawing.Font("微软雅黑", 9F);
+            this.OutBoxLength.ID = null;
+            this.OutBoxLength.Location = new System.Drawing.Point(131, 15);
+            this.OutBoxLength.Margin = new System.Windows.Forms.Padding(6, 7, 6, 7);
+            this.OutBoxLength.Name = "OutBoxLength";
+            this.OutBoxLength.Power = null;
+            this.OutBoxLength.Size = new System.Drawing.Size(40, 23);
+            this.OutBoxLength.Str = null;
+            this.OutBoxLength.Str1 = null;
+            this.OutBoxLength.Str2 = null;
+            this.OutBoxLength.TabIndex = 186;
+            this.OutBoxLength.KeyDown += new System.Windows.Forms.KeyEventHandler(this.OutBoxLength_KeyDown);
+            // 
+            // pr_outboxinnerqty
+            // 
+            this.pr_outboxinnerqty.AllPower = null;
+            this.pr_outboxinnerqty.BackColor = System.Drawing.Color.White;
+            this.pr_outboxinnerqty.Enabled = false;
+            this.pr_outboxinnerqty.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pr_outboxinnerqty.ID = null;
+            this.pr_outboxinnerqty.Location = new System.Drawing.Point(91, 77);
+            this.pr_outboxinnerqty.Name = "pr_outboxinnerqty";
+            this.pr_outboxinnerqty.Power = null;
+            this.pr_outboxinnerqty.Size = new System.Drawing.Size(110, 23);
+            this.pr_outboxinnerqty.Str = null;
+            this.pr_outboxinnerqty.Str1 = null;
+            this.pr_outboxinnerqty.Str2 = null;
+            this.pr_outboxinnerqty.TabIndex = 184;
+            // 
+            // DeleteAll
+            // 
+            this.DeleteAll.AllPower = null;
+            this.DeleteAll.BackColor = System.Drawing.Color.Transparent;
+            this.DeleteAll.DownImage = ((System.Drawing.Image)(resources.GetObject("DeleteAll.DownImage")));
+            this.DeleteAll.Font = new System.Drawing.Font("微软雅黑", 9F);
+            this.DeleteAll.Image = null;
+            this.DeleteAll.IsShowBorder = true;
+            this.DeleteAll.Location = new System.Drawing.Point(351, 42);
+            this.DeleteAll.MoveImage = ((System.Drawing.Image)(resources.GetObject("DeleteAll.MoveImage")));
+            this.DeleteAll.Name = "DeleteAll";
+            this.DeleteAll.NormalImage = ((System.Drawing.Image)(resources.GetObject("DeleteAll.NormalImage")));
+            this.DeleteAll.Power = "ifspecial";
+            this.DeleteAll.Size = new System.Drawing.Size(46, 24);
+            this.DeleteAll.TabIndex = 184;
+            this.DeleteAll.Text = "拆箱";
+            this.DeleteAll.UseVisualStyleBackColor = true;
+            this.DeleteAll.Click += new System.EventHandler(this.DeleteAll_Click);
+            // 
+            // pa_currentqty_label
+            // 
+            this.pa_currentqty_label.AutoSize = true;
+            this.pa_currentqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pa_currentqty_label.Location = new System.Drawing.Point(210, 78);
+            this.pa_currentqty_label.Name = "pa_currentqty_label";
+            this.pa_currentqty_label.Size = new System.Drawing.Size(74, 21);
+            this.pa_currentqty_label.TabIndex = 175;
+            this.pa_currentqty_label.Text = "已装数量";
+            // 
+            // pr_detail_label
+            // 
+            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(210, 106);
+            this.pr_detail_label.Name = "pr_detail_label";
+            this.pr_detail_label.Size = new System.Drawing.Size(74, 21);
+            this.pr_detail_label.TabIndex = 173;
+            this.pr_detail_label.Text = "产品名称";
+            // 
+            // pa_currentqty
+            // 
+            this.pa_currentqty.AutoSize = true;
+            this.pa_currentqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pa_currentqty.Location = new System.Drawing.Point(294, 78);
+            this.pa_currentqty.Name = "pa_currentqty";
+            this.pa_currentqty.Size = new System.Drawing.Size(0, 21);
+            this.pa_currentqty.TabIndex = 179;
+            // 
+            // pr_code_label
+            // 
+            this.pr_code_label.AutoSize = true;
+            this.pr_code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pr_code_label.Location = new System.Drawing.Point(4, 107);
+            this.pr_code_label.Name = "pr_code_label";
+            this.pr_code_label.Size = new System.Drawing.Size(74, 21);
+            this.pr_code_label.TabIndex = 174;
+            this.pr_code_label.Text = "产品编号";
+            // 
+            // pr_detail
+            // 
+            this.pr_detail.AutoSize = true;
+            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(294, 106);
+            this.pr_detail.Name = "pr_detail";
+            this.pr_detail.Size = new System.Drawing.Size(0, 21);
+            this.pr_detail.TabIndex = 178;
+            // 
+            // pr_outboxinnerqty_label
+            // 
+            this.pr_outboxinnerqty_label.AutoSize = true;
+            this.pr_outboxinnerqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pr_outboxinnerqty_label.Location = new System.Drawing.Point(4, 74);
+            this.pr_outboxinnerqty_label.Name = "pr_outboxinnerqty_label";
+            this.pr_outboxinnerqty_label.Size = new System.Drawing.Size(74, 21);
+            this.pr_outboxinnerqty_label.TabIndex = 176;
+            this.pr_outboxinnerqty_label.Text = "箱内容量";
+            // 
+            // pr_code
+            // 
+            this.pr_code.AutoSize = true;
+            this.pr_code.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pr_code.Location = new System.Drawing.Point(85, 107);
+            this.pr_code.MaximumSize = new System.Drawing.Size(150, 0);
+            this.pr_code.Name = "pr_code";
+            this.pr_code.Size = new System.Drawing.Size(0, 21);
+            this.pr_code.TabIndex = 177;
+            this.pr_code.TextChanged += new System.EventHandler(this.pr_code_TextChanged);
+            // 
+            // AutoGenBoxCode
+            // 
+            this.AutoGenBoxCode.AutoSize = true;
+            this.AutoGenBoxCode.Location = new System.Drawing.Point(242, 46);
+            this.AutoGenBoxCode.Margin = new System.Windows.Forms.Padding(2);
+            this.AutoGenBoxCode.Name = "AutoGenBoxCode";
+            this.AutoGenBoxCode.Size = new System.Drawing.Size(93, 25);
+            this.AutoGenBoxCode.TabIndex = 171;
+            this.AutoGenBoxCode.Text = "自动生成";
+            this.AutoGenBoxCode.UseVisualStyleBackColor = true;
+            this.AutoGenBoxCode.CheckedChanged += new System.EventHandler(this.AutoGenBoxCode_CheckedChanged);
+            // 
+            // StepCount
+            // 
+            this.StepCount.LineCode = null;
+            this.StepCount.Location = new System.Drawing.Point(111, 19);
+            this.StepCount.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
+            this.StepCount.Name = "StepCount";
+            this.StepCount.Size = new System.Drawing.Size(88, 23);
+            this.StepCount.Source = null;
+            this.StepCount.StepCode = null;
+            this.StepCount.TabIndex = 192;
+            // 
+            // groupBoxWithBorder2
+            // 
+            this.groupBoxWithBorder2.BorderColor = System.Drawing.Color.Black;
+            this.groupBoxWithBorder2.Controls.Add(this.StepCount);
+            this.groupBoxWithBorder2.Controls.Add(this.PrintNum);
+            this.groupBoxWithBorder2.Controls.Add(this.label1);
+            this.groupBoxWithBorder2.Controls.Add(this.checkweightlabel);
+            this.groupBoxWithBorder2.Controls.Add(this.ob_nowcheckqty);
+            this.groupBoxWithBorder2.Controls.Add(this.ob_batchqty);
+            this.groupBoxWithBorder2.Controls.Add(this.ob_nowcheckqty_label);
+            this.groupBoxWithBorder2.Controls.Add(this.ob_batchqty_label);
+            this.groupBoxWithBorder2.Controls.Add(this.SendCheck);
+            this.groupBoxWithBorder2.Controls.Add(this.Packing);
+            this.groupBoxWithBorder2.Controls.Add(this.PrintLabel);
+            this.groupBoxWithBorder2.Controls.Add(this.ob_checkno);
+            this.groupBoxWithBorder2.Controls.Add(this.label3);
+            this.groupBoxWithBorder2.Controls.Add(this.AutoPrint);
+            this.groupBoxWithBorder2.Controls.Add(this.PrintList);
+            this.groupBoxWithBorder2.Controls.Add(this.Printing);
+            this.groupBoxWithBorder2.Controls.Add(this.PrintList_label);
+            this.groupBoxWithBorder2.Controls.Add(this.PrintNum_label);
+            this.groupBoxWithBorder2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.groupBoxWithBorder2.Location = new System.Drawing.Point(420, 6);
+            this.groupBoxWithBorder2.Margin = new System.Windows.Forms.Padding(2);
+            this.groupBoxWithBorder2.Name = "groupBoxWithBorder2";
+            this.groupBoxWithBorder2.Padding = new System.Windows.Forms.Padding(2);
+            this.groupBoxWithBorder2.Size = new System.Drawing.Size(446, 168);
+            this.groupBoxWithBorder2.TabIndex = 172;
+            this.groupBoxWithBorder2.TabStop = false;
+            this.groupBoxWithBorder2.Text = "打印";
+            this.groupBoxWithBorder2.TextColor = System.Drawing.Color.Black;
+            // 
+            // PrintNum
+            // 
+            this.PrintNum.AllPower = null;
+            this.PrintNum.BackColor = System.Drawing.Color.White;
+            this.PrintNum.Enabled = false;
+            this.PrintNum.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.PrintNum.ID = null;
+            this.PrintNum.Location = new System.Drawing.Point(242, 129);
+            this.PrintNum.Name = "PrintNum";
+            this.PrintNum.Power = null;
+            this.PrintNum.Size = new System.Drawing.Size(32, 23);
+            this.PrintNum.Str = null;
+            this.PrintNum.Str1 = null;
+            this.PrintNum.Str2 = null;
+            this.PrintNum.TabIndex = 184;
+            // 
+            // 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(269, 22);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(74, 21);
+            this.label1.TabIndex = 180;
+            this.label1.Text = "当前批号";
+            // 
+            // checkweightlabel
+            // 
+            this.checkweightlabel.AutoSize = true;
+            this.checkweightlabel.CutLength = null;
+            this.checkweightlabel.ForeColor = System.Drawing.Color.Black;
+            this.checkweightlabel.Location = new System.Drawing.Point(15, 21);
+            this.checkweightlabel.MaximumSize = new System.Drawing.Size(200, 0);
+            this.checkweightlabel.Name = "checkweightlabel";
+            this.checkweightlabel.Size = new System.Drawing.Size(0, 21);
+            this.checkweightlabel.TabIndex = 179;
+            // 
+            // ob_nowcheckqty
+            // 
+            this.ob_nowcheckqty.AutoSize = true;
+            this.ob_nowcheckqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ob_nowcheckqty.Location = new System.Drawing.Point(350, 92);
+            this.ob_nowcheckqty.Name = "ob_nowcheckqty";
+            this.ob_nowcheckqty.Size = new System.Drawing.Size(0, 21);
+            this.ob_nowcheckqty.TabIndex = 178;
+            // 
+            // ob_batchqty
+            // 
+            this.ob_batchqty.AutoSize = true;
+            this.ob_batchqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ob_batchqty.Location = new System.Drawing.Point(350, 56);
+            this.ob_batchqty.Name = "ob_batchqty";
+            this.ob_batchqty.Size = new System.Drawing.Size(0, 21);
+            this.ob_batchqty.TabIndex = 177;
+            // 
+            // ob_nowcheckqty_label
+            // 
+            this.ob_nowcheckqty_label.AutoSize = true;
+            this.ob_nowcheckqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ob_nowcheckqty_label.Location = new System.Drawing.Point(269, 92);
+            this.ob_nowcheckqty_label.Name = "ob_nowcheckqty_label";
+            this.ob_nowcheckqty_label.Size = new System.Drawing.Size(74, 21);
+            this.ob_nowcheckqty_label.TabIndex = 176;
+            this.ob_nowcheckqty_label.Text = "当前批数";
+            // 
+            // ob_batchqty_label
+            // 
+            this.ob_batchqty_label.AutoSize = true;
+            this.ob_batchqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ob_batchqty_label.Location = new System.Drawing.Point(269, 56);
+            this.ob_batchqty_label.Name = "ob_batchqty_label";
+            this.ob_batchqty_label.Size = new System.Drawing.Size(74, 21);
+            this.ob_batchqty_label.TabIndex = 175;
+            this.ob_batchqty_label.Text = "标准批数";
+            // 
+            // SendCheck
+            // 
+            this.SendCheck.AllPower = "ifall";
+            this.SendCheck.BackColor = System.Drawing.Color.Transparent;
+            this.SendCheck.DownImage = ((System.Drawing.Image)(resources.GetObject("SendCheck.DownImage")));
+            this.SendCheck.Font = new System.Drawing.Font("微软雅黑", 9F);
+            this.SendCheck.Image = null;
+            this.SendCheck.IsShowBorder = true;
+            this.SendCheck.Location = new System.Drawing.Point(369, 128);
+            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(45, 24);
+            this.SendCheck.TabIndex = 174;
+            this.SendCheck.Tag = "ifread";
+            this.SendCheck.Text = "送检";
+            this.SendCheck.UseVisualStyleBackColor = true;
+            this.SendCheck.Click += new System.EventHandler(this.SendCheck_Click);
+            // 
+            // Packing
+            // 
+            this.Packing.AllPower = null;
+            this.Packing.BackColor = System.Drawing.Color.Transparent;
+            this.Packing.DownImage = ((System.Drawing.Image)(resources.GetObject("Packing.DownImage")));
+            this.Packing.Font = new System.Drawing.Font("微软雅黑", 9F);
+            this.Packing.Image = null;
+            this.Packing.IsShowBorder = true;
+            this.Packing.Location = new System.Drawing.Point(8, 128);
+            this.Packing.MoveImage = ((System.Drawing.Image)(resources.GetObject("Packing.MoveImage")));
+            this.Packing.Name = "Packing";
+            this.Packing.NormalImage = ((System.Drawing.Image)(resources.GetObject("Packing.NormalImage")));
+            this.Packing.Power = null;
+            this.Packing.Size = new System.Drawing.Size(50, 24);
+            this.Packing.TabIndex = 173;
+            this.Packing.Text = "封箱";
+            this.Packing.UseVisualStyleBackColor = true;
+            this.Packing.Click += new System.EventHandler(this.Packing_Click);
+            // 
+            // ob_checkno
+            // 
+            this.ob_checkno.AutoSize = true;
+            this.ob_checkno.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ob_checkno.Location = new System.Drawing.Point(350, 22);
+            this.ob_checkno.Name = "ob_checkno";
+            this.ob_checkno.Size = new System.Drawing.Size(0, 21);
+            this.ob_checkno.TabIndex = 175;
+            this.ob_checkno.TextChanged += new System.EventHandler(this.ob_checkno_TextChanged);
+            // 
+            // pr_packrule
+            // 
+            this.pr_packrule.AutoSize = true;
+            this.pr_packrule.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pr_packrule.Location = new System.Drawing.Point(849, 454);
+            this.pr_packrule.Name = "pr_packrule";
+            this.pr_packrule.Size = new System.Drawing.Size(0, 21);
+            this.pr_packrule.TabIndex = 173;
+            this.pr_packrule.Visible = false;
+            // 
+            // pa_status
+            // 
+            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(777, 429);
+            this.pa_status.Name = "pa_status";
+            this.pa_status.Size = new System.Drawing.Size(0, 21);
+            this.pa_status.TabIndex = 174;
+            this.pa_status.Visible = false;
+            // 
+            // groupBoxWithBorder3
+            // 
+            this.groupBoxWithBorder3.BorderColor = System.Drawing.Color.Black;
+            this.groupBoxWithBorder3.Controls.Add(this.RefreshWeigh);
+            this.groupBoxWithBorder3.Controls.Add(this.pr_cartonunit1);
+            this.groupBoxWithBorder3.Controls.Add(this.pr_cartonunit);
+            this.groupBoxWithBorder3.Controls.Add(this.pr_cartonboxgw);
+            this.groupBoxWithBorder3.Controls.Add(this.label4);
+            this.groupBoxWithBorder3.Controls.Add(this.weight);
+            this.groupBoxWithBorder3.Controls.Add(this.label2);
+            this.groupBoxWithBorder3.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.groupBoxWithBorder3.Location = new System.Drawing.Point(630, 178);
+            this.groupBoxWithBorder3.Margin = new System.Windows.Forms.Padding(2);
+            this.groupBoxWithBorder3.Name = "groupBoxWithBorder3";
+            this.groupBoxWithBorder3.Padding = new System.Windows.Forms.Padding(2);
+            this.groupBoxWithBorder3.Size = new System.Drawing.Size(237, 241);
+            this.groupBoxWithBorder3.TabIndex = 172;
+            this.groupBoxWithBorder3.TabStop = false;
+            this.groupBoxWithBorder3.Text = "称量信息";
+            this.groupBoxWithBorder3.TextColor = System.Drawing.Color.Black;
+            // 
+            // RefreshWeigh
+            // 
+            this.RefreshWeigh.AllPower = "ifall";
+            this.RefreshWeigh.BackColor = System.Drawing.Color.Transparent;
+            this.RefreshWeigh.DownImage = ((System.Drawing.Image)(resources.GetObject("RefreshWeigh.DownImage")));
+            this.RefreshWeigh.Font = new System.Drawing.Font("微软雅黑", 9F);
+            this.RefreshWeigh.Image = null;
+            this.RefreshWeigh.IsShowBorder = true;
+            this.RefreshWeigh.Location = new System.Drawing.Point(111, 125);
+            this.RefreshWeigh.MoveImage = ((System.Drawing.Image)(resources.GetObject("RefreshWeigh.MoveImage")));
+            this.RefreshWeigh.Name = "RefreshWeigh";
+            this.RefreshWeigh.NormalImage = ((System.Drawing.Image)(resources.GetObject("RefreshWeigh.NormalImage")));
+            this.RefreshWeigh.Power = null;
+            this.RefreshWeigh.Size = new System.Drawing.Size(58, 24);
+            this.RefreshWeigh.TabIndex = 185;
+            this.RefreshWeigh.Tag = "ifread";
+            this.RefreshWeigh.Text = "刷新重量";
+            this.RefreshWeigh.UseVisualStyleBackColor = true;
+            this.RefreshWeigh.Click += new System.EventHandler(this.RefreshWeigh_Click);
+            // 
+            // pr_cartonunit1
+            // 
+            this.pr_cartonunit1.AutoSize = true;
+            this.pr_cartonunit1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pr_cartonunit1.Location = new System.Drawing.Point(77, 122);
+            this.pr_cartonunit1.Name = "pr_cartonunit1";
+            this.pr_cartonunit1.Size = new System.Drawing.Size(20, 21);
+            this.pr_cartonunit1.TabIndex = 184;
+            this.pr_cartonunit1.Tag = "pr_cartonunit";
+            this.pr_cartonunit1.Text = "g";
+            this.pr_cartonunit1.Visible = false;
+            // 
+            // pr_cartonunit
+            // 
+            this.pr_cartonunit.AutoSize = true;
+            this.pr_cartonunit.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pr_cartonunit.Location = new System.Drawing.Point(46, 19);
+            this.pr_cartonunit.Name = "pr_cartonunit";
+            this.pr_cartonunit.Size = new System.Drawing.Size(20, 21);
+            this.pr_cartonunit.TabIndex = 183;
+            this.pr_cartonunit.Text = "g";
+            this.pr_cartonunit.Visible = false;
+            // 
+            // pr_cartonboxgw
+            // 
+            this.pr_cartonboxgw.AutoSize = true;
+            this.pr_cartonboxgw.Font = new System.Drawing.Font("微软雅黑", 25F);
+            this.pr_cartonboxgw.Location = new System.Drawing.Point(12, 159);
+            this.pr_cartonboxgw.Name = "pr_cartonboxgw";
+            this.pr_cartonboxgw.Size = new System.Drawing.Size(0, 45);
+            this.pr_cartonboxgw.TabIndex = 182;
+            // 
+            // label4
+            // 
+            this.label4.AutoSize = true;
+            this.label4.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label4.Location = new System.Drawing.Point(4, 122);
+            this.label4.Name = "label4";
+            this.label4.Size = new System.Drawing.Size(74, 21);
+            this.label4.TabIndex = 181;
+            this.label4.Text = "标准重量";
+            // 
+            // weight
+            // 
+            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(10, 53);
+            this.weight.Name = "weight";
+            this.weight.Size = new System.Drawing.Size(0, 60);
+            this.weight.TabIndex = 180;
+            // 
+            // 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(4, 19);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(42, 21);
+            this.label2.TabIndex = 179;
+            this.label2.Text = "重量";
+            // 
+            // Baurate
+            // 
+            this.Baurate.AutoSize = true;
+            this.Baurate.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.Baurate.Location = new System.Drawing.Point(727, 429);
+            this.Baurate.Name = "Baurate";
+            this.Baurate.Size = new System.Drawing.Size(0, 21);
+            this.Baurate.TabIndex = 176;
+            this.Baurate.Visible = false;
+            // 
+            // ComList
+            // 
+            this.ComList.AutoSize = true;
+            this.ComList.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ComList.Location = new System.Drawing.Point(742, 429);
+            this.ComList.Name = "ComList";
+            this.ComList.Size = new System.Drawing.Size(0, 21);
+            this.ComList.TabIndex = 177;
+            this.ComList.Visible = false;
+            // 
+            // pa_downstatus
+            // 
+            this.pa_downstatus.AutoSize = true;
+            this.pa_downstatus.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pa_downstatus.Location = new System.Drawing.Point(831, 454);
+            this.pa_downstatus.Name = "pa_downstatus";
+            this.pa_downstatus.Size = new System.Drawing.Size(0, 21);
+            this.pa_downstatus.TabIndex = 179;
+            this.pa_downstatus.Visible = false;
+            // 
+            // pa_checkno
+            // 
+            this.pa_checkno.AutoSize = true;
+            this.pa_checkno.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pa_checkno.Location = new System.Drawing.Point(829, 497);
+            this.pa_checkno.Name = "pa_checkno";
+            this.pa_checkno.Size = new System.Drawing.Size(0, 21);
+            this.pa_checkno.TabIndex = 180;
+            this.pa_checkno.Visible = false;
+            // 
+            // pa_sccode
+            // 
+            this.pa_sccode.AutoSize = true;
+            this.pa_sccode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pa_sccode.Location = new System.Drawing.Point(825, 454);
+            this.pa_sccode.Name = "pa_sccode";
+            this.pa_sccode.Size = new System.Drawing.Size(0, 21);
+            this.pa_sccode.TabIndex = 181;
+            this.pa_sccode.Visible = false;
+            // 
+            // pa_standardqty
+            // 
+            this.pa_standardqty.AutoSize = true;
+            this.pa_standardqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pa_standardqty.Location = new System.Drawing.Point(777, 497);
+            this.pa_standardqty.Name = "pa_standardqty";
+            this.pa_standardqty.Size = new System.Drawing.Size(0, 21);
+            this.pa_standardqty.TabIndex = 183;
+            this.pa_standardqty.Visible = false;
+            // 
+            // pr_sendchecktype
+            // 
+            this.pr_sendchecktype.AutoSize = true;
+            this.pr_sendchecktype.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pr_sendchecktype.Location = new System.Drawing.Point(626, 436);
+            this.pr_sendchecktype.Name = "pr_sendchecktype";
+            this.pr_sendchecktype.Size = new System.Drawing.Size(0, 21);
+            this.pr_sendchecktype.TabIndex = 195;
+            this.pr_sendchecktype.Visible = false;
+            // 
+            // mcd_remainqty_label
+            // 
+            this.mcd_remainqty_label.AutoSize = true;
+            this.mcd_remainqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.mcd_remainqty_label.Location = new System.Drawing.Point(440, 468);
+            this.mcd_remainqty_label.Name = "mcd_remainqty_label";
+            this.mcd_remainqty_label.Size = new System.Drawing.Size(74, 21);
+            this.mcd_remainqty_label.TabIndex = 195;
+            this.mcd_remainqty_label.Text = "待采集数";
+            // 
+            // mcd_remainqty
+            // 
+            this.mcd_remainqty.AutoSize = true;
+            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(556, 468);
+            this.mcd_remainqty.Name = "mcd_remainqty";
+            this.mcd_remainqty.Size = new System.Drawing.Size(0, 21);
+            this.mcd_remainqty.TabIndex = 196;
+            // 
+            // mcd_inqty_label
+            // 
+            this.mcd_inqty_label.AutoSize = true;
+            this.mcd_inqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.mcd_inqty_label.Location = new System.Drawing.Point(440, 433);
+            this.mcd_inqty_label.Name = "mcd_inqty_label";
+            this.mcd_inqty_label.Size = new System.Drawing.Size(74, 21);
+            this.mcd_inqty_label.TabIndex = 193;
+            this.mcd_inqty_label.Text = "已采集数";
+            // 
+            // mcd_inqty
+            // 
+            this.mcd_inqty.AutoSize = true;
+            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(556, 433);
+            this.mcd_inqty.Name = "mcd_inqty";
+            this.mcd_inqty.Size = new System.Drawing.Size(0, 21);
+            this.mcd_inqty.TabIndex = 194;
+            // 
+            // pa_remark_label
+            // 
+            this.pa_remark_label.AutoSize = true;
+            this.pa_remark_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pa_remark_label.Location = new System.Drawing.Point(440, 496);
+            this.pa_remark_label.Name = "pa_remark_label";
+            this.pa_remark_label.Size = new System.Drawing.Size(42, 21);
+            this.pa_remark_label.TabIndex = 197;
+            this.pa_remark_label.Text = "备注";
+            // 
+            // pa_remark
+            // 
+            this.pa_remark.AllPower = null;
+            this.pa_remark.BackColor = System.Drawing.Color.White;
+            this.pa_remark.ID = null;
+            this.pa_remark.Location = new System.Drawing.Point(527, 503);
+            this.pa_remark.Margin = new System.Windows.Forms.Padding(2);
+            this.pa_remark.Multiline = true;
+            this.pa_remark.Name = "pa_remark";
+            this.pa_remark.Power = null;
+            this.pa_remark.Size = new System.Drawing.Size(148, 46);
+            this.pa_remark.Str = null;
+            this.pa_remark.Str1 = null;
+            this.pa_remark.Str2 = null;
+            this.pa_remark.TabIndex = 198;
+            this.pa_remark.KeyDown += new System.Windows.Forms.KeyEventHandler(this.pa_remark_KeyDown);
+            // 
+            // CollecRemark
+            // 
+            this.CollecRemark.AutoSize = true;
+            this.CollecRemark.Location = new System.Drawing.Point(527, 558);
+            this.CollecRemark.Name = "CollecRemark";
+            this.CollecRemark.Size = new System.Drawing.Size(96, 16);
+            this.CollecRemark.TabIndex = 202;
+            this.CollecRemark.Text = "采集备注信息";
+            this.CollecRemark.UseVisualStyleBackColor = true;
+            // 
+            // AllowRepeat
+            // 
+            this.AllowRepeat.AutoSize = true;
+            this.AllowRepeat.Location = new System.Drawing.Point(629, 558);
+            this.AllowRepeat.Name = "AllowRepeat";
+            this.AllowRepeat.Size = new System.Drawing.Size(96, 16);
+            this.AllowRepeat.TabIndex = 209;
+            this.AllowRepeat.Text = "允许重复备注";
+            this.AllowRepeat.UseVisualStyleBackColor = true;
+            // 
+            // label6
+            // 
+            this.label6.AutoSize = true;
+            this.label6.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label6.Location = new System.Drawing.Point(438, 527);
+            this.label6.Name = "label6";
+            this.label6.Size = new System.Drawing.Size(37, 20);
+            this.label6.TabIndex = 212;
+            this.label6.Text = "前缀";
+            // 
+            // Remark_PreFix
+            // 
+            this.Remark_PreFix.AllPower = null;
+            this.Remark_PreFix.BackColor = System.Drawing.Color.White;
+            this.Remark_PreFix.Font = new System.Drawing.Font("微软雅黑", 9F);
+            this.Remark_PreFix.ID = null;
+            this.Remark_PreFix.Location = new System.Drawing.Point(476, 526);
+            this.Remark_PreFix.Margin = new System.Windows.Forms.Padding(6, 7, 6, 7);
+            this.Remark_PreFix.Name = "Remark_PreFix";
+            this.Remark_PreFix.Power = null;
+            this.Remark_PreFix.Size = new System.Drawing.Size(43, 23);
+            this.Remark_PreFix.Str = null;
+            this.Remark_PreFix.Str1 = null;
+            this.Remark_PreFix.Str2 = null;
+            this.Remark_PreFix.TabIndex = 211;
+            this.Remark_PreFix.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Remark_PreFix_KeyDown);
+            // 
+            // Packing_PackageCollectionWeigh
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(879, 582);
+            this.Controls.Add(this.label6);
+            this.Controls.Add(this.Remark_PreFix);
+            this.Controls.Add(this.AllowRepeat);
+            this.Controls.Add(this.CollecRemark);
+            this.Controls.Add(this.pa_remark);
+            this.Controls.Add(this.pa_remark_label);
+            this.Controls.Add(this.mcd_remainqty_label);
+            this.Controls.Add(this.mcd_remainqty);
+            this.Controls.Add(this.pr_sendchecktype);
+            this.Controls.Add(this.mcd_inqty_label);
+            this.Controls.Add(this.mcd_inqty);
+            this.Controls.Add(this.pa_standardqty);
+            this.Controls.Add(this.pa_sccode);
+            this.Controls.Add(this.pa_checkno);
+            this.Controls.Add(this.pa_downstatus);
+            this.Controls.Add(this.ComList);
+            this.Controls.Add(this.Baurate);
+            this.Controls.Add(this.groupBoxWithBorder3);
+            this.Controls.Add(this.pa_status);
+            this.Controls.Add(this.pr_packrule);
+            this.Controls.Add(this.groupBoxWithBorder2);
+            this.Controls.Add(this.groupBoxWithBorder1);
+            this.Controls.Add(this.OperateResult);
+            this.Controls.Add(this.pa_id);
+            this.Controls.Add(this.Clean);
+            this.Controls.Add(this.sn_code);
+            this.Controls.Add(this.PackageDetail);
+            this.Controls.Add(this.Cancel);
+            this.Controls.Add(this.label13);
+            this.Controls.Add(this.pa_makecode);
+            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
+            this.Name = "Packing_PackageCollectionWeigh";
+            this.Tag = "Packing!PackageCollectionWeigh";
+            this.Text = "装箱称重";
+            this.Activated += new System.EventHandler(this.Make_PackageCollectionWeigh_Activated);
+            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Make_PackageCollectionWeigh_FormClosing);
+            this.Load += new System.EventHandler(this.Make_PackageCollectionWeigh_Load);
+            this.SizeChanged += new System.EventHandler(this.Make_PackageCollectionWeigh_SizeChanged);
+            ((System.ComponentModel.ISupportInitialize)(this.PackageDetail)).EndInit();
+            this.groupBoxWithBorder1.ResumeLayout(true);
+            this.groupBoxWithBorder1.PerformLayout();
+            this.groupBoxWithBorder2.ResumeLayout(true);
+            this.groupBoxWithBorder2.PerformLayout();
+            this.groupBoxWithBorder3.ResumeLayout(true);
+            this.groupBoxWithBorder3.PerformLayout();
+            this.ResumeLayout(true);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+        private System.Windows.Forms.Label pa_makecode;
+        private System.Windows.Forms.Label label13;
+        private System.Windows.Forms.Label pa_code_label;
+        private System.Windows.Forms.Label PrintList_label;
+        private System.Windows.Forms.Label PrintNum_label;
+        private System.Windows.Forms.CheckBox Cancel;
+
+        private CustomControl.DataGrid_View.DataGridViewWithSerialNum PackageDetail;
+        private CustomControl.TextBoxWithIcon.SnCollectionBox sn_code;
+        private CustomControl.ButtonUtil.NormalButton Clean;
+        private CustomControl.ButtonUtil.NormalButton Printing;
+        private System.Windows.Forms.Label pa_id;
+        private CustomControl.RichText.RichTextAutoBottom OperateResult;
+        private CustomControl.ComBoxWithFocus.PrinterCombox PrintList;
+        private UAS_MES_NEW.CustomControl.ComBoxWithFocus.ComboxWithTip PrintLabel;
+        private System.Windows.Forms.Label label3;
+        private CustomControl.CustomCheckBox.AutoPrintCheckBox AutoPrint;
+        private CustomControl.GroupBoxWithBorder.GroupBoxWithBorder groupBoxWithBorder1;
+        private CustomControl.GroupBoxWithBorder.GroupBoxWithBorder groupBoxWithBorder2;
+        private CustomControl.ButtonUtil.NormalButton Packing;
+        private System.Windows.Forms.CheckBox AutoGenBoxCode;
+        private System.Windows.Forms.Label pr_packrule;
+        private System.Windows.Forms.Label pa_status;
+        private CustomControl.ButtonUtil.NormalButton SendCheck;
+        private System.Windows.Forms.Label ob_batchqty;
+        private System.Windows.Forms.Label ob_nowcheckqty_label;
+        private System.Windows.Forms.Label ob_batchqty_label;
+        private System.Windows.Forms.Label ob_nowcheckqty;
+        private CustomControl.GroupBoxWithBorder.GroupBoxWithBorder groupBoxWithBorder3;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.Label weight;
+        private System.Windows.Forms.Label label4;
+        private System.Windows.Forms.Label pr_cartonboxgw;
+        private System.Windows.Forms.Label Baurate;
+        private System.Windows.Forms.Label ComList;
+        private System.Windows.Forms.Label pr_cartonunit;
+        private System.Windows.Forms.Label pr_cartonunit1;
+        private System.Windows.Forms.Label pa_downstatus;
+        private System.Windows.Forms.Label pa_checkno;
+        private System.Windows.Forms.Label pa_sccode;
+        private System.Windows.Forms.Label pa_currentqty_label;
+        private System.Windows.Forms.Label pr_detail_label;
+        private System.Windows.Forms.Label pa_currentqty;
+        private System.Windows.Forms.Label pr_code_label;
+        private System.Windows.Forms.Label pr_detail;
+        private System.Windows.Forms.Label pr_outboxinnerqty_label;
+        private System.Windows.Forms.Label pr_code;
+        private System.Windows.Forms.Label pa_standardqty;
+        private CustomControl.ButtonUtil.NormalButton DeleteAll;
+        private CustomControl.ValueLabel.ValueLabel checkweightlabel;
+        private System.Windows.Forms.Label label1;
+        private CustomControl.TextBoxWithIcon.EnterTextBox PrintNum;
+        private CustomControl.TextBoxWithIcon.EnterTextBox pr_outboxinnerqty;
+        private System.Windows.Forms.Label OutBoxLength_label;
+        private CustomControl.TextBoxWithIcon.SnCollectionBox OutBoxLength;
+        private CustomControl.ButtonUtil.NormalButton RefreshWeigh;
+        private System.Windows.Forms.Label pr_sendchecktype;
+        private System.Windows.Forms.Label label5;
+        private System.Windows.Forms.Label ms_makecode_label;
+        private System.Windows.Forms.Label ms_salecode;
+        private System.Windows.Forms.Label ms_makecode;
+        private CustomControl.TextBoxWithIcon.SourceStepCount StepCount;
+        private System.Windows.Forms.Label mcd_remainqty_label;
+        private System.Windows.Forms.Label mcd_remainqty;
+        private System.Windows.Forms.Label mcd_inqty_label;
+        private System.Windows.Forms.Label mcd_inqty;
+        private System.Windows.Forms.Label pa_remark_label;
+        private CustomControl.TextBoxWithIcon.EnterTextBox pa_remark;
+        private System.Windows.Forms.CheckBox CollecRemark;
+        private System.Windows.Forms.CheckBox locksalecode;
+        private System.Windows.Forms.Label PreFix_label;
+        private CustomControl.TextBoxWithIcon.SnCollectionBox PreFix;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pd_barcode;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pa_outboxcode1;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pa_prodcode1;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pd_innerqty;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pa_indate;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pd_id;
+        public System.Windows.Forms.Label ob_checkno;
+        public CustomControl.TextBoxWithIcon.SnCollectionBox pa_outboxcode;
+        private System.Windows.Forms.CheckBox AllowRepeat;
+        private System.Windows.Forms.Label label6;
+        private CustomControl.TextBoxWithIcon.SnCollectionBox Remark_PreFix;
+    }
+}

+ 1092 - 0
UAS_MES_ODLF/FunctionCode/Packing/Packing_PackageCollectionWeigh2.cs

@@ -0,0 +1,1092 @@
+using LabelManager2;
+using System;
+using System.Data;
+using System.Text;
+using System.Windows.Forms;
+using UAS_MES_NEW.DataOperate;
+using UAS_MES_NEW.Entity;
+using UAS_MES_NEW.PublicMethod;
+using System.Drawing;
+using System.Threading;
+using UAS_MES_NEW.PublicForm;
+using System.IO.Ports;
+using System.IO;
+using System.Text.RegularExpressions;
+using System.Collections.Generic;
+
+namespace UAS_MES_NEW.Packing
+{
+    public partial class Packing_PackageCollectionWeigh2 : Form
+    {
+        DataHelper dh;
+        DataTable dt;
+        LogStringBuilder sql = new LogStringBuilder();
+        AutoSizeFormClass asc = new AutoSizeFormClass();
+        Document doc;
+        ApplicationClass lbl;
+        Thread thread;
+        DataTable Dbfind;
+        string ErrorMessage = "";
+        string oMakeCode = "";
+        string oMsID = "";
+        string oMsStatus = "";
+        string PR_CHECKCARTONW = "0";
+        //称量的标准重量
+        double Weight;
+        //最大重量
+        double MaxWeight;
+        //最小重量
+        double MinWeight;
+
+        string ActWeigh = "0";
+
+        Regex re = new Regex("\\d+.\\d+\\w+");
+
+        decimal StandardQTY = 0;
+
+        string oOutBoxCode = "";
+        string LastSncode;
+
+
+        //创建串口实例
+        SerialPort serialPort1 = new SerialPort();
+
+        //true的时候表示从串口读取数据
+        bool GetData = true;
+
+        public Packing_PackageCollectionWeigh2()
+        {
+            InitializeComponent();
+        }
+
+        //创建打印进程
+        private void NewPrint()
+        {
+            try
+            {
+                lbl = new ApplicationClass();
+                BaseUtil.WriteLbl();
+            }
+            catch (Exception ex)
+            {
+                OperateResult.AppendText("未正确安装CodeSoft软件\n", Color.Red);
+            }
+        }
+
+        private void Make_PackageCollectionWeigh_Load(object sender, EventArgs e)
+        {
+            ComList.Text = BaseUtil.GetCacheData("PortName").ToString();
+            Baurate.Text = BaseUtil.GetCacheData("BaudRate").ToString();
+            //设置DbFind的必须的数据
+            PrintNum.Text = "1";
+            asc.controllInitializeSize(this);
+            thread = new Thread(NewPrint);
+            SetLoadingWindow stw = new SetLoadingWindow(thread, "初始化打印程序");
+            BaseUtil.SetFormCenter(stw);
+            stw.ShowDialog();
+            try
+            {
+                OutBoxLength.Text = BaseUtil.GetCacheData("OutBoxLength").ToString();
+                PreFix.Text = BaseUtil.GetCacheData("PreFix").ToString();
+                Remark_PreFix.Text = BaseUtil.GetCacheData("Remark_PreFix").ToString();
+            }
+            catch (Exception) { }
+            thread = new Thread(getSerialData);
+            try
+            {
+                GetData = true;
+                serialPort1.PortName = ComList.Text;
+                serialPort1.BaudRate = int.Parse(Baurate.Text);
+                serialPort1.Open();
+                thread.Start();
+            }
+            catch (Exception mes)
+            {
+                if (Baurate.Text == "" || ComList.Text == "")
+                    OperateResult.AppendText(">>请先在电子秤调试界面维护波特率和串口\n", Color.Red);
+                else
+                    OperateResult.AppendText(">>" + mes.Message + "\n", Color.Red);
+            }
+            sn_code.Focus();
+            dh = SystemInf.dh;
+            StepCount.StepCode = User.CurrentStepCode;
+            StepCount.Source = User.UserSourceCode;
+            StepCount.LineCode = User.UserLineCode;
+            StepCount.Dh = dh;
+            StepCount.Start();
+        }
+
+
+        private void getSerialData()
+        {
+            if (serialPort1.IsOpen)
+            {
+                if (!SystemInf.OpenPort.Contains(serialPort1.PortName))
+                {
+                    SystemInf.OpenPort.Add(serialPort1.PortName);
+                    try
+                    {
+                        while (GetData)
+                        {
+                            try
+                            {
+                                weight.Text = re.Match(serialPort1.ReadLine().Trim()).Groups[0].Value;
+                            }
+                            catch (Exception)
+                            {
+                                GetData = false;
+                            }
+                        }
+                    }
+                    catch (IOException ex) { MessageBox.Show(ex.Message); }
+                }
+                else
+                    MessageBox.Show("端口已被占用,请关闭其他窗口");
+            }
+        }
+
+        private void Make_PackageCollectionWeigh_SizeChanged(object sender, EventArgs e)
+        {
+            asc.controlAutoSize(this);
+        }
+
+        private void Make_PackageCollectionWeigh_Activated(object sender, EventArgs e)
+        {
+            pa_outboxcode.Focus();
+        }
+
+        //刷新表单的数据的数据
+        private void LoadData()
+        {
+            //加载表单数据
+            string Err = "";
+            sql.Clear();
+            sql.Append("select pa_prodcode,pr_cartonmaxw,pa_salecode,pa_remark,pa_makecode,pr_cartonunit,pr_code,pr_cartonminw,pr_cartongw,pa_outboxcode,pa_sccode,nvl(pa_downstatus,0) pa_downstatus,pa_checkno,");
+            sql.Append("pa_status,pr_packrule,pr_detail,nvl(pr_sendchecktype,'LineCode')pr_sendchecktype,pa_packageqty,nvl(pa_standardqty,0)pa_standardqty,nvl(pr_outboxinnerqty,0)pr_outboxinnerqty,nvl(PR_CHECKCARTONW,'0') PR_CHECKCARTONW,pa_currentqty from package left join ");
+            sql.Append("product on pa_prodcode=pr_code where pa_outboxcode='" + pa_outboxcode.Text + "'");
+            Err = "箱号";
+            DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+            if (dt.Rows.Count > 0)
+            {
+                //重量的临时变量
+                string _weight = dt.Rows[0]["pr_cartongw"].ToString();
+                string _maxweight = dt.Rows[0]["pr_cartonmaxw"].ToString();
+                string _minweight = dt.Rows[0]["pr_cartonminw"].ToString();
+                PR_CHECKCARTONW = dt.Rows[0]["PR_CHECKCARTONW"].ToString();
+                if (dt.Rows[0]["pa_salecode"].ToString() != "")
+                {
+                    ms_salecode.Text = dt.Rows[0]["pa_salecode"].ToString();
+                }
+                if (PR_CHECKCARTONW != "0")
+                    checkweightlabel.Text = "需要检测重量";
+                else
+                    checkweightlabel.Text = "不需检测重量";
+                //赋值重量单位
+                Weight = double.Parse(_weight == "" ? "0" : _weight);
+                MaxWeight = double.Parse(_maxweight == "" ? "0" : _maxweight);
+                MinWeight = double.Parse(_minweight == "" ? "0" : _minweight);
+                //记录该数据保证在修改不被允许的前提下能偶回复之前的值
+                StandardQTY = decimal.Parse(dt.Rows[0]["pr_outboxinnerqty"].ToString());
+                BaseUtil.SetFormValue(this.Controls, dt);
+                if (pa_standardqty.Text != "0")
+                    pr_outboxinnerqty.Text = pa_standardqty.Text;
+                if (Weight - MinWeight == MaxWeight - Weight)
+                    pr_cartonboxgw.Text = Weight + "±" + (MaxWeight - Weight) + dt.Rows[0]["pr_cartonunit"].ToString();
+                else
+                    pr_cartonboxgw.Text = MinWeight + "-" + MaxWeight + dt.Rows[0]["pr_cartonunit"].ToString();
+            }
+            LoadCheckQTY();
+            LoadCollectedNum();
+        }
+
+        private void LoadGridData()
+        {
+            //加载Grid数据
+            dt = (DataTable)dh.ExecuteSql("select pa_outboxcode,pa_prodcode,pd_barcode,pd_innerqty,pa_indate from packageDetail left join package on pa_id=pd_paid where pa_outboxcode='" + pa_outboxcode.Text + "'", "select");
+            BaseUtil.FillDgvWithDataTable(PackageDetail, dt);
+            //更新界面的采集数量
+            pa_currentqty.Text = dh.getFieldDataByCondition("package", "pa_currentqty", "pa_outboxcode='" + pa_outboxcode.Text + "'").ToString();
+        }
+
+        private void Print_Click(object sender, EventArgs e)
+        {
+            if (PrintLabel.Items.Count != 0)
+            {
+                if (dh.getFieldDataByCondition("package", "pa_status", "pa_outboxcode='" + pa_outboxcode.Text + "'").ToString() == "1")
+                {
+                    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.CodeSoft(Tag.ToString(), ref lbl, 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);
+                    }
+                    else
+                    {
+                        OperateResult.AppendText(ErrorMessage + "\n", Color.Red);
+                    }
+                    if (!AutoGenBoxCode.Checked)
+                    {
+                        pa_outboxcode.Focus();
+                        pa_outboxcode.SelectAll();
+                    }
+                    else
+                    {
+                        sn_code.Focus();
+                        sn_code.SelectAll();
+                    }
+                }
+                else OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "尚未封箱,请封箱后执行打印\n", Color.Red);
+            }
+            else OperateResult.AppendText(">>产品" + pr_code.Text + "未维护打印标签\n", Color.Red);
+        }
+
+        //加载工单信息和装箱明细信息
+        private void pa_code_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.KeyCode == Keys.Enter)
+            {
+                if (CheckOutBoxLength())
+                {
+                    LoadData();
+                    LoadGridData();
+                    sn_code.Focus();
+                }
+            }
+        }
+
+        //输入序列号的回车事件
+        private void barcode_KeyDown(object sender, KeyEventArgs e)
+        {
+            //当用户输入回车键的时候
+            if (e.KeyCode == Keys.Enter)
+            {
+                if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out ErrorMessage))
+                {
+                    dt = (DataTable)dh.ExecuteSql("select ms_sncode from makeserial where ms_imei1='" + sn_code.Text + "' order by ms_id desc", "select");
+                    if (dt.Rows.Count > 0)
+                    {
+                        sn_code.Text = dt.Rows[0]["ms_sncode"].ToString();
+                    }
+                    else
+                    {
+                        dt = (DataTable)dh.ExecuteSql("select ms_sncode from makeserial where ms_imei2='" + sn_code.Text + "' order by ms_id desc", "select");
+                        if (dt.Rows.Count > 0)
+                        {
+                            sn_code.Text = dt.Rows[0]["ms_sncode"].ToString();
+                        }
+                        else
+                        {
+                            dt = (DataTable)dh.ExecuteSql("select mil_sncode from makeimeilist where mil_imei1='" + sn_code.Text + "' order by mil_id desc", "select");
+                            if (dt.Rows.Count > 0)
+                            {
+                                sn_code.Text = dt.Rows[0]["mil_sncode"].ToString();
+                            }
+                            else
+                            {
+                                dt = (DataTable)dh.ExecuteSql("select mil_sncode from makeimeilist where mil_imei2='" + sn_code.Text + "' order by mil_id desc", "select");
+                                if (dt.Rows.Count > 0)
+                                {
+                                    sn_code.Text = dt.Rows[0]["mil_sncode"].ToString();
+                                }
+                            }
+                        }
+                    }
+                    dt = (DataTable)dh.ExecuteSql("select mil_imei1 from Makeimeilist where mil_psn='" + sn_code.Text + "' and mil_makecode='T1030B-1025' order by mil_id desc", "select");
+                    if (dt.Rows.Count > 0)
+                    {
+                        sn_code.Text = dt.Rows[0]["mil_imei1"].ToString();
+                    }
+                    dt = (DataTable)dh.ExecuteSql("select ms_status,ms_id,ms_makecode,ms_craftcode,ms_prodcode from makeserial where ms_sncode ='" + sn_code.Text + "'  order by ms_id desc", "select");
+                    if (LogicHandler.CheckStepSNAndMacode("", User.UserSourceCode, sn_code.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage) || (dt.Rows.Count > 0 && dt.Rows[0]["ms_status"].ToString() == "2"))
+                    {
+                        if (oMsID == "" || oMsID == "null" || oMsID == "0")
+                        {
+                            oMsID = dt.Rows[0]["ms_id"].ToString();
+                            oMsStatus = dt.Rows[0]["ms_status"].ToString();
+                            oMakeCode = dt.Rows[0]["ms_makecode"].ToString();
+                        }
+                        if (oMsStatus == "2")
+                        {
+                            string prodcode = dt.Rows[0]["ms_prodcode"].ToString();
+                            string craftcode = dt.Rows[0]["ms_craftcode"].ToString();
+                            string craftstepcode = dh.getFieldDataByCondition("craft left join craftdetail on cr_id =cd_crid", "cd_stepcode", "cr_prodcode='" + prodcode + "' and cr_code='" + craftcode + "' and cd_stepcode='" + User.CurrentStepCode + "'").ToString();
+                            if (craftstepcode == "")
+                            {
+                                OperateResult.AppendText("工序" + User.CurrentStepCode + "不在途程" + craftcode + "内,不允许采集\n", Color.Red);
+                                return;
+                            }
+                        }
+                        string nextstepcode = dh.getFieldDataByCondition("makeserial", "ms_nextstepcode", "ms_id='" + oMsID + "'").ToString();
+                        if (nextstepcode != "" && nextstepcode != User.CurrentStepCode)
+                        {
+                            OperateResult.AppendText("当前序列号下一道工序为" + nextstepcode + ",当前资源不允许采集\n", Color.Red);
+                            return;
+                        }
+                        //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("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 = "";
+                        string ms_prodcode = "";
+                        string ms_iostatus = "";
+                        string ms_outno = "";
+                        string ms_salecode_text = "";
+                        if (dt.Rows.Count > 0)
+                        {
+                            StandardQTY = decimal.Parse(dt.Rows[0]["pr_outboxinnerqty"].ToString());
+                            ms_makecode = dt.Rows[0]["ms_makecode"].ToString();
+                            ms_prodcode = dt.Rows[0]["ms_prodcode"].ToString();
+                            ms_iostatus = dt.Rows[0]["ms_iostatus"].ToString();
+                            ms_outno = dt.Rows[0]["ms_outno"].ToString();
+                            ms_salecode_text = dt.Rows[0]["ms_salecode"].ToString();
+                            if (locksalecode.Checked && ms_salecode.Text != "" && ms_salecode.Text != ms_salecode_text)
+                            {
+                                OperateResult.AppendText(">>序列号" + sn_code.Text + "所属订单号" + ms_salecode_text + "与界面订单号" + ms_salecode.Text + "不同,无法采集\n", Color.Red, sn_code);
+                                return;
+                            }
+                            BaseUtil.SetFormValue(this.Controls, dt);
+                        }
+                        if (dt.Rows[0]["ms_outno"].ToString() != "")
+                        {
+                            OperateResult.AppendText(">>序列号" + sn_code.Text + "已被出货单" + dt.Rows[0]["ms_outno"].ToString() + "采集,不允许操作\n", Color.Red, sn_code);
+                            return;
+                        }
+                        if (dt.Rows[0]["ms_iostatus"].ToString() != "0")
+                        {
+                            OperateResult.AppendText(">>序列号" + sn_code.Text + "已入库不允许采集\n", Color.Red, sn_code);
+                            return;
+                        }
+                        if (pa_standardqty.Text != "0" && pa_standardqty.Text != "")
+                        {
+                            pr_outboxinnerqty.Text = pa_standardqty.Text;
+                        }
+                        if (pa_outboxcode.Text == "")
+                        {
+                            string boxcode = dh.getFieldDataByCondition("makeserial", "ms_outboxcode", "ms_id='" + oMsID + "'").ToString();
+                            if (boxcode != "")
+                            {
+                                pa_outboxcode.Text = boxcode;
+                                LoadGridData();
+                            }
+                            else
+                            {
+                                if (AutoGenBoxCode.Checked && (pa_status.Text == "1" || pa_status.Text == ""))
+                                {
+                                    pa_outboxcode.Text = LogicHandler.GetOutBoxCode2("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 (pa_outboxcode.Text == "")
+                        {
+                            OperateResult.AppendText(">>箱号不能为空\n", Color.Red, sn_code);
+                            return;
+                        }
+                        //判断箱内总数必须大于0
+                        if (pr_outboxinnerqty.Text == "" || pr_outboxinnerqty.Text == "0")
+                        {
+                            OperateResult.AppendText(">>箱内容量必须大于0\n", Color.Red);
+                            return;
+                        }
+                        sql.Clear();
+                        sql.Append("select nvl(pa_iostatus,0) pa_iostatus,pa_outno,pa_mothercode from package where pa_outboxcode='" + pa_outboxcode.Text + "'");
+                        dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                        string MotherBoxCode = "";
+                        if (dt.Rows.Count > 0)
+                        {
+                            if (dt.Rows[0]["pa_mothercode"].ToString() != "")
+                            {
+                                MotherBoxCode = dt.Rows[0]["pa_mothercode"].ToString();
+                            }
+                            if (dt.Rows[0]["pa_outno"].ToString() != "")
+                            {
+                                OperateResult.AppendText(">>卡通箱" + pa_outboxcode.Text + "已被出货单" + dt.Rows[0]["pa_outno"].ToString() + "采集,不允许操作\n", Color.Red, sn_code);
+                                return;
+                            }
+                            if (dt.Rows[0]["pa_iostatus"].ToString() != "0")
+                            {
+                                OperateResult.AppendText(">>卡通箱" + pa_outboxcode.Text + "处于入库状态,不允许操作\n", Color.Red, sn_code);
+                                return;
+                            }
+                        }
+                        //如果未勾选了取消录入
+                        if (!Cancel.Checked)
+                        {
+                            string ms_outboxcode = dh.getFieldDataByCondition("makeserial", "ms_outboxcode", "ms_id='" + oMsID + "'").ToString();
+                            if (ms_outboxcode != "")
+                            {
+                                if (ms_outboxcode == pa_outboxcode.Text)
+                                    OperateResult.AppendText(">>序列号" + sn_code.Text + "已在本箱内\n", Color.Red, sn_code);
+                                else
+                                    OperateResult.AppendText(">>序列号" + sn_code.Text + "已采集至箱" + ms_outboxcode + "\n", Color.Red, sn_code);
+                                LoadData();
+                            }
+                            else
+                            {
+                                //满箱之后采集下一个之前自动清除内容,生成新的箱号
+                                if ((AutoGenBoxCode.Checked && pa_currentqty.Text != "" && pr_outboxinnerqty.Text == pa_currentqty.Text) || (AutoGenBoxCode.Checked && pa_status.Text == "1"))
+                                {
+                                    pa_currentqty.Text = "";
+                                    pa_outboxcode.Text = "";
+                                    pa_status.Text = "0";
+                                    BaseUtil.CleanDGVData(PackageDetail);
+                                    pa_outboxcode.Text = LogicHandler.GetOutBoxCode2("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 (LogicHandler.Packing(sn_code.Text, pa_outboxcode.Text, AutoGenBoxCode.Checked, "标准", User.UserSourceCode, User.UserCode, pr_outboxinnerqty.Text, Cancel.Checked, out oOutBoxCode, out ErrorMessage))
+                                {
+                                    //提示正确返回时传递的信息
+                                    if (ErrorMessage.Contains("AFTERSUCCESS"))
+                                        OperateResult.AppendText(">>" + ErrorMessage + "\n");
+                                    LoadCheckQTY();
+                                    LoadCollectedNum();
+                                    OperateResult.AppendText(">>序列号" + sn_code.Text + "采集成功!\n", Color.Green);
+                                    LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, oMakeCode, User.UserLineCode, User.UserSourceCode, "卡通箱采集", "卡通箱" + pa_outboxcode.Text + "采集成功", sn_code.Text, "");
+                                    LastSncode = sn_code.Text;
+                                    //满箱更新状态为1
+                                    LoadData();
+                                    dh.ExecuteSql("update packagedetail set pd_innerqty=(select pa_packageqty from package where pa_outboxcode='" + pa_outboxcode.Text + "') where pd_innerboxcode='" + pa_outboxcode.Text + "'", "update");
+                                    //如果母箱号不为空,需要更新总数
+                                    if (MotherBoxCode != "")
+                                    {
+                                        DataTable dt = (DataTable)dh.ExecuteSql("select pa_mothercode,pa_type from package where pa_outboxcode='" + MotherBoxCode + "'", "select");
+                                        if (dt.Rows.Count > 0)
+                                        {
+                                            if (dt.Rows[0]["pa_type"].ToString() == "2")
+                                            {
+                                                string MotherCode2 = dt.Rows[0]["pa_mothercode"].ToString();
+                                                //更新大箱数量
+                                                dh.ExecuteSql("update package set PA_TOTALQTY=(select sum(pd_innerqty) from packagedetail left join package on pa_id=pd_paid where pa_outboxcode='" + MotherBoxCode + "') where pa_outboxcode='" + MotherBoxCode + "'", "update");
+                                                //外层有栈板则更新栈板数量
+                                                if (MotherCode2 != "")
+                                                {
+                                                    dh.ExecuteSql("update packagedetail set pd_innerqty=(select sum(pd_innerqty) from packagedetail where pd_outboxcode='" + MotherBoxCode + "') where pd_innerboxcode='" + MotherBoxCode + "'", "update");
+                                                    dh.ExecuteSql("update package set PA_TOTALQTY=(select sum(pd_innerqty) from packagedetail left join package on pa_id=pd_paid where pa_outboxcode='" + MotherCode2 + "') where pa_outboxcode='" + MotherCode2 + "'", "update");
+                                                }
+                                            }
+                                            if (dt.Rows[0]["pa_type"].ToString() == "3")
+                                            {
+                                                dh.ExecuteSql("update package set PA_TOTALQTY=(select sum(pd_innerqty) from packagedetail left join package on pa_id=pd_paid where pa_outboxcode='" + MotherBoxCode + "') where pa_outboxcode='" + MotherBoxCode + "'", "update");
+                                            }
+                                        }
+                                    }
+                                    //采集完后如果是第一个装的序列号,把序列号的NextStepCode赋值给箱号
+                                    if (pa_currentqty.Text == "1")
+                                    {
+                                        dh.UpdateByCondition("package", "pa_nextstep='" + User.CurrentStepCode + "', PA_CURRENTSTEP = '" + User.CurrentStepCode + "'", "pa_outboxcode='" + pa_outboxcode.Text + "'");
+                                    }
+                                    LoadGridData();
+                                    sn_code.Clear();
+                                    if (int.Parse(pa_currentqty.Text == "" ? "0" : pa_currentqty.Text) == int.Parse(pr_outboxinnerqty.Text))
+                                    {
+                                        ActWeigh = weight.Text == "" ? "0" : weight.Text.Replace("kg", "").Replace("g", "").Trim();
+                                        float weigh = float.Parse(ActWeigh);
+                                        if (PR_CHECKCARTONW != "0")
+                                        {
+                                            if (MinWeight == 0 || MaxWeight == 0)
+                                            {
+                                                OperateResult.AppendText(">>产品" + pr_code.Text + "未维护卡通箱重量范围\n", Color.Red);
+                                                return;
+                                            }
+                                            if (!(weigh >= MinWeight && weigh <= MaxWeight) || weigh == 0)
+                                            {
+                                                OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "重量不符合标准重量\n", Color.Red);
+                                                LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, pa_makecode.Text, User.UserLineCode, User.UserSourceCode, "卡通箱称重", "称量不符合要求:" + weight.Text.Trim(), pa_outboxcode.Text, "");
+                                                LogicHandler.RecordProdWeight(pa_outboxcode.Text, "CARTON", float.Parse(ActWeigh.ToString()), "kg", User.UserLineCode, pr_code.Text, User.UserSourceCode, User.UserName);
+                                                return;
+                                            }
+                                        }
+                                        dh.UpdateByCondition("package", "pa_status=1,pa_totalqty=pa_currentqty,pa_packageqty=pa_currentqty,pa_weight=" + weigh + "", "pa_outboxcode='" + pa_outboxcode.Text + "'");
+                                        pa_standardqty.Text = "";
+                                        pa_status.Text = "1";
+                                        OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "满箱封箱成功\n", Color.Green);
+                                        LogicHandler.RecordProdWeight(pa_outboxcode.Text, "CARTON", float.Parse(ActWeigh.ToString()), "kg", User.UserLineCode, pr_code.Text, User.UserSourceCode, User.UserName);
+                                        LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, pa_makecode.Text, User.UserLineCode, User.UserSourceCode, "卡通箱称重", "称量完成:" + weight.Text.Trim(), pa_outboxcode.Text, "");
+                                        if (LogicHandler.OutBoxStepPass(pa_outboxcode.Text, ms_makecode, User.UserSourceCode, User.UserCode, "卡通箱:" + pa_outboxcode.Text + "整箱过站", "卡通箱整箱过站", out ErrorMessage))
+                                        {
+                                            dh.UpdateByCondition("package", "pa_nextstep='" + dh.getFieldDataByCondition("packagedetail left join makeserial on ms_sncode=pd_barcode and ms_makecode=pd_makecode", "max(ms_nextstepcode)", "pd_outboxcode='" + pa_outboxcode.Text + "'").ToString() + "', PA_CURRENTSTEP = '' ", "pa_outboxcode='" + pa_outboxcode.Text + "'");
+                                        }
+                                        else
+                                        {
+                                            OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
+                                        }
+                                        LoadCheckQTY();
+                                        LoadCollectedNum();
+                                        OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "称量完成\n", Color.Green);
+                                        if (AutoPrint.Checked)
+                                            Print_Click(new object(), new EventArgs());
+                                        if (!CollecRemark.Checked)
+                                        {
+                                            if (!AutoGenBoxCode.Checked)
+                                            {
+                                                pa_outboxcode.Focus();
+                                                pa_outboxcode.SelectAll();
+                                            }
+                                            else
+                                            {
+                                                sn_code.Focus();
+                                                sn_code.SelectAll();
+                                            }
+                                        }
+                                        else
+                                        {
+                                            pa_remark.SelectAll();
+                                            pa_remark.Focus();
+                                        }
+                                    }
+                                }
+                                else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
+                            }
+                        }
+                        //勾选了取消箱号先验证箱号存不存在,存在的话移除掉,重新加载一次数据
+                        else
+                        {
+                            if (LogicHandler.Packing(sn_code.Text, pa_outboxcode.Text, AutoGenBoxCode.Checked, "标准", User.UserSourceCode, User.UserCode, pr_outboxinnerqty.Text, Cancel.Checked, out oOutBoxCode, out ErrorMessage))
+                            {
+                                dh.UpdateByCondition("makeserial", "ms_outboxcode=''", "ms_id='" + oMsID + "'");
+                                dh.ExecuteSql("update packagedetail set pd_innerqty=(select pa_packageqty from package where pa_outboxcode='" + pa_outboxcode.Text + "') where pd_innerboxcode='" + pa_outboxcode.Text + "'", "update");
+                                //如果母箱号不为空,需要更新总数
+                                if (MotherBoxCode != "")
+                                {
+                                    DataTable dt = (DataTable)dh.ExecuteSql("select pa_mothercode,pa_type from package where pa_outboxcode='" + MotherBoxCode + "'", "select");
+                                    if (dt.Rows.Count > 0)
+                                    {
+                                        if (dt.Rows[0]["pa_type"].ToString() == "2")
+                                        {
+                                            string MotherCode2 = dt.Rows[0]["pa_mothercode"].ToString();
+                                            //更新大箱数量
+                                            dh.ExecuteSql("update package set PA_TOTALQTY=(select sum(pd_innerqty) from packagedetail left join package on pa_id=pd_paid where pa_outboxcode='" + MotherBoxCode + "') where pa_outboxcode='" + MotherBoxCode + "'", "update");
+                                            //外层有栈板则更新栈板数量
+                                            if (MotherCode2 != "")
+                                            {
+                                                dh.ExecuteSql("update packagedetail set pd_innerqty=(select sum(pd_innerqty) from packagedetail where pd_outboxcode='" + MotherBoxCode + "') where pd_innerboxcode='" + MotherBoxCode + "'", "update");
+                                                dh.ExecuteSql("update package set PA_TOTALQTY=(select sum(pd_innerqty) from packagedetail left join package on pa_id=pd_paid where pa_outboxcode='" + MotherCode2 + "') where pa_outboxcode='" + MotherCode2 + "'", "update");
+                                            }
+                                        }
+                                        if (dt.Rows[0]["pa_type"].ToString() == "3")
+                                        {
+                                            dh.ExecuteSql("update package set PA_TOTALQTY=(select sum(pd_innerqty) from packagedetail left join package on pa_id=pd_paid where pa_outboxcode='" + MotherBoxCode + "') where pa_outboxcode='" + MotherBoxCode + "'", "update");
+                                        }
+                                    }
+                                }
+                                LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, oMakeCode, User.UserLineCode, User.UserSourceCode, "卡通箱采集", "卡通箱" + pa_outboxcode.Text + "取消采集成功", sn_code.Text, "");
+                                LoadGridData();
+                                pa_status.Text = "0";
+                                OperateResult.AppendText(">>已从该箱中移除序列号" + sn_code.Text + "\n", Color.Green, sn_code);
+                            }
+                            else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, sn_code);
+                        }
+                    }
+                    else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, sn_code);
+                }
+                else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, sn_code);
+            }
+        }
+
+        private void Clean_Click(object sender, EventArgs e)
+        {
+            OperateResult.Clear();
+        }
+
+        private void pr_code_TextChanged(object sender, EventArgs e)
+        {
+            LoadCheckQTY();
+            dt = (DataTable)dh.ExecuteSql("select la_id,substr(la_url,instr(la_url,'\\',-1)+1)la_name,la_url,la_isdefault from label where la_prodcode='" + pr_code.Text + "' and la_templatetype='卡通箱标' and la_statuscode='AUDITED' order by la_isdefault", "select");
+            PrintLabel.DataSource = dt;
+            PrintLabel.DisplayMember = "la_url";
+            PrintLabel.ValueMember = "la_id";
+        }
+
+        private void Make_PackageCollectionWeigh_FormClosing(object sender, FormClosingEventArgs e)
+        {
+            BaseUtil.ClosePrint(lbl);
+            if (serialPort1.IsOpen)
+            {
+                GetData = false;
+                serialPort1.Close();
+                SystemInf.OpenPort.Remove(serialPort1.PortName);
+                thread.Interrupt();
+            }
+            //thread.Abort();
+        }
+
+        private void Packing_Click(object sender, EventArgs e)
+        {
+            if (dh.CheckExist("package", "pa_outboxcode='" + pa_outboxcode.Text + "' and nvl(pa_status,0)=0"))
+            {
+                string Seal = MessageBox.Show(this.ParentForm, "是否确认封箱?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
+                if (Seal == "Yes")
+                {
+                    ActWeigh = weight.Text == "" ? "0" : weight.Text.Replace("kg", "").Replace("g", "").Trim();
+                    float weigh = float.Parse(ActWeigh);
+                    if (PR_CHECKCARTONW != "0" && pa_standardqty.Text == pa_currentqty.Text)
+                    {
+                        if (!(weigh >= MinWeight && weigh <= MaxWeight) || weigh == 0)
+                        {
+                            OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "重量不符合标准重量,不能完成工序过站\n", Color.Red);
+                            LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, pa_makecode.Text, User.UserLineCode, User.UserSourceCode, "卡通箱称重", "称量不符合要求:" + weight.Text.Trim(), pa_outboxcode.Text, "");
+                            LogicHandler.RecordProdWeight(pa_outboxcode.Text, "CARTON", float.Parse(ActWeigh.ToString()), "kg", User.UserLineCode, pr_code.Text, User.UserSourceCode, User.UserName);
+                            return;
+                        }
+                    }
+                    dh.UpdateByCondition("package", "pa_status=1,pa_totalqty=pa_currentqty,pa_packageqty=pa_currentqty,pa_weight=" + weigh + "", "pa_outboxcode='" + pa_outboxcode.Text + "'");
+                    pa_status.Text = "1";
+                    pa_standardqty.Text = "";
+                    LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, pa_makecode.Text, User.UserLineCode, User.UserSourceCode, "卡通箱采集", "封箱成功", pa_outboxcode.Text, "");
+                    OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "封箱成功\n", Color.Green);
+                    LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, pa_makecode.Text, User.UserLineCode, User.UserSourceCode, "卡通箱称重", "称量完成:" + weight.Text.Trim(), pa_outboxcode.Text, "");
+                    LogicHandler.RecordProdWeight(pa_outboxcode.Text, "CARTON", float.Parse(ActWeigh.ToString()), "kg", User.UserLineCode, pr_code.Text, User.UserSourceCode, User.UserName);
+                    string ms_makecode = dh.getFieldDataByCondition("packagedetail", "pd_makecode", "pd_outboxcode = '" + pa_outboxcode.Text + "'").ToString();
+                    if (LogicHandler.OutBoxStepPass(pa_outboxcode.Text, ms_makecode, User.UserSourceCode, User.UserCode, "卡通箱:" + pa_outboxcode.Text + "整箱过站", "卡通箱整箱过站", out ErrorMessage))
+                    {
+                        dh.UpdateByCondition("package", "pa_nextstep='" + dh.getFieldDataByCondition("packagedetail left join makeserial on ms_sncode=pd_barcode and ms_makecode=pd_makecode", "max(ms_nextstepcode)", "pd_outboxcode='" + pa_outboxcode.Text + "'").ToString() + "', PA_CURRENTSTEP = '' ", "pa_outboxcode='" + pa_outboxcode.Text + "'");
+                    }
+                    else
+                    {
+                        OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
+                    }
+                    LoadCheckQTY();
+                    if (!CollecRemark.Checked)
+                    {
+                        if (!AutoGenBoxCode.Checked)
+                        {
+                            pa_outboxcode.Focus();
+                            pa_outboxcode.SelectAll();
+                        }
+                        else
+                        {
+                            sn_code.Focus();
+                            sn_code.SelectAll();
+                        }
+                    }
+                    else
+                    {
+                        pa_remark.SelectAll();
+                        pa_remark.Focus();
+                    }
+                }
+            }
+            else OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "错误或者已封箱\n", Color.Red);
+        }
+
+        private void SendCheck_Click(object sender, EventArgs e)
+        {
+            if (dh.getFieldDataByCondition("package", "pa_status", "pa_outboxcode='" + pa_outboxcode.Text + "'").ToString() == "1")
+            {
+                DataTable dt = (DataTable)dh.ExecuteSql("select wm_concat(pa_outboxcode) pa_outboxcode from package where pa_checkno='" + ob_checkno.Text + "' and pa_status=0 ", "select");
+                if (dt.Rows[0][0].ToString() != "")
+                {
+                    OperateResult.AppendText(">>批次" + ob_checkno.Text + "存在箱号" + dt.Rows[0][0].ToString() + "未封箱,请先进行封箱\n", Color.Red);
+                    return;
+                }
+                sql.Clear();
+                sql.Append("update oqcbatch set ob_status='UNCHECK',ob_breakingdate=sysdate where ob_checkno ='" + ob_checkno.Text + "'");
+                dh.ExecuteSql(sql.GetString(), "select");
+                ob_nowcheckqty.Text = "";
+                ob_batchqty.Text = "";
+                ob_nowcheckqty.ForeColor = Color.Black;
+                SendCheck.Enabled = false;
+                OperateResult.AppendText(">>批次" + ob_checkno.Text + "送检成功\n", Color.Green);
+                LogicHandler.InsertMakeProcess(LastSncode, oMakeCode, User.UserSourceCode, "手动送检", "手动送检成功", User.UserCode);
+                //记录操作日志
+                LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, pa_makecode.Text, User.UserLineCode, User.UserSourceCode, "手动送检", "手动送检成功", "", ob_checkno.Text);
+                ob_checkno.Text = "";
+            }
+            else OperateResult.AppendText(">>必须封箱才能送检\n", Color.Red);
+        }
+
+        bool AutoCut;
+
+        private void LoadCheckQTY()
+        {
+            sql.Clear();
+            string condition = "";
+            int nowcheckqty = int.Parse(ob_nowcheckqty.Text == "" ? "0" : ob_nowcheckqty.Text);
+            int batchqty = int.Parse(ob_batchqty.Text == "" ? "0" : ob_batchqty.Text);
+            if (nowcheckqty + 1 == batchqty && AutoCut)
+            {
+                condition = "and ob_status='UNCHECK' and ob_checkno='" + ob_checkno.Text + "'";
+            }
+            else
+            {
+                condition = "and ob_status='ENTERING' ";
+            }
+            if (pr_sendchecktype.Text == "SaleCode")
+            {
+                condition += " and ob_salecode='" + ms_salecode.Text + "'";
+            }
+            sql.Append("select ob_batchqty,ob_nowcheckqty,ob_checkno from oqcbatch where ");
+            sql.Append("ob_linecode='" + User.UserLineCode + "' and ob_prodcode='" + pr_code.Text + "' and ");
+            sql.Append("ob_stepcode='" + User.CurrentStepCode + "' " + condition);
+            DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+            if (dt.Rows.Count > 0)
+            {
+                ob_batchqty.Text = dt.Rows[0]["ob_batchqty"].ToString();
+                ob_nowcheckqty.Text = dt.Rows[0]["ob_nowcheckqty"].ToString();
+                ob_checkno.Text = dt.Rows[0]["ob_checkno"].ToString();
+                nowcheckqty = int.Parse(ob_nowcheckqty.Text == "" ? "0" : ob_nowcheckqty.Text);
+                batchqty = int.Parse(ob_batchqty.Text == "" ? "0" : ob_batchqty.Text);
+                if (nowcheckqty >= batchqty)
+                {
+                    ob_nowcheckqty.ForeColor = Color.Red;
+                    OperateResult.AppendText(">>当前采集数量已达到送检数量\n", Color.Red);
+                    if (AutoCut)
+                    {
+                        OperateResult.AppendText(">>批次" + ob_checkno.Text + "自动断批\n", Color.Green);
+                    }
+                }
+            }
+            else
+            {
+                ob_batchqty.Text = "";
+                ob_nowcheckqty.Text = "";
+                ob_checkno.Text = "";
+                SendCheck.Enabled = false;
+            }
+            if (ob_batchqty.Text != "")
+            {
+                SendCheck.Enabled = true;
+            }
+            else
+            {
+                SendCheck.Enabled = false;
+            }
+        }
+
+        private void ob_checkno_TextChanged(object sender, EventArgs e)
+        {
+            if (ob_checkno.Text != "")
+            {
+                string Cut = dh.getFieldDataByCondition("product left join oqcbatch on ob_prodcode=pr_code", "pr_ifautocutcheckno", "ob_checkno='" + ob_checkno.Text + "'").ToString();
+                if (Cut == "" || Cut == "0")
+                    AutoCut = false;
+                else
+                    AutoCut = true;
+                SendCheck.Enabled = true;
+            }
+        }
+
+        private void PrintLabel_SelectedValueChanged(object sender, EventArgs e)
+        {
+            if (PrintLabel.SelectedValue != null && PrintLabel.SelectedValue.ToString() != "System.Data.DataRowView")
+            {
+                string PrintNums = dh.getFieldDataByCondition("label", "la_printnos", "la_id='" + PrintLabel.SelectedValue.ToString() + "'").ToString();
+                PrintNum.Text = (PrintNums == "" ? "1" : PrintNums);
+            }
+        }
+
+        private void DeleteAll_Click(object sender, EventArgs e)
+        {
+            if (pa_outboxcode.Text == "")
+            {
+                OperateResult.AppendText(">>箱号不能为空\n", Color.Red);
+                return;
+            }
+            string Delete = MessageBox.Show(this.ParentForm, "是否确认拆箱?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
+            if (Delete == "Yes")
+            {
+                DataTable dt = (DataTable)dh.ExecuteSql("select nvl(pa_iostatus,0) pa_iostatus,pa_outno,pa_checkno,ob_status,pa_mothercode,nvl(pa_downstatus,0)pa_downstatus from package left join oqcbatch on pa_checkno=ob_checkno where pa_outboxcode='" + pa_outboxcode.Text + "'", "select");
+                if (dt.Rows.Count > 0)
+                {
+                    if (dt.Rows[0]["pa_outno"].ToString() != "")
+                    {
+                        OperateResult.AppendText(">>卡通箱" + pa_outboxcode.Text + "已被出货单" + dt.Rows[0]["pa_outno"].ToString() + "采集,不允许操作\n", Color.Red);
+                        return;
+                    }
+                    if (dt.Rows[0]["pa_iostatus"].ToString() != "0")
+                    {
+                        OperateResult.AppendText(">>卡通箱" + pa_outboxcode.Text + "处于入库状态,不允许操作\n", Color.Red);
+                        return;
+                    }
+                    if (dt.Rows[0]["pa_mothercode"].ToString() == "")
+                    {
+                        if (dt.Rows[0]["pa_downstatus"].ToString() == "0")
+                        {
+                            string ob_status = dt.Rows[0]["ob_status"].ToString();
+                            string pa_checkno = dt.Rows[0]["pa_checkno"].ToString();
+                            //不存在抽检批次或者还未检验可以拆解
+                            if (ob_status == "" || ob_status == "ENTERING" || ob_status == "UNCHECK")
+                            {
+                                sql.Clear();
+                                sql.Append("select pd_makecode,count(1) num from packagedetail left join makeserial  ");
+                                sql.Append("on ms_sncode=pd_barcode and ms_makecode=pd_makecode where pd_outboxcode='" + pa_outboxcode.Text + "' group by pd_makecode");
+                                dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                                List<string> SQLS1 = new List<string>();
+                                for (int i = 0; i < dt.Rows.Count; i++)
+                                {
+                                    string ma_code = dt.Rows[i]["pd_makecode"].ToString();
+                                    string num = dt.Rows[i]["num"].ToString();
+                                    SQLS1.Add("delete from makeprocess where mp_sncode in (select ms_sncode from makeserial where ms_outboxcode='" + pa_outboxcode.Text + "' and ms_makecode='" + ma_code + "') and mp_makecode='" + ma_code + "' and mp_stepcode='" + User.CurrentStepCode + "'");
+                                    SQLS1.Add("delete from steppassed where sp_sncode in (select ms_sncode from makeserial where ms_outboxcode='" + pa_outboxcode.Text + "' and ms_makecode='" + ma_code + "') and sp_makecode='" + ma_code + "' and sp_stepcode='" + User.CurrentStepCode + "'");
+                                    SQLS1.Add("update makecraftdetail set mcd_inqty=mcd_inqty-" + num + ",mcd_outqty=mcd_outqty-" + num + ",mcd_okqty=mcd_okqty-" + num + " where mcd_macode='" + ma_code + "' and mcd_stepcode='" + User.CurrentStepCode + "'");
+                                    //扣减已完工数
+                                    SQLS1.Add("update make set ma_madeqty=ma_madeqty-(select count(1) from makeserial where  ms_outboxcode='" + pa_outboxcode.Text + "' and ms_makecode='" + ma_code + "' and ms_status=2) where ma_code='" + ma_code + "'");
+                                }
+                                if (pa_checkno != "")
+                                {
+                                    SQLS1.Add("update makeserial set ms_checkno='' where ms_outboxcode='" + pa_outboxcode.Text + "'");
+                                    SQLS1.Add("update oqcbatch set ob_nowcheckqty=ob_nowcheckqty-(select count(1) from oqcbatchdetail where obd_outboxcode='" + pa_outboxcode.Text + "') where ob_checkno='" + pa_checkno + "'");
+                                    SQLS1.Add("delete from oqcbatchdetail where obd_outboxcode='" + pa_outboxcode.Text + "'");
+                                }
+                                //更新序列号状态
+                                SQLS1.Add("update makeserial set ms_status=1,ms_outboxcode='',ms_nextstepcode= (case when ms_nextstepcode='" + User.CurrentStepCode + "' then ms_nextstepcode else ms_stepcode end ),ms_paststep=replace(ms_paststep,'," + User.CurrentStepCode + "','') where ms_outboxcode='" + pa_outboxcode.Text + "'");
+                                //抽检批次不为空的时候进行移除
+                                dh.ExecuteSQLTran(SQLS1.ToArray());
+                                string prcode = dh.getFieldDataByCondition("packagedetail", "pd_prodcode", "pd_outboxcode = '" + pa_outboxcode.Text + "'").ToString();
+                                string standqty = dh.getFieldDataByCondition("product", "pr_outboxinnerqty", "pr_code = '" + prcode + "'").ToString();
+                                if (standqty != "")
+                                {
+                                    //置空原箱
+                                    dh.ExecuteSql("update package set pa_checkno='',pa_prodcode='',pa_packtype='',pa_salecode='',pa_packageqty=0,pa_totalqty=0,pa_currentqty=0,pa_status=0,PA_STANDARDQTY = '" + standqty + "' where pa_outboxcode='" + pa_outboxcode.Text + "'", "update");
+                                }
+                                else
+                                    //置空原箱
+                                    dh.ExecuteSql("update package set pa_checkno='',pa_prodcode='',pa_packtype='',pa_salecode='',pa_packageqty=0,pa_totalqty=0,pa_currentqty=0,pa_status=0 where pa_outboxcode='" + pa_outboxcode.Text + "'", "update");
+                                pa_status.Text = "0";
+                                //删除箱的明细
+                                dh.ExecuteSql("delete from packagedetail where pd_outboxcode='" + pa_outboxcode.Text + "'", "delete");
+                                LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, pa_makecode.Text, User.UserLineCode, User.UserSourceCode, "卡通箱拆解", "成功", pa_outboxcode.Text, ob_checkno.Text);
+                                OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "成功拆解!\n", Color.Green);
+                                LoadGridData();
+                                LoadCheckQTY();
+                            }
+                            else OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "已送检,不允许解除\n", Color.Red);
+                        }
+                        else OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "已下地,不允许解除\n", Color.Red);
+                    }
+                    else OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "已装箱" + dt.Rows[0]["pa_mothercode"].ToString() + ",不允许解除\n", Color.Red);
+                }
+                else OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "不存在\n", Color.Red);
+            }
+        }
+
+        private void OutBoxLength_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.KeyCode == Keys.Enter)
+            {
+                try
+                {
+                    if (OutBoxLength.Text != "")
+                    {
+                        int.Parse(OutBoxLength.Text);
+                    }
+                    BaseUtil.SetCacheData("OutBoxLength", OutBoxLength.Text);
+                    if (!AutoGenBoxCode.Checked)
+                    {
+                        pa_outboxcode.Focus();
+                        pa_outboxcode.SelectAll();
+                    }
+                    else
+                    {
+                        sn_code.Focus();
+                    }
+                }
+                catch (Exception)
+                {
+                    OutBoxLength.Clear();
+                    MessageBox.Show("请输入正确的长度");
+                }
+            }
+        }
+
+        private bool CheckOutBoxLength()
+        {
+            //勾选了检验长度进行校验
+            if (OutBoxLength.Text != "")
+            {
+                try
+                {
+                    int.Parse(OutBoxLength.Text);
+                }
+                catch (Exception)
+                {
+                    MessageBox.Show("请填写正确的箱号长度");
+                    return false;
+                }
+                if (pa_outboxcode.Text.Length != int.Parse(OutBoxLength.Text))
+                {
+                    OperateResult.AppendText(">>箱号长度错误,请重新输入箱号\n", Color.Red);
+                    return false;
+                }
+            }
+            if (PreFix.Text != "")
+            {
+                try
+                {
+                    if (pa_outboxcode.Text.Substring(0, PreFix.Text.Length) != PreFix.Text)
+                    {
+                        OperateResult.AppendText(">>箱号前缀不匹配,请重新输入箱号\n", Color.Red);
+                        return false;
+                    }
+                }
+                catch (Exception)
+                {
+                    OperateResult.AppendText(">>箱号前缀不匹配,请重新输入箱号\n", Color.Red);
+                    return false;
+                }
+            }
+            return true;
+        }
+
+        private void RefreshWeigh_Click(object sender, EventArgs e)
+        {
+            string prcode = dh.getFieldDataByCondition("packagedetail", "pd_prodcode", "pd_outboxcode = '" + pa_outboxcode.Text + "'").ToString();
+            sql.Clear();
+            sql.Append("select pr_cartonmaxw,pr_cartonunit,pr_cartonminw,pr_cartongw from product where pr_code='" + prcode + "'");
+            DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+            if (dt.Rows.Count > 0)
+            {
+                //重量的临时变量
+                string _weight = dt.Rows[0]["pr_cartongw"].ToString();
+                string _maxweight = dt.Rows[0]["pr_cartonmaxw"].ToString();
+                string _minweight = dt.Rows[0]["pr_cartonminw"].ToString();
+                Weight = double.Parse(_weight == "" ? "0" : _weight);
+                MaxWeight = double.Parse(_maxweight == "" ? "0" : _maxweight);
+                MinWeight = double.Parse(_minweight == "" ? "0" : _minweight);
+                if (Weight - MinWeight == MaxWeight - Weight)
+                    pr_cartonboxgw.Text = Weight + "±" + (MaxWeight - Weight) + dt.Rows[0]["pr_cartonunit"].ToString();
+                else
+                    pr_cartonboxgw.Text = MinWeight + "-" + MaxWeight + dt.Rows[0]["pr_cartonunit"].ToString();
+            }
+        }
+
+        private void LoadCollectedNum()
+        {
+            dt = (DataTable)dh.ExecuteSql("select mcd_inqty,ma_qty-mcd_inqty mcd_remainqty from make left join makecraftdetail on mcd_macode=ma_code where ma_code='" + ms_makecode.Text + "' and mcd_stepcode='" + User.CurrentStepCode + "'", "select");
+            BaseUtil.SetFormValue(Controls, dt);
+        }
+
+        private void pa_remark_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (Keys.Enter == e.KeyCode)
+            {
+                if (dh.CheckExist("package", "pa_outboxcode='" + pa_outboxcode.Text + "'"))
+                {
+                    if (Remark_PreFix.Text != "")
+                    {
+                        try
+                        {
+                            if (pa_remark.Text.Substring(0, Remark_PreFix.Text.Length) != Remark_PreFix.Text)
+                            {
+                                OperateResult.AppendText(">>备注前缀不匹配,请重新输入备注信息\n", Color.Red);
+                                return;
+                            }
+                        }
+                        catch (Exception)
+                        {
+                            OperateResult.AppendText(">>备注前缀不匹配,请重新输入备注信息\n", Color.Red);
+                            return;
+                        }
+                    }
+                    if (!AllowRepeat.Checked)
+                    {
+                        DataTable dt = (DataTable)dh.ExecuteSql("select pa_outboxcode from package where pa_remark='" + pa_remark.Text.ToUpper() + "'", "select");
+                        if (dt.Rows.Count > 0)
+                        {
+                            OperateResult.AppendText(">>箱号" + dt.Rows[0][0].ToString() + "已采集关联信息" + pa_remark.Text + "\n", Color.Red);
+                            return;
+                        }
+                    }
+                    dh.UpdateByCondition("package", "pa_remark='" + pa_remark.Text.ToUpper() + "'", "pa_outboxcode='" + pa_outboxcode.Text + "'");
+                    OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "关联信息" + pa_remark.Text + "采集成功\n", Color.Green);
+                    pa_remark.Text = "";
+                    if (!AutoGenBoxCode.Checked)
+                    {
+                        pa_outboxcode.SelectAll();
+                        pa_outboxcode.Focus();
+                    }
+                    else
+                    {
+                        sn_code.Focus();
+                    }
+                }
+                else OperateResult.AppendText(">>请先采集箱内数据\n", Color.Red);
+            }
+        }
+
+        private void PreFix_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.KeyCode == Keys.Enter)
+            {
+                BaseUtil.SetCacheData("PreFix", PreFix.Text);
+                if (!AutoGenBoxCode.Checked)
+                {
+                    pa_outboxcode.Focus();
+                    pa_outboxcode.SelectAll();
+                }
+                else
+                {
+                    sn_code.Focus();
+                }
+            }
+        }
+
+        private void Remark_PreFix_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.KeyCode == Keys.Enter)
+            {
+                BaseUtil.SetCacheData("Remark_PreFix", Remark_PreFix.Text);
+                if (CollecRemark.Checked)
+                {
+                    pa_remark.SelectAll();
+                    pa_remark.Focus();
+                }
+            }
+        }
+
+        private bool CheckOutBoxLength(string ms_salecode_text)
+        {
+            if (AutoGenBoxCode.Checked)
+            {
+                if (ms_salecode_text != "")
+                {
+                    DataTable dt = (DataTable)dh.ExecuteSql(" select pn_number,pn_id,pn_caller,pn_numberlength,pn_leadcode  from PACKAGENUMBER where pn_caller='" + ms_salecode_text + "'", "select");
+                    if (dt.Rows.Count > 0)
+                    {
+                        string pn_leadcode = dt.Rows[0]["pn_leadcode"].ToString();
+                        int pn_numberlength = int.Parse(dt.Rows[0]["pn_numberlength"].ToString());
+                        if (OutBoxLength.Text != (pn_leadcode.Length + pn_numberlength).ToString())
+                        {
+                            OutBoxLength.Text = (pn_leadcode.Length + pn_numberlength).ToString();
+                            BaseUtil.SetCacheData("OutBoxLength", OutBoxLength.Text);
+                        }
+                        if (PreFix.Text != pn_leadcode)
+                        {
+                            PreFix.Text = pn_leadcode;
+                            BaseUtil.SetCacheData("PreFix", PreFix.Text);
+                        }
+                    }
+                    else
+                    {
+                        OperateResult.AppendText(">>订单号" + ms_salecode_text + "未维护箱号规则\n", Color.Black);
+                    }
+                }
+                return true;
+            }
+            return CheckOutBoxLength();
+        }
+
+        private void AutoGenBoxCode_CheckedChanged(object sender, EventArgs e)
+        {
+            if (AutoGenBoxCode.Checked)
+            {
+                OutBoxLength.Enabled = false;
+                PreFix.Enabled = false;
+                pa_outboxcode.Enabled = false;
+            }
+            else
+            {
+                OutBoxLength.Enabled = true;
+                PreFix.Enabled = true;
+                pa_outboxcode.Enabled = true;
+            }
+        }
+    }
+}

+ 367 - 0
UAS_MES_ODLF/FunctionCode/Packing/Packing_PackageCollectionWeigh2.resx

@@ -0,0 +1,367 @@
+<?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="Printing.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="Printing.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="Printing.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="Clean.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="Clean.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="Clean.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="pd_barcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="pa_outboxcode1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="pa_prodcode1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="pd_innerqty.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="pa_indate.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="pd_id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <data name="DeleteAll.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="DeleteAll.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="DeleteAll.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="SendCheck.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="SendCheck.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="SendCheck.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="Packing.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="Packing.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="Packing.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="RefreshWeigh.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="RefreshWeigh.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="RefreshWeigh.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>

+ 9 - 0
UAS_MES_ODLF/UAS_MES_ODLF.csproj

@@ -763,6 +763,12 @@
     <Compile Include="FunctionCode\Packing\Packing_PackageCollection.Designer.cs">
       <DependentUpon>Packing_PackageCollection.cs</DependentUpon>
     </Compile>
+    <Compile Include="FunctionCode\Packing\Packing_PackageCollectionWeigh2.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="FunctionCode\Packing\Packing_PackageCollectionWeigh2.Designer.cs">
+      <DependentUpon>Packing_PackageCollectionWeigh2.cs</DependentUpon>
+    </Compile>
     <Compile Include="FunctionCode\Packing\Packing_PackageCollectionWeigh.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -1466,6 +1472,9 @@
     <EmbeddedResource Include="FunctionCode\Packing\Packing_PackageCollection.resx">
       <DependentUpon>Packing_PackageCollection.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="FunctionCode\Packing\Packing_PackageCollectionWeigh2.resx">
+      <DependentUpon>Packing_PackageCollectionWeigh2.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="FunctionCode\Packing\Packing_PackageCollectionWeigh.resx">
       <DependentUpon>Packing_PackageCollectionWeigh.cs</DependentUpon>
     </EmbeddedResource>

+ 309 - 0
UAS_MES_PW/FunctionCode/Make/Make_StencilPrint.Designer.cs

@@ -0,0 +1,309 @@
+namespace UAS_MES_NEW.Make
+{
+    partial class Make_StencilPrint
+    {
+        /// <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();
+            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Make_CustomLabelPrint));
+            this.pr_code_label = new System.Windows.Forms.Label();
+            this.label2 = new System.Windows.Forms.Label();
+            this.label3 = new System.Windows.Forms.Label();
+            this.PrintLabel = new UAS_MES_NEW.CustomControl.ComBoxWithFocus.ComboxWithTip(this.components);
+            this.label4 = new System.Windows.Forms.Label();
+            this.label5 = new System.Windows.Forms.Label();
+            this.sncode_label = new System.Windows.Forms.Label();
+            this.label6 = new System.Windows.Forms.Label();
+            this.pr_detail = new System.Windows.Forms.Label();
+            this.pr_spec = new System.Windows.Forms.Label();
+            this.PrintNum = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.NumOnlyTextBox();
+            this.printButton = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
+            this.pr_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SnCollectionBox();
+            this.inputText = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SnCollectionBox();
+            this.OperateResult = new UAS_MES_NEW.CustomControl.RichText.RichTextAutoBottom();
+            this.Printer = new UAS_MES_NEW.CustomControl.ComBoxWithFocus.PrinterCombox();
+            this.SuspendLayout();
+            // 
+            // pr_code_label
+            // 
+            this.pr_code_label.AutoSize = true;
+            this.pr_code_label.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.pr_code_label.Location = new System.Drawing.Point(74, 43);
+            this.pr_code_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_code_label.Name = "pr_code_label";
+            this.pr_code_label.Size = new System.Drawing.Size(146, 41);
+            this.pr_code_label.TabIndex = 0;
+            this.pr_code_label.Text = "产品代码";
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.label2.Location = new System.Drawing.Point(78, 147);
+            this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(146, 41);
+            this.label2.TabIndex = 1;
+            this.label2.Text = "产品名称";
+            // 
+            // label3
+            // 
+            this.label3.AutoSize = true;
+            this.label3.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.label3.Location = new System.Drawing.Point(1020, 40);
+            this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(82, 41);
+            this.label3.TabIndex = 2;
+            this.label3.Text = "规格";
+            // 
+            // PrintLabel
+            // 
+            this.PrintLabel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.PrintLabel.FormattingEnabled = true;
+            this.PrintLabel.Location = new System.Drawing.Point(693, 147);
+            this.PrintLabel.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+            this.PrintLabel.Name = "PrintLabel";
+            this.PrintLabel.Size = new System.Drawing.Size(252, 32);
+            this.PrintLabel.TabIndex = 185;
+            this.PrintLabel.SelectedValueChanged += new System.EventHandler(this.PrintLabel_SelectedValueChanged);
+            this.PrintLabel.TextChanged += new System.EventHandler(this.PrintLabel_TextChanged);
+            // 
+            // label4
+            // 
+            this.label4.AutoSize = true;
+            this.label4.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label4.Location = new System.Drawing.Point(534, 43);
+            this.label4.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label4.Name = "label4";
+            this.label4.Size = new System.Drawing.Size(114, 41);
+            this.label4.TabIndex = 184;
+            this.label4.Text = "打印机";
+            // 
+            // label5
+            // 
+            this.label5.AutoSize = true;
+            this.label5.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label5.Location = new System.Drawing.Point(534, 147);
+            this.label5.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label5.Name = "label5";
+            this.label5.Size = new System.Drawing.Size(82, 41);
+            this.label5.TabIndex = 183;
+            this.label5.Text = "标签";
+            // 
+            // sncode_label
+            // 
+            this.sncode_label.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left)));
+            this.sncode_label.AutoSize = true;
+            this.sncode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.sncode_label.Location = new System.Drawing.Point(57, 733);
+            this.sncode_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.sncode_label.Name = "sncode_label";
+            this.sncode_label.Size = new System.Drawing.Size(114, 41);
+            this.sncode_label.TabIndex = 188;
+            this.sncode_label.Text = "输入框";
+            // 
+            // label6
+            // 
+            this.label6.AutoSize = true;
+            this.label6.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.label6.Location = new System.Drawing.Point(826, 733);
+            this.label6.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label6.Name = "label6";
+            this.label6.Size = new System.Drawing.Size(82, 41);
+            this.label6.TabIndex = 189;
+            this.label6.Text = "份数";
+            // 
+            // pr_detail
+            // 
+            this.pr_detail.AutoSize = true;
+            this.pr_detail.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.pr_detail.Location = new System.Drawing.Point(240, 147);
+            this.pr_detail.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_detail.Name = "pr_detail";
+            this.pr_detail.Size = new System.Drawing.Size(0, 41);
+            this.pr_detail.TabIndex = 193;
+            // 
+            // pr_spec
+            // 
+            this.pr_spec.AutoSize = true;
+            this.pr_spec.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.pr_spec.Location = new System.Drawing.Point(1110, 40);
+            this.pr_spec.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_spec.MaximumSize = new System.Drawing.Size(450, 160);
+            this.pr_spec.Name = "pr_spec";
+            this.pr_spec.Size = new System.Drawing.Size(0, 41);
+            this.pr_spec.TabIndex = 194;
+            // 
+            // PrintNum
+            // 
+            this.PrintNum.AllPower = null;
+            this.PrintNum.BackColor = System.Drawing.Color.White;
+            this.PrintNum.Enabled = false;
+            this.PrintNum.ID = null;
+            this.PrintNum.Location = new System.Drawing.Point(944, 733);
+            this.PrintNum.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+            this.PrintNum.Name = "PrintNum";
+            this.PrintNum.Negative = false;
+            this.PrintNum.Power = null;
+            this.PrintNum.Size = new System.Drawing.Size(260, 35);
+            this.PrintNum.Str = null;
+            this.PrintNum.Str1 = null;
+            this.PrintNum.Str2 = null;
+            this.PrintNum.TabIndex = 195;
+            this.PrintNum.Text = "1";
+            // 
+            // printButton
+            // 
+            this.printButton.AllPower = null;
+            this.printButton.BackColor = System.Drawing.Color.Transparent;
+            this.printButton.DownImage = ((System.Drawing.Image)(resources.GetObject("printButton.DownImage")));
+            this.printButton.Image = null;
+            this.printButton.IsShowBorder = true;
+            this.printButton.Location = new System.Drawing.Point(1240, 733);
+            this.printButton.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+            this.printButton.MoveImage = ((System.Drawing.Image)(resources.GetObject("printButton.MoveImage")));
+            this.printButton.Name = "printButton";
+            this.printButton.NormalImage = ((System.Drawing.Image)(resources.GetObject("printButton.NormalImage")));
+            this.printButton.Power = null;
+            this.printButton.Size = new System.Drawing.Size(100, 37);
+            this.printButton.TabIndex = 192;
+            this.printButton.Text = "打印";
+            this.printButton.UseVisualStyleBackColor = false;
+            this.printButton.Visible = false;
+            this.printButton.Click += new System.EventHandler(this.printButton_Click);
+            // 
+            // pr_code
+            // 
+            this.pr_code.AllPower = null;
+            this.pr_code.BackColor = System.Drawing.Color.White;
+            this.pr_code.Font = new System.Drawing.Font("宋体", 9F);
+            this.pr_code.ID = null;
+            this.pr_code.Location = new System.Drawing.Point(240, 43);
+            this.pr_code.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+            this.pr_code.Name = "pr_code";
+            this.pr_code.Power = null;
+            this.pr_code.Size = new System.Drawing.Size(246, 35);
+            this.pr_code.Str = null;
+            this.pr_code.Str1 = null;
+            this.pr_code.Str2 = null;
+            this.pr_code.TabIndex = 191;
+            this.pr_code.KeyDown += new System.Windows.Forms.KeyEventHandler(this.pr_code_KeyDown);
+            this.pr_code.Leave += new System.EventHandler(this.pr_code_Leave);
+            // 
+            // inputText
+            // 
+            this.inputText.AllPower = "ifall";
+            this.inputText.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left)));
+            this.inputText.BackColor = System.Drawing.Color.White;
+            this.inputText.ID = null;
+            this.inputText.Location = new System.Drawing.Point(222, 733);
+            this.inputText.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
+            this.inputText.Name = "inputText";
+            this.inputText.Power = null;
+            this.inputText.Size = new System.Drawing.Size(388, 35);
+            this.inputText.Str = null;
+            this.inputText.Str1 = null;
+            this.inputText.Str2 = null;
+            this.inputText.TabIndex = 187;
+            this.inputText.Tag = "ifread";
+            this.inputText.KeyDown += new System.Windows.Forms.KeyEventHandler(this.inputText_KeyDown);
+            // 
+            // OperateResult
+            // 
+            this.OperateResult.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.OperateResult.Location = new System.Drawing.Point(66, 216);
+            this.OperateResult.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
+            this.OperateResult.Name = "OperateResult";
+            this.OperateResult.Size = new System.Drawing.Size(1408, 471);
+            this.OperateResult.TabIndex = 186;
+            this.OperateResult.Text = "";
+            // 
+            // Printer
+            // 
+            this.Printer.Location = new System.Drawing.Point(693, 43);
+            this.Printer.Margin = new System.Windows.Forms.Padding(8, 8, 8, 8);
+            this.Printer.Name = "Printer";
+            this.Printer.Size = new System.Drawing.Size(254, 50);
+            this.Printer.TabIndex = 182;
+            // 
+            // Make_CustomLabelPrint
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(1542, 824);
+            this.Controls.Add(this.PrintNum);
+            this.Controls.Add(this.pr_spec);
+            this.Controls.Add(this.pr_detail);
+            this.Controls.Add(this.printButton);
+            this.Controls.Add(this.pr_code);
+            this.Controls.Add(this.label6);
+            this.Controls.Add(this.sncode_label);
+            this.Controls.Add(this.inputText);
+            this.Controls.Add(this.OperateResult);
+            this.Controls.Add(this.PrintLabel);
+            this.Controls.Add(this.label4);
+            this.Controls.Add(this.label5);
+            this.Controls.Add(this.Printer);
+            this.Controls.Add(this.label3);
+            this.Controls.Add(this.label2);
+            this.Controls.Add(this.pr_code_label);
+            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
+            this.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+            this.Name = "Make_CustomLabelPrint";
+            this.Tag = "Make!CustomLabelPrint";
+            this.Text = "Make_CustomLabelPrint";
+            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Make_CustomLabelPrint_FormClosing);
+            this.Load += new System.EventHandler(this.Make_CustomLablePrint_Load);
+            this.SizeChanged += new System.EventHandler(this.Make_CustomLabelPrint_SizeChanged);
+            this.ResumeLayout(true);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.Label pr_code_label;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.Label label3;
+        private UAS_MES_NEW.CustomControl.ComBoxWithFocus.ComboxWithTip PrintLabel;
+        private System.Windows.Forms.Label label4;
+        private System.Windows.Forms.Label label5;
+        private CustomControl.ComBoxWithFocus.PrinterCombox Printer;
+        private CustomControl.RichText.RichTextAutoBottom OperateResult;
+        private System.Windows.Forms.Label sncode_label;
+        private CustomControl.TextBoxWithIcon.SnCollectionBox inputText;
+        private System.Windows.Forms.Label label6;
+        private CustomControl.TextBoxWithIcon.SnCollectionBox pr_code;
+        private CustomControl.ButtonUtil.NormalButton printButton;
+        private System.Windows.Forms.Label pr_detail;
+        private System.Windows.Forms.Label pr_spec;
+        private CustomControl.TextBoxWithIcon.NumOnlyTextBox PrintNum;
+    }
+}

+ 264 - 0
UAS_MES_PW/FunctionCode/Make/Make_StencilPrint.cs

@@ -0,0 +1,264 @@
+using DevExpress.Printing.Core.PdfExport.Metafile;
+using LabelManager2;
+using Seagull.BarTender.Print;
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.IO;
+using System.Linq;
+using System.Net;
+using System.Text;
+using System.Text.RegularExpressions;
+using System.Threading;
+using System.Windows.Forms;
+using UAS_MES_NEW.DataOperate;
+using UAS_MES_NEW.Entity;
+using UAS_MES_NEW.PublicForm;
+using UAS_MES_NEW.PublicMethod;
+
+namespace UAS_MES_NEW.Make
+{
+    public partial class Make_StencilPrint : Form
+    {
+        DataHelper dh;
+
+        LogStringBuilder sql = new LogStringBuilder();
+
+        AutoSizeFormClass asc = new AutoSizeFormClass();
+
+        Thread InitPrint;
+        //存放产品信息
+        DataTable dt;
+        //存放标签信息
+        DataTable listA;
+        //存放标签参数列表信息
+        DataTable paramsInfo;
+        //记录当前的步骤数
+        int currentIndex = 0;
+
+        FileInfo info;
+        Engine engine;
+
+        //ftpOperater ftp;
+
+        LabelFormatDocument format;
+
+        StringBuilder sb = new StringBuilder();
+
+        bool canPrint = false;
+
+        string[] inputValues;//存放用户输入的参数值
+        public Make_StencilPrint()
+        {
+            InitializeComponent();
+        }
+
+        private void Make_CustomLablePrint_Load(object sender, EventArgs e)
+        {
+            asc.controllInitializeSize(this);
+            OperateResult.AppendText(">>请输入产品代码\n", Color.Black);
+            InitPrint = new Thread(InPrint);
+            SetLoadingWindow stw = new SetLoadingWindow(InitPrint, "初始化打印程序");
+            BaseUtil.SetFormCenter(stw);
+            stw.ShowDialog();
+            pr_code.Focus();
+            dh = SystemInf.dh;
+        }
+        private void InPrint()
+        {
+            try
+            {
+                engine = new Engine(true);
+            }
+            catch (Exception ex)
+            {
+                OperateResult.AppendText(ex.Message + ex.StackTrace, Color.Red);
+            }
+        }
+
+        private void pr_code_KeyDown(object sender, KeyEventArgs e)
+        {
+            //按下enter键
+            if (e.KeyCode == Keys.Enter)
+            {
+                //判断产品是否存在
+                dt = (DataTable)dh.ExecuteSql("select pr_code,pr_detail,pr_spec from product where pr_code='" + pr_code.Text + "'  and pr_statuscode ='AUDITED'", "select");
+                //查询没有值,返回提示用户“产品:XXX,不存在或者为审核”,清空产品代码输入框中的值 
+                if (dt.Rows.Count == 0)
+                {
+                    OperateResult.AppendText("<<产品:" + pr_code.Text + ",不存在或者未审核\n", Color.Red, pr_code);
+                    return;
+                }
+                //查询产品是否有自定义的标签模板
+                sql.Clear();
+                sql.Append("select la_code,la_id,substr(la_url,instr(la_url,'\\',-1)+1)la_name,la_url,la_isdefault ");
+                sql.Append("from label where la_prodcode='" + pr_code.Text + "' and la_templatetype='自定义' and la_statuscode='AUDITED' order by la_isdefault");
+                listA = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                if (listA.Rows.Count == 0)
+                {
+                    OperateResult.AppendText("<<产品:" + pr_code.Text + ",没有维护自定义模板\n", Color.Red, pr_code);
+                    return;
+                }
+                string la_id = listA.Rows[0]["la_id"].ToString();
+                string la_code = listA.Rows[0]["la_code"].ToString();
+                Console.WriteLine(listA.Rows[0]["la_isdefault"].ToString());
+                {
+                    //说明没有默认的模板,那就取pl_id最大的
+                    listA = (DataTable)dh.ExecuteSql("select la_code,la_id,substr(la_url,instr(la_url,'\\',-1)+1)la_name,la_url,la_isdefault from label where la_prodcode='" + pr_code.Text + "' and la_templatetype='自定义' and la_statuscode='AUDITED' order by la_isdefault", "select");
+                }
+                //标签显示
+                PrintLabel.DataSource = listA;
+                PrintLabel.DisplayMember = "la_url";
+                PrintLabel.ValueMember = "la_id";
+                //有值,填充界面
+                BaseUtil.SetFormValue(this.Controls, dt);
+                //paramsInfo = (DataTable)dh.ExecuteSql("select lp_detno, lp_name, lp_valuetype,lp_sql from label left join labelparameter on lp_laid=la_id where la_code='"+ listA.Rows[0]["pl_labelcode"].ToString() + "' order by lp_detno asc", "select");
+            }
+        }
+
+        private void inputText_KeyDown(object sender, KeyEventArgs e)
+        {
+            //按下enter键
+            string oErrorMessage = "";
+            if (e.KeyCode == Keys.Enter)
+            {
+                //产品编号为空
+                if (pr_code.Text.Trim() == "")
+                {
+                    OperateResult.AppendText("<<请先输入产品编号\n", Color.Red);
+                    return;
+                }
+                if (inputText.Text.Trim() == "")
+                {
+                    OperateResult.AppendText("<<输入不能为空\n", Color.Red);
+                    return;
+                }
+                OperateResult.AppendText(">>" + inputText.Text + "\n", Color.Black);
+                if (paramsInfo == null || paramsInfo.Rows.Count == 0)
+                {
+                    OperateResult.AppendText("<<无可用标签\n", Color.Red, inputText);
+                    return;
+                }
+                else
+                {
+                    if (Print.BarTender(Tag.ToString(), ref engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, inputText.Text, int.Parse(PrintNum.Text),"", pr_code.Text, "自定义", "-1", out oErrorMessage))
+                    {
+                        OperateResult.AppendText(oErrorMessage + "\n", Color.Red);
+                    }
+                }
+            }
+        }
+
+        private void PrintLabel_TextChanged(object sender, EventArgs e)
+        {
+            if (PrintLabel.Text.StartsWith("System"))
+            {
+                return;
+            }
+            paramsInfo = (DataTable)dh.ExecuteSql("select lp_detno, lp_name, lp_valuetype,lp_sql from label left join labelparameter on lp_laid=la_id where la_code='" + listA.Rows[PrintLabel.SelectedIndex]["la_code"].ToString() + "'and LA_TEMPLATETYPE = '自定义' order by to_number(lp_detno) asc", "select");
+            if (paramsInfo.Rows.Count > 0)
+            {
+                //根据查询出来的参数,一次提示用户, “<<SN001 “, 
+                //“>> 请输入自定义模板的(XXXX参数名称)lp_name”
+                OperateResult.AppendText("<<" + listA.Rows[PrintLabel.SelectedIndex]["la_code"].ToString() + "\n", Color.Black);
+                OperateResult.AppendText(">>请输入自定义模板" + paramsInfo.Rows[0]["lp_name"].ToString() + "所需参数\n", Color.Green);
+                //打开模板路径
+                currentIndex = 1;
+                //聚焦输入框
+                inputText.Focus();
+            }
+            else
+            {
+                OperateResult.AppendText("<<标签编号:" + listA.Rows[0]["la_code"].ToString() + "无标签参数\n", Color.Red);
+            }
+        }
+
+        private void Make_CustomLabelPrint_SizeChanged(object sender, EventArgs e)
+        {
+            asc.controlAutoSize(this);
+        }
+
+        private void Make_CustomLabelPrint_FormClosing(object sender, FormClosingEventArgs e)
+        {
+
+        }
+
+        private void pr_code_Leave(object sender, EventArgs e)
+        {
+            //pr_code_KeyDown(sender, new KeyEventArgs(Keys.Enter));
+        }
+
+        private void printButton_Click(object sender, EventArgs e)
+        {
+            if (canPrint)
+            {
+                string filelastwritetime = dh.getFieldDataByCondition("label", "la_lastwritetime", "la_id = '" + listA.Rows[PrintLabel.SelectedIndex]["la_id"].ToString() + "'").ToString();
+                FileInfo PrintFile = new FileInfo(listA.Rows[PrintLabel.SelectedIndex]["la_url"].ToString());
+                if (PrintFile == null)
+                {
+                    MessageBox.Show("打印文件不存在");
+                    return;
+                }
+                string filechangetime = PrintFile.LastWriteTime.ToString();
+                //if (filechangetime != filelastwritetime)
+                //{
+                //    engine = 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 = '" + listA.Rows[PrintLabel.SelectedIndex]["la_id"].ToString() + "'");
+                //}
+                format = engine.Documents.Open(listA.Rows[PrintLabel.SelectedIndex]["la_url"].ToString());
+                sb = new StringBuilder();
+                //将值赋到format对应的变量
+                for (int i = 0; i < format.SubStrings.Count; i++)
+                {
+                    for (int j = 0; j < paramsInfo.Rows.Count; j++)
+                    {
+                        //找到对应的变量名
+                        if (format.SubStrings[i].Name == paramsInfo.Rows[j]["lp_name"].ToString())
+                        {
+                            //直接赋值
+                            format.SubStrings[i].Value = inputValues[j];
+                        }
+                    }
+                }
+                //打印
+                LogManager.DoLog(sb.ToString());
+                //保存本次赋值进行打印
+                format.PrintSetup.PrinterName = Printer.Text;
+                format.PrintSetup.IdenticalCopiesOfLabel = int.Parse(PrintNum.Text);
+                format.Print();
+                for (int i = 0; i < format.SubStrings.Count; i++)
+                {
+                    if (format.SubStrings[i].Name != "Serial1")
+                    {
+                        Console.WriteLine(format.SubStrings[i].Name);
+                        format.SubStrings[i].Value = null;
+                    }
+                }
+                //讲文件最后写入时间改成数据库中拿到的时间
+                //记录打印日志
+                LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, "", User.UserLineCode, User.UserSourceCode, "自定义标打印", "成功打印", "", "");
+                //打印成功
+                OperateResult.AppendText("<<打印成功\n", Color.Green);
+            }
+            else
+            {
+                OperateResult.AppendText("<<标签参数未全部输入完成\n", Color.Red);
+            }
+        }
+
+        private void PrintLabel_SelectedValueChanged(object sender, EventArgs e)
+        {
+            if (PrintLabel.SelectedValue != null && PrintLabel.SelectedValue.ToString() != "System.Data.DataRowView")
+            {
+                string PrintNums = dh.getFieldDataByCondition("label", "la_printnos", "la_id='" + PrintLabel.SelectedValue.ToString() + "'").ToString();
+                PrintNum.Text = (PrintNums == "" ? "1" : PrintNums);
+            }
+        }
+    }
+}

+ 159 - 0
UAS_MES_PW/FunctionCode/Make/Make_StencilPrint.resx

@@ -0,0 +1,159 @@
+<?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="printButton.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="printButton.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="printButton.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>

+ 9 - 0
UAS_MES_PW/UAS_MES_PW.csproj

@@ -604,6 +604,12 @@
     <Compile Include="FunctionCode\Make\Make_SmtTestCollection.Designer.cs">
       <DependentUpon>Make_SmtTestCollection.cs</DependentUpon>
     </Compile>
+    <Compile Include="FunctionCode\Make\Make_StencilPrint.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="FunctionCode\Make\Make_StencilPrint.Designer.cs">
+      <DependentUpon>Make_StencilPrint.cs</DependentUpon>
+    </Compile>
     <Compile Include="FunctionCode\Packing\Packing_BigBoxCollection.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -1361,6 +1367,9 @@
     <EmbeddedResource Include="FunctionCode\Make\Make_SmtTestCollection.resx">
       <DependentUpon>Make_SmtTestCollection.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="FunctionCode\Make\Make_StencilPrint.resx">
+      <DependentUpon>Make_StencilPrint.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="FunctionCode\Packing\Packing_BigBoxCollection.resx">
       <DependentUpon>Packing_BigBoxCollection.cs</DependentUpon>
     </EmbeddedResource>

+ 1 - 1
UAS_MES_YD/CustomControl/HeadBar/HeadBar.cs

@@ -122,7 +122,7 @@ namespace UAS_MES_NEW.CustomControl
                 if (logout_confirm == "Yes")
                 {
                     //注销的时候切换回默认数据库
-                    SystemInf.ConnectionString = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=81.71.42.91)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+                    SystemInf.ConnectionString = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=113.98.196.181)(PORT=1520)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
                     DataHelper.DBConnectionString = SystemInf.ConnectionString;
                     //清除上个用户的权限信息
                     SystemInf.Caller.Clear();

+ 1 - 1
UAS_MES_YD/CustomControl/RichText/RichTextAutoBottom.cs

@@ -10,7 +10,7 @@ namespace UAS_MES_NEW.CustomControl.RichText
     public partial class RichTextAutoBottom : RichTextBox
     {
         Thread thread;
-        string FileName = "";
+        string FileName = ""; 
         public RichTextAutoBottom()
         {
             InitializeComponent();

+ 1 - 1
UAS_MES_YD/DataOperate/DataHelper.cs

@@ -11,7 +11,7 @@ namespace UAS_MES_NEW.DataOperate
     class DataHelper
     {
         //系统默认的的连接字符串
-        private string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=81.71.42.91)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+        private string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=113.98.196.181)(PORT=1520)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
         //用户选择的数据库的连接字符串
         public static string DBConnectionString;
         public static OracleConnection connection = null;

+ 1 - 1
UAS_MES_YD/FunctionCode/Make/Make_FeedingCollection.cs

@@ -400,7 +400,7 @@ namespace UAS_MES_NEW.Make
             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_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=");
+            sql.Append("cm_sncode in (select '" + sn_code.Text + "' from dual union select sn from makesnrelation where firstsn='" + ms_firstsn + "') and cm_makecode='" + ma_code.Text + "' and cm_fsoncode=");
             sql.Append("sp_fsoncode and cm_status=0) group by sp_fsoncode,sp_id order by SP_DETNO asc");
             dt1 = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
             code.Clear();

+ 59 - 6
UAS_MES_YD/FunctionCode/Make/Make_ImeiCheck.cs

@@ -72,20 +72,44 @@ namespace UAS_MES_NEW.Make
                     OperateResult.AppendText("<<输入不能为空\n", Color.Red);
                     return;
                 }
+                dt = (DataTable)dh.ExecuteSql("select ms_sncode from makeserial where ms_code='" + sncode.Text + "' or  ms_imei1='" + sncode.Text + "' order by ms_id desc", "select");
+                if (dt.Rows.Count > 0)
+                {
+                    sncode.Text = dt.Rows[0]["ms_sncode"].ToString();
+                }
+                else
+                {
+                    dt = (DataTable)dh.ExecuteSql("select ms_sncode from makeserial where ms_imei2='" + sncode.Text + "' order by ms_id desc", "select");
+                    if (dt.Rows.Count > 0)
+                    {
+                        sncode.Text = dt.Rows[0]["ms_sncode"].ToString();
+                    }
+                }
                 //输入的是SN
                 if (!isImei1)
                 {
                     OperateResult.AppendText("<<" + sncode.Text + "\n", Color.Black);
                     //查询是否存在该ms_id
                     sql.Clear();
-                    sql.Append("select max(ms_id) ms_id from makeserial where ms_sncode ='" + sncode.Text + "' or ms_firstsn='"+sncode.Text+"'");
+                    sql.Append("select max(ms_id) ms_id from makeserial where ms_sncode ='" + sncode.Text + "' or ms_firstsn='" + sncode.Text + "'");
                     dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                     if (dt.Rows.Count == 0 || dt.Rows[0]["ms_id"].ToString() == "")
                     {
-                        //SN错误,不存在
-                        //请输入SN
-                        OperateResult.AppendText("<<SN错误,序列号" + sncode.Text + "不存在\n", Color.Red, sncode);
-                        OperateResult.AppendText(">>请输入SN\n", Color.Black);
+                        sql.Clear();
+                        sql.Append("select max(ms_id) ms_id from makeserial where ms_imei1 ='" + sncode.Text + "'");
+                        dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                        if (dt.Rows.Count == 0 || dt.Rows[0]["ms_id"].ToString() == "")
+                        {
+                            sql.Clear();
+                            sql.Append("select max(ms_id) ms_id from makeserial where ms_imei2 ='" + sncode.Text + "'");
+                            dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                            if (dt.Rows.Count == 0 || dt.Rows[0]["ms_id"].ToString() == "")
+                            {
+
+                                OperateResult.AppendText("<<SN错误,序列号" + sncode.Text + "不存在\n", Color.DarkRed, sncode);
+                                OperateResult.AppendText(">>请输入SN\n", Color.Black);
+                            }
+                        }
                     }
                     //存在该SN号
                     else
@@ -133,7 +157,36 @@ namespace UAS_MES_NEW.Make
                 else
                 {
                     OperateResult.AppendText("<<" + sncode.Text + "\n", Color.Black);
-                    if (imei1 == sncode.Text)
+                    sql.Clear();
+                    sql.Append("select max(ms_id) ms_id from makeserial where ms_sncode ='" + sncode.Text + "' or ms_code='" + sncode.Text + "'");
+                    dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                    if (dt.Rows.Count == 0 || dt.Rows[0]["ms_id"].ToString() == "")
+                    {
+                        sql.Clear();
+                        sql.Append("select max(ms_id) ms_id from makeserial where ms_imei1 ='" + sncode.Text + "'");
+                        dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                        if (dt.Rows.Count == 0 || dt.Rows[0]["ms_id"].ToString() == "")
+                        {
+                            sql.Clear();
+                            sql.Append("select max(ms_id) ms_id from makeserial where ms_imei2 ='" + sncode.Text + "'");
+                            dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                            if (dt.Rows.Count == 0 || dt.Rows[0]["ms_id"].ToString() == "")
+                            {
+
+                                OperateResult.AppendText("<<SN错误,序列号" + sncode.Text + "不存在\n", Color.DarkRed, sncode);
+                                OperateResult.AppendText(">>请输入SN\n", Color.Black);
+                            }
+                        }
+                    }
+                    sql.Clear();
+                    sql.Append("select ms_sncode from  makeserial  where ms_id='" + dt.Rows[0]["ms_id"].ToString() + "'");
+                    info = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                    string checksn = "";
+                    if (info.Rows.Count > 0)
+                    {
+                        checksn = info.Rows[0]["ms_sncode"].ToString();
+                    }
+                    if (imei1 == checksn)
                     {
                         //说明输入的imei1对比一致
                         //判断工序属性attribute

+ 3 - 3
UAS_MES_YD/FunctionCode/Make/Make_PreFeedingCollection.cs

@@ -286,7 +286,7 @@ namespace UAS_MES_NEW.Make
                 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(substr(pr_spec,0,20))pr_detail from stepproduct left join stepbom on sb_bomversion=sp_bomversion and sp_craftcode=sb_craftcode ");
                 sql.Append("left join product on pr_code=sp_fsoncode  where ");
-                sql.Append("sp_mothercode ='" + ma_prodcode.Text + "' and sp_craftcode='" + ma_craftcode.Text + "' and sp_tracekind=1 and sp_ifbeforhandle=-1  group by sp_fsoncode order by SP_DETNO asc");
+                sql.Append("sp_mothercode ='" + ma_prodcode.Text + "' and sp_craftcode='" + ma_craftcode.Text + "' and  sp_stepcode='" + User.CurrentStepCode + "' and sp_tracekind=1 and sp_ifbeforhandle=-1  group by sp_fsoncode order by SP_DETNO asc");
             }
             else
             {
@@ -296,7 +296,7 @@ namespace UAS_MES_NEW.Make
                 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(substr(pr_spec,0,20))pr_detail,max(bhp_barcode)bhp_barcode from stepproduct left join stepbom on sb_bomversion=sp_bomversion and sp_craftcode=sb_craftcode  ");
                 sql.Append("left join product on pr_code=sp_fsoncode left join (select * from BEFOREHANDPROCESS where bhp_maincode='" + mainbarcode.Text + "') on bhp_prodcode=sp_fsoncode where ");
-                sql.Append("sp_mothercode ='" + ma_prodcode.Text + "' and sp_craftcode='" + ma_craftcode.Text + "'  and sp_tracekind=1 and sp_ifbeforhandle=-1 and (bhp_maincode='" + mainbarcode.Text + "' or bhp_maincode is null)  group by sp_fsoncode order by SP_DETNO asc");
+                sql.Append("sp_mothercode ='" + ma_prodcode.Text + "' and sp_craftcode='" + ma_craftcode.Text + "' and sp_stepcode='" + User.CurrentStepCode + "' and sp_tracekind=1 and sp_ifbeforhandle=-1 and (bhp_maincode='" + mainbarcode.Text + "' or bhp_maincode is null)  group by sp_fsoncode order by SP_DETNO asc");
             }
             dt1 = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
             BaseUtil.FillDgvWithDataTable(LabelDataGridView, dt1);
@@ -315,7 +315,7 @@ namespace UAS_MES_NEW.Make
                     mcd_inqty1.Text = Count;
                     mcd_remainqty.Text = "";
                     sql.Clear();
-                    sql.Append("select mcd_inqty,ma_qty-mcd_inqty mcd_remainqty "); 
+                    sql.Append("select mcd_inqty,ma_qty-mcd_inqty mcd_remainqty ");
                     sql.Append("from make left join makecraftdetail on mcd_macode=ma_code where ");
                     sql.Append("ma_code='" + ma_code.Text + "' and mcd_stepcode='" + User.CurrentStepCode + "'");
                     DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");

+ 1 - 1
UAS_MES_YD/FunctionCode/Make/Make_TestCollection.cs

@@ -888,7 +888,7 @@ namespace UAS_MES_NEW.Make
             {
                 string ms_sncode = dt.Rows[0]["ms_sncode"].ToString();
                 string ms_makecode = dt.Rows[0]["ms_makecode"].ToString();
-                if (dh.getFieldDataByCondition("craftmaterial", "cm_barcode", "cm_sncode='" + ms_sncode + "' and cm_status=0").ToString() != "")
+                if (dh.getFieldDataByCondition("craftmaterial", "cm_barcode", "cm_sncode='" + ms_sncode + "' and cm_status=0 and cm_sncode<>cm_firstsn").ToString() != "")
                 {
                     MessageBox.Show("转号后已绑定关键物料,请先解绑物料!");
                     return;

+ 1 - 1
UAS_MES_YD/FunctionCode/Make/Make_TestCollection_DCW.Designer.cs

@@ -750,7 +750,7 @@
             this.BaudRate.Str1 = null;
             this.BaudRate.Str2 = null;
             this.BaudRate.TabIndex = 198;
-            this.BaudRate.Text = "115210";
+            this.BaudRate.Text = "115200";
             // 
             // SerialPortComBox_label
             // 

+ 3 - 2
UAS_MES_YD/FunctionCode/Special/Special_CancelOQC.cs

@@ -46,6 +46,8 @@ namespace UAS_MES_NEW.Special
             if (ms_id == "") { OperateResult.AppendText(">>请先获取SN\n"); return; }
             if (cd_stepcode.Text == "") { OperateResult.AppendText(">>请选择回流工序\n"); return; }
             DataTable dt = (DataTable)dh.ExecuteSql("select ms_makecode,ms_firstsn,ms_sncode,ms_prodcode,ms_checkno,ms_craftcode,ms_outboxcode from makeserial where ms_id='" + ms_id + "' and instr(ms_paststep,'" + cd_stepcode.Text + "')>0 ", "select");
+            string ms_checkno = dt.Rows[0]["ms_checkno"].ToString();
+            if (ms_checkno == "") { OperateResult.AppendText(">>" + SN.Text + "不存在抽检批次中\n", System.Drawing.Color.Red, SN); return; }
 
             if (dt.Rows.Count == 0) { OperateResult.AppendText(">>" + SN.Text + "不存在或未执行过" + cd_stepcode.Text + "工序\n"); return; }
 
@@ -53,7 +55,6 @@ namespace UAS_MES_NEW.Special
             string ms_firstsn = dt.Rows[0]["ms_firstsn"].ToString();
             string ms_prodcode = dt.Rows[0]["ms_prodcode"].ToString();
             string ms_sncode = dt.Rows[0]["ms_sncode"].ToString();
-            string ms_checkno = dt.Rows[0]["ms_checkno"].ToString();
             string ms_craftcode = dt.Rows[0]["ms_craftcode"].ToString();
             string ms_outboxcode = dt.Rows[0]["ms_outboxcode"].ToString();
             if (ms_outboxcode != "")
@@ -75,7 +76,7 @@ namespace UAS_MES_NEW.Special
 
             dh.ExecuteSql("update oqcbatch set ob_nowcheckqty=(select count(1) from oqcbatchdetail where obd_checkno='" + ms_checkno + "') where ob_checkno='" + ms_checkno + "'", "update");
 
-            dh.ExecuteSql("update makeserial set ms_nextstepcode='" + cd_stepcode.Text + "',ms_checkno='' where ms_id='" + ms_id + "'", "update");
+            dh.ExecuteSql("update makeserial set ms_status=1,ms_nextstepcode='" + cd_stepcode.Text + "',ms_checkno='' where ms_id='" + ms_id + "'", "update");
 
             LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_makecode, User.UserLineCode, User.UserSourceCode, "OQC回流", "回流成功" + cd_stepcode.Text + "产品:" + ms_prodcode + "序号:" + stepno, ms_sncode, ms_checkno);
             OperateResult.AppendText(">>" + SN.Text + "回流成功\n");

+ 4 - 3
UAS_MES_YD/FunctionCode/Special/Special_CancelOQCToLastStep.cs

@@ -46,6 +46,8 @@ namespace UAS_MES_NEW.Special
             if (ms_id == "") { OperateResult.AppendText(">>请先获取SN\n"); return; }
             if (cd_stepcode.Text == "") { OperateResult.AppendText(">>请选择回流工序\n"); return; }
             DataTable dt = (DataTable)dh.ExecuteSql("select ms_nextstepcode,ms_makecode,ms_firstsn,ms_sncode,ms_prodcode,ms_checkno,ms_craftcode from makeserial where ms_id='" + ms_id + "' and instr(ms_paststep,'" + cd_stepcode.Text + "')>0 ", "select");
+            string ms_checkno = dt.Rows[0]["ms_checkno"].ToString();
+            //if (ms_checkno == "") { OperateResult.AppendText(">>" + SN.Text + "不存在抽检批次中\n", System.Drawing.Color.Red, SN); return; }
 
             if (dt.Rows.Count == 0) { OperateResult.AppendText(">>" + SN.Text + "不存在或未执行过" + cd_stepcode.Text + "工序\n"); return; }
 
@@ -53,7 +55,6 @@ namespace UAS_MES_NEW.Special
             string ms_firstsn = dt.Rows[0]["ms_firstsn"].ToString();
             string ms_prodcode = dt.Rows[0]["ms_prodcode"].ToString();
             string ms_sncode = dt.Rows[0]["ms_sncode"].ToString();
-            string ms_checkno = dt.Rows[0]["ms_checkno"].ToString();
             string ms_craftcode = dt.Rows[0]["ms_craftcode"].ToString();
             string ms_nextstepcode = dt.Rows[0]["ms_nextstepcode"].ToString();
 
@@ -73,7 +74,7 @@ namespace UAS_MES_NEW.Special
                     cd_stepcode.Text = dt.Rows[0]["cd_stepcode"].ToString();
                     StringBuilder sql = new StringBuilder();
 
-                    dh.ExecuteSql("update makeserial set ms_nextstepcode='" + cd_stepcode.Text + "',ms_checkno='' where ms_id='" + ms_id + "'", "update");
+                    dh.ExecuteSql("update makeserial set ms_status=1,ms_nextstepcode='" + cd_stepcode.Text + "',ms_checkno='' where ms_id='" + ms_id + "'", "update");
 
                     LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_makecode, User.UserLineCode, User.UserSourceCode, "OQC回流", "回流成功", ms_sncode, ms_checkno);
                     OperateResult.AppendText(">>" + SN.Text + "回流成功\n");
@@ -87,7 +88,7 @@ namespace UAS_MES_NEW.Special
 
         private void SN_KeyDown(object sender, KeyEventArgs e)
         {
-            if (e.KeyCode == Keys.Enter)
+            if (e.KeyCode == Keys.Enter)    
             {
                 DataTable dt = (DataTable)dh.ExecuteSql("select ms_sncode,ms_firstsn,ms_makecode,ms_id,ms_craftcode,ms_prodcode,ms_nextstepcode,ms_checkno from makeserial where ms_sncode='" + SN.Text + "' order by ms_id desc", "select");
 

+ 2 - 2
UAS_MES_YD/Login.cs

@@ -46,7 +46,7 @@ namespace UAS_MES_NEW
         {
             BaseUtil.FormStepInOrOut(this, true);
             //设置默认数据库
-            SystemInf.DefaultDB = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=81.71.42.91)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+            SystemInf.DefaultDB = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=113.98.196.181)(PORT=1520)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
             SystemInf.ProcessesID = System.Diagnostics.Process.GetCurrentProcess().Id;
             CheckForIllegalCrossThreadCalls = false;
             LoadMasterInf = new Thread(LoadMaster);
@@ -93,7 +93,7 @@ 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=" + Address + ")(PORT=1520)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
             SystemInf.CurrentDB = DBUser;
             //设置屏幕的宽高信息
             SystemInf.ScreenWidth = Screen.PrimaryScreen.WorkingArea.Width;

+ 1 - 1
UAS_MES_YD/Main.cs

@@ -351,7 +351,7 @@ namespace UAS_MES_NEW
             if (logout_confirm == "Yes")
             {
                 //注销的时候切换回默认数据库
-                SystemInf.ConnectionString = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=81.71.42.91)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+                SystemInf.ConnectionString = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=113.98.196.181)(PORT=1520)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
                 DataHelper.DBConnectionString = SystemInf.ConnectionString;
                 //清除上个用户的权限信息
                 SystemInf.Caller.Clear();

+ 1 - 1
UAS_MES_YDCY/DataOperate/ExcelHandler.cs

@@ -24,7 +24,7 @@ namespace UAS_MES_NEW.DataOperate
             MemoryStream ms;
             ms = DataTableToExcel(dt);
             //以系统当前时间命名文件,FileMode.Create表示创建文件,FileAccess.Write表示拥有写的权限
-            string filePath = @FolderPath + "\\" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".xls";
+            string filePath = @FolderPath;
             FileStream fs = new FileStream(filePath, FileMode.Create, FileAccess.Write);
             byte[] data = ms.ToArray();
             fs.Write(data, 0, data.Length);

+ 410 - 0
UAS_MES_YDCY/FunctionCode/Special/Special_Reset.Designer.cs

@@ -0,0 +1,410 @@
+namespace UAS_MES_NEW.Special
+{
+    partial class Special_Reset
+    {
+        /// <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_Reset));
+            this.Pallet_label = new System.Windows.Forms.Label();
+            this.bigboxBtn = new System.Windows.Forms.RadioButton();
+            this.serBtn = new System.Windows.Forms.RadioButton();
+            this.st_rstepcode_label = new System.Windows.Forms.Label();
+            this.ma_craftcode_label = new System.Windows.Forms.Label();
+            this.ms_makecode_label = new System.Windows.Forms.Label();
+            this.ms_prodcode_label = new System.Windows.Forms.Label();
+            this.WeighRecord = new System.Windows.Forms.ListView();
+            this.columnHeader3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+            this.cd_stepno = new System.Windows.Forms.Label();
+            this.ExportFileDialog = new System.Windows.Forms.FolderBrowserDialog();
+            this.ImportExcel = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
+            this.Export = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
+            this.数据清空 = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
+            this.ms_prodcode = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
+            this.ms_makecode = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
+            this.cd_stepcode = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SearchTextBox();
+            this.cr_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
+            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.ImportExcel1 = new System.Windows.Forms.OpenFileDialog();
+            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(13, 83);
+            this.Pallet_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.Pallet_label.Name = "Pallet_label";
+            this.Pallet_label.Size = new System.Drawing.Size(114, 41);
+            this.Pallet_label.TabIndex = 1;
+            this.Pallet_label.Text = "录入框";
+            // 
+            // bigboxBtn
+            // 
+            this.bigboxBtn.AutoSize = true;
+            this.bigboxBtn.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.bigboxBtn.Location = new System.Drawing.Point(21, 4);
+            this.bigboxBtn.Margin = new System.Windows.Forms.Padding(4);
+            this.bigboxBtn.Name = "bigboxBtn";
+            this.bigboxBtn.Size = new System.Drawing.Size(113, 45);
+            this.bigboxBtn.TabIndex = 234;
+            this.bigboxBtn.Text = "箱号";
+            this.bigboxBtn.UseVisualStyleBackColor = true;
+            this.bigboxBtn.Click += new System.EventHandler(this.bigboxBtn_Click);
+            // 
+            // serBtn
+            // 
+            this.serBtn.AutoSize = true;
+            this.serBtn.Checked = true;
+            this.serBtn.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.serBtn.Location = new System.Drawing.Point(160, 4);
+            this.serBtn.Margin = new System.Windows.Forms.Padding(4);
+            this.serBtn.Name = "serBtn";
+            this.serBtn.Size = new System.Drawing.Size(209, 45);
+            this.serBtn.TabIndex = 233;
+            this.serBtn.TabStop = true;
+            this.serBtn.Text = "单台序列号";
+            this.serBtn.UseVisualStyleBackColor = true;
+            this.serBtn.Click += new System.EventHandler(this.bigboxBtn_Click);
+            // 
+            // st_rstepcode_label
+            // 
+            this.st_rstepcode_label.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | 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(1012, 19);
+            this.st_rstepcode_label.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
+            this.st_rstepcode_label.Name = "st_rstepcode_label";
+            this.st_rstepcode_label.Size = new System.Drawing.Size(146, 41);
+            this.st_rstepcode_label.TabIndex = 235;
+            this.st_rstepcode_label.Text = "回流工序";
+            // 
+            // ma_craftcode_label
+            // 
+            this.ma_craftcode_label.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | 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(652, 8);
+            this.ma_craftcode_label.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
+            this.ma_craftcode_label.Name = "ma_craftcode_label";
+            this.ma_craftcode_label.Size = new System.Drawing.Size(146, 41);
+            this.ma_craftcode_label.TabIndex = 236;
+            this.ma_craftcode_label.Text = "回流途程";
+            // 
+            // ms_makecode_label
+            // 
+            this.ms_makecode_label.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | 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(13, 163);
+            this.ms_makecode_label.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
+            this.ms_makecode_label.Name = "ms_makecode_label";
+            this.ms_makecode_label.Size = new System.Drawing.Size(114, 41);
+            this.ms_makecode_label.TabIndex = 240;
+            this.ms_makecode_label.Text = "工单号";
+            // 
+            // ms_prodcode_label
+            // 
+            this.ms_prodcode_label.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | 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(652, 163);
+            this.ms_prodcode_label.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
+            this.ms_prodcode_label.Name = "ms_prodcode_label";
+            this.ms_prodcode_label.Size = new System.Drawing.Size(146, 41);
+            this.ms_prodcode_label.TabIndex = 241;
+            this.ms_prodcode_label.Text = "产品编号";
+            // 
+            // WeighRecord
+            // 
+            this.WeighRecord.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
+            this.columnHeader3});
+            this.WeighRecord.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.WeighRecord.HideSelection = false;
+            this.WeighRecord.Location = new System.Drawing.Point(21, 216);
+            this.WeighRecord.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4);
+            this.WeighRecord.Name = "WeighRecord";
+            this.WeighRecord.Size = new System.Drawing.Size(839, 639);
+            this.WeighRecord.TabIndex = 243;
+            this.WeighRecord.UseCompatibleStateImageBehavior = false;
+            this.WeighRecord.View = System.Windows.Forms.View.Details;
+            // 
+            // columnHeader3
+            // 
+            this.columnHeader3.Text = "录入项";
+            this.columnHeader3.Width = 300;
+            // 
+            // cd_stepno
+            // 
+            this.cd_stepno.AutoSize = true;
+            this.cd_stepno.Location = new System.Drawing.Point(1408, 83);
+            this.cd_stepno.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
+            this.cd_stepno.Name = "cd_stepno";
+            this.cd_stepno.Size = new System.Drawing.Size(0, 24);
+            this.cd_stepno.TabIndex = 244;
+            // 
+            // ImportExcel
+            // 
+            this.ImportExcel.AllPower = null;
+            this.ImportExcel.BackColor = System.Drawing.Color.Transparent;
+            this.ImportExcel.DownImage = ((System.Drawing.Image)(resources.GetObject("ImportExcel.DownImage")));
+            this.ImportExcel.Image = null;
+            this.ImportExcel.IsShowBorder = true;
+            this.ImportExcel.Location = new System.Drawing.Point(1278, 216);
+            this.ImportExcel.Margin = new System.Windows.Forms.Padding(4);
+            this.ImportExcel.MoveImage = ((System.Drawing.Image)(resources.GetObject("ImportExcel.MoveImage")));
+            this.ImportExcel.Name = "ImportExcel";
+            this.ImportExcel.NormalImage = ((System.Drawing.Image)(resources.GetObject("ImportExcel.NormalImage")));
+            this.ImportExcel.Power = null;
+            this.ImportExcel.Size = new System.Drawing.Size(112, 44);
+            this.ImportExcel.TabIndex = 247;
+            this.ImportExcel.Text = "导入数据";
+            this.ImportExcel.UseVisualStyleBackColor = false;
+            this.ImportExcel.Click += new System.EventHandler(this.ImportExcel_Click);
+            // 
+            // Export
+            // 
+            this.Export.AllPower = null;
+            this.Export.BackColor = System.Drawing.Color.Transparent;
+            this.Export.DownImage = ((System.Drawing.Image)(resources.GetObject("Export.DownImage")));
+            this.Export.Image = null;
+            this.Export.IsShowBorder = true;
+            this.Export.Location = new System.Drawing.Point(1107, 216);
+            this.Export.Margin = new System.Windows.Forms.Padding(4);
+            this.Export.MoveImage = ((System.Drawing.Image)(resources.GetObject("Export.MoveImage")));
+            this.Export.Name = "Export";
+            this.Export.NormalImage = ((System.Drawing.Image)(resources.GetObject("Export.NormalImage")));
+            this.Export.Power = null;
+            this.Export.Size = new System.Drawing.Size(112, 44);
+            this.Export.TabIndex = 246;
+            this.Export.Text = "导出模板";
+            this.Export.UseVisualStyleBackColor = false;
+            this.Export.Click += new System.EventHandler(this.Export_Click);
+            // 
+            // 数据清空
+            // 
+            this.数据清空.AllPower = null;
+            this.数据清空.BackColor = System.Drawing.Color.Transparent;
+            this.数据清空.DownImage = ((System.Drawing.Image)(resources.GetObject("数据清空.DownImage")));
+            this.数据清空.Image = null;
+            this.数据清空.IsShowBorder = true;
+            this.数据清空.Location = new System.Drawing.Point(947, 800);
+            this.数据清空.Margin = new System.Windows.Forms.Padding(5);
+            this.数据清空.MoveImage = ((System.Drawing.Image)(resources.GetObject("数据清空.MoveImage")));
+            this.数据清空.Name = "数据清空";
+            this.数据清空.NormalImage = ((System.Drawing.Image)(resources.GetObject("数据清空.NormalImage")));
+            this.数据清空.Power = null;
+            this.数据清空.Size = new System.Drawing.Size(112, 56);
+            this.数据清空.TabIndex = 245;
+            this.数据清空.Text = "数据清空";
+            this.数据清空.UseVisualStyleBackColor = false;
+            this.数据清空.Click += new System.EventHandler(this.数据清空_Click);
+            // 
+            // ms_prodcode
+            // 
+            this.ms_prodcode.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left)));
+            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(844, 163);
+            this.ms_prodcode.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
+            this.ms_prodcode.MaximumSize = new System.Drawing.Size(300, 0);
+            this.ms_prodcode.Name = "ms_prodcode";
+            this.ms_prodcode.Size = new System.Drawing.Size(0, 41);
+            this.ms_prodcode.TabIndex = 239;
+            // 
+            // ms_makecode
+            // 
+            this.ms_makecode.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left)));
+            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(173, 163);
+            this.ms_makecode.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
+            this.ms_makecode.MaximumSize = new System.Drawing.Size(500, 0);
+            this.ms_makecode.Name = "ms_makecode";
+            this.ms_makecode.Size = new System.Drawing.Size(0, 41);
+            this.ms_makecode.TabIndex = 242;
+            // 
+            // cd_stepcode
+            // 
+            this.cd_stepcode.AllPower = "ifall";
+            this.cd_stepcode.Caller = null;
+            this.cd_stepcode.Condition = null;
+            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(947, 83);
+            this.cd_stepcode.Margin = new System.Windows.Forms.Padding(5);
+            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.TabIndex = 238;
+            this.cd_stepcode.TableName = null;
+            this.cd_stepcode.Tag = "";
+            this.cd_stepcode.TextBoxEnable = false;
+            // 
+            // cr_code
+            // 
+            this.cr_code.AllPower = "ifall";
+            this.cr_code.BackColor = System.Drawing.Color.White;
+            this.cr_code.Font = new System.Drawing.Font("微软雅黑", 9F);
+            this.cr_code.ID = null;
+            this.cr_code.Location = new System.Drawing.Point(564, 80);
+            this.cr_code.Margin = new System.Windows.Forms.Padding(5);
+            this.cr_code.Name = "cr_code";
+            this.cr_code.Power = "ifspecial";
+            this.cr_code.ReadOnly = true;
+            this.cr_code.Size = new System.Drawing.Size(296, 39);
+            this.cr_code.Str = null;
+            this.cr_code.Str1 = null;
+            this.cr_code.Str2 = null;
+            this.cr_code.TabIndex = 237;
+            this.cr_code.Tag = "ma_craftcode";
+            this.cr_code.TextChanged += new System.EventHandler(this.cr_code_TextChanged);
+            // 
+            // 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(21, 867);
+            this.OperatResult.Margin = new System.Windows.Forms.Padding(4);
+            this.OperatResult.Name = "OperatResult";
+            this.OperatResult.Size = new System.Drawing.Size(1551, 241);
+            this.OperatResult.TabIndex = 3;
+            this.OperatResult.Text = "";
+            // 
+            // input
+            // 
+            this.input.AllPower = null;
+            this.input.BackColor = System.Drawing.Color.White;
+            this.input.ID = null;
+            this.input.Location = new System.Drawing.Point(160, 85);
+            this.input.Margin = new System.Windows.Forms.Padding(4);
+            this.input.Name = "input";
+            this.input.Power = null;
+            this.input.Size = new System.Drawing.Size(292, 35);
+            this.input.Str = null;
+            this.input.Str1 = null;
+            this.input.Str2 = null;
+            this.input.TabIndex = 2;
+            this.input.KeyDown += new System.Windows.Forms.KeyEventHandler(this.input_KeyDown);
+            // 
+            // 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(947, 216);
+            this.Split.Margin = new System.Windows.Forms.Padding(4);
+            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(112, 44);
+            this.Split.TabIndex = 0;
+            this.Split.Text = "站点重置";
+            this.Split.UseVisualStyleBackColor = false;
+            this.Split.Click += new System.EventHandler(this.Split_Click);
+            // 
+            // ImportExcel1
+            // 
+            this.ImportExcel1.FileName = "ImportExcel";
+            // 
+            // Special_Reset
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(1611, 1131);
+            this.Controls.Add(this.ImportExcel);
+            this.Controls.Add(this.Export);
+            this.Controls.Add(this.数据清空);
+            this.Controls.Add(this.cd_stepno);
+            this.Controls.Add(this.WeighRecord);
+            this.Controls.Add(this.ms_makecode_label);
+            this.Controls.Add(this.ms_prodcode_label);
+            this.Controls.Add(this.ms_prodcode);
+            this.Controls.Add(this.ms_makecode);
+            this.Controls.Add(this.cd_stepcode);
+            this.Controls.Add(this.st_rstepcode_label);
+            this.Controls.Add(this.ma_craftcode_label);
+            this.Controls.Add(this.cr_code);
+            this.Controls.Add(this.bigboxBtn);
+            this.Controls.Add(this.serBtn);
+            this.Controls.Add(this.OperatResult);
+            this.Controls.Add(this.input);
+            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(4);
+            this.Name = "Special_Reset";
+            this.Tag = "Special!Reset";
+            this.Text = "重置站点";
+            this.Load += new System.EventHandler(this.Special_BoxSplit_Load);
+            this.SizeChanged += new System.EventHandler(this.Special_Reset_SizeChanged);
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private CustomControl.ButtonUtil.NormalButton Split;
+        private System.Windows.Forms.Label Pallet_label;
+        private CustomControl.TextBoxWithIcon.EnterTextBox input;
+        private CustomControl.RichText.RichTextAutoBottom OperatResult;
+        private System.Windows.Forms.RadioButton bigboxBtn;
+        private System.Windows.Forms.RadioButton serBtn;
+        private CustomControl.TextBoxWithIcon.SearchTextBox cd_stepcode;
+        private System.Windows.Forms.Label st_rstepcode_label;
+        private System.Windows.Forms.Label ma_craftcode_label;
+        private CustomControl.TextBoxWithIcon.EnterTextBox cr_code;
+        private System.Windows.Forms.Label ms_makecode_label;
+        private System.Windows.Forms.Label ms_prodcode_label;
+        private CustomControl.ValueLabel.ValueLabel ms_prodcode;
+        private CustomControl.ValueLabel.ValueLabel ms_makecode;
+        private System.Windows.Forms.ListView WeighRecord;
+        private System.Windows.Forms.ColumnHeader columnHeader3;
+        private System.Windows.Forms.Label cd_stepno;
+        private CustomControl.ButtonUtil.NormalButton 数据清空;
+        private CustomControl.ButtonUtil.NormalButton Export;
+        private CustomControl.ButtonUtil.NormalButton ImportExcel;
+        private System.Windows.Forms.FolderBrowserDialog ExportFileDialog;
+        private System.Windows.Forms.OpenFileDialog ImportExcel1;
+    }
+}

+ 458 - 0
UAS_MES_YDCY/FunctionCode/Special/Special_Reset.cs

@@ -0,0 +1,458 @@
+using DevExpress.XtraPrinting.Export.Pdf;
+using HslCommunication.Profinet.Knx;
+using NPOI.HSSF.UserModel;
+using NPOI.SS.UserModel;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Diagnostics;
+using System.Drawing;
+using System.IO;
+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;
+
+using NPOI.HSSF.UserModel;
+using NPOI.SS.UserModel;
+using NPOI.SS.Formula.Functions;
+
+namespace UAS_MES_NEW.Special
+{
+    public partial class Special_Reset : Form
+    {
+        DataHelper dh;
+
+        LogStringBuilder sql = new LogStringBuilder();
+        AutoSizeFormClass asc = new AutoSizeFormClass();
+        DataTable Dbfind;
+        DataTable dt;
+
+        List<String> sb = new List<string>();
+
+        public Special_Reset()
+        {
+            InitializeComponent();
+        }
+
+        private void Special_BoxSplit_Load(object sender, EventArgs e)
+        {
+
+            dh = SystemInf.dh;
+            asc.controllInitializeSize(this);
+            cd_stepcode.FormName = Name;
+            cd_stepcode.TableName = "craftdetail left join step on st_code=cd_stepcode left join craft on cd_crid=cr_id";
+            cd_stepcode.SetValueField = new string[] { "cd_stepcode", "cd_stepno" };
+            cd_stepcode.SelectField = "cd_stepname # 工序名称 ,cd_stepcode # 工序编号,cd_stepno # 执行顺序";
+            cd_stepcode.Condition = "ST_STATUSCODE='AUDITED' and cr_code='" + cr_code.Text + "' and cr_prodcode='" + ms_prodcode.Text + "' order by cd_stepno";
+            cd_stepcode.DBTitle = "回流工序";
+            cd_stepcode.DbChange += Cd_stepcode_DbChange;
+        }
+
+        private void Cd_stepcode_DbChange(object sender, EventArgs e)
+        {
+            Dbfind = cd_stepcode.ReturnData;
+            BaseUtil.SetFormValue(this.Controls, Dbfind);
+        }
+
+        private bool ReSN(string sncode, string stepcode)
+        {
+            DataTable dt = (DataTable)dh.ExecuteSql("select ms_paststep,ms_makecode from makeserial where ms_sncode ='" + sncode + "' order by ms_id desc", "select");
+            if (!dt.Rows[0]["ms_paststep"].ToString().Contains(cd_stepcode.Text))
+            {
+                OperatResult.AppendText(">>序列号" + sncode + "不允许回流到未执行工序\n", Color.Red);
+                return false;
+            }
+            string makecode = dt.Rows[0]["ms_makecode"].ToString();
+            string stname = dh.getFieldDataByCondition("step", "st_name", "st_code = '" + stepcode + "'").ToString();
+            dh.ExecuteSql("update makeserial set ms_status=1,ms_outboxcode='',ms_printcount = 0, ms_nextstepcode= '" + stepcode + "' where ms_sncode='" + sncode + "' and ms_makecode='" + makecode + "'", "update");
+            dh.ExecuteSql("delete makebad where mb_sncode = '" + sncode + "' and mb_makecode='" + makecode + "' 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 + "',");
+            sql.Append("cm_dropsccode='" + User.UserSourceCode + "' where cm_sncode = '" + sncode + "' and cm_makecode='" + makecode + "' and cm_stepcode in (select cd_stepcode from craftdetail left join step on st_code=cd_stepcode left join craft on cd_crid=cr_id where ST_STATUSCODE='AUDITED' and cr_code='" + cr_code.Text + "' and cr_prodcode='" + ms_prodcode.Text + "' and cd_detno >=" + cd_stepno.Text + " )");
+            dh.ExecuteSql(sql.GetString(), "update");
+            LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_makecode.Text, User.UserLineCode, User.UserSourceCode, "站点重置", "站点重置至" + stname, sncode, "");
+            return true;
+        }
+
+
+
+        private void Split_Click(object sender, EventArgs e)
+        {
+            if (sb.Count == 0 || cd_stepcode.Text == "")
+            {
+                OperatResult.AppendText(">>采集数与回流工位不能为空\n", Color.Red);
+                return;
+            }
+            string Delete = MessageBox.Show(this.ParentForm, "是否确认重置站点?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
+            if (Delete == "Yes")
+            {
+                if (serBtn.Checked)
+                {
+                    for (int i = 0; i < sb.Count; i++)
+                    {
+                        if (ReSN(sb[i].ToString(), cd_stepcode.Text))
+                            OperatResult.AppendText("SN:" + sb[i].ToString() + "回流至" + cd_stepcode.Text + "完成\n", Color.Green);
+                    }
+                    WeighRecord.Clear();
+                    sb.Clear();
+                }
+                else if (bigboxBtn.Checked)
+                {
+                    string stname = dh.getFieldDataByCondition("step", "st_name", "st_code = '" + cd_stepcode.Text + "'").ToString();
+                    for (int i = 0; i < sb.Count; i++)
+                    {
+                        if (dh.CheckExist("package", "pa_outboxcode='" + sb[i].ToString() + "' and pa_status=1"))
+                        {
+                            DataTable dt2 = (DataTable)dh.ExecuteSql("select ms_sncode from makeserial left Join package on pa_outboxcode=ms_outboxcode where ms_outboxcode = '" + sb[i].ToString() + "' and pa_status=1", "select");
+                            for (int k = 0; k < dt2.Rows.Count; k++)
+                            {
+                                ReSN(dt2.Rows[k]["ms_sncode"].ToString(), cd_stepcode.Text);
+                            }
+                            dh.ExecuteSql("delete from labelprintlog where lpl_value='" + sb[i].ToString() + "'", "delete");
+                            dh.ExecuteSql("insert into PACKAGEBACKUP(PA_ID, PA_PRODCODE, PA_OUTBOXCODE, PA_PACKDATE, PA_LEVEL, PA_PACKAGEQTY, PA_TOTALQTY, PA_MAKECODE, PA_STATUS, PA_INDATE, PA_SALECODE, PA_PRINTCOUNT, PA_CUSTCODE, PA_TYPE, PA_WEIGHT, PA_CURRENTQTY, PA_PACKTYPE, PA_CHECKNO, PA_DOWNSTATUS, PA_STANDARDQTY, PA_SCCODE, PA_YMD, PA_MOTHERCODE, PA_CURRENTSTEP, PA_NEXTSTEP, PA_OUTNO, PA_IOSTATUS, PA_REMARK, PA_WHCODE, PA_B2BID, PA_INNO)" +
+                                " select PA_ID, PA_PRODCODE, PA_OUTBOXCODE, PA_PACKDATE, PA_LEVEL, PA_PACKAGEQTY, PA_TOTALQTY, PA_MAKECODE, PA_STATUS, PA_INDATE, PA_SALECODE, PA_PRINTCOUNT, PA_CUSTCODE, PA_TYPE, PA_WEIGHT, PA_CURRENTQTY, PA_PACKTYPE, PA_CHECKNO, PA_DOWNSTATUS, PA_STANDARDQTY, PA_SCCODE, PA_YMD, PA_MOTHERCODE, PA_CURRENTSTEP, PA_NEXTSTEP, PA_OUTNO, PA_IOSTATUS, PA_REMARK, PA_WHCODE, PA_B2BID, PA_INNO from package where pa_outboxcode='" + sb[i].ToString() + "'", "insert");
+                            dh.ExecuteSql("insert into PACKAGEBACKUPDETAIL select * from packagedetail where pd_outboxcode='" + sb[i].ToString() + "'", "insert");
+                            dh.ExecuteSql("delete from package where pa_outboxcode = '" + sb[i].ToString() + "'", "delete");
+                            //删除箱的明细
+                            dh.ExecuteSql("delete from packagedetail where pd_outboxcode='" + sb[i].ToString() + "'", "delete");
+                            LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_makecode.Text, User.UserLineCode, User.UserSourceCode, "站点重置", "站点重置至" + stname, sb[i].ToString(), "");
+                            OperatResult.AppendText("卡通箱:" + sb[i].ToString() + "回流至" + cd_stepcode.Text + "完成\n", Color.Green);
+                        }
+                        else
+                        {
+                            OperatResult.AppendText("卡通箱:" + sb[i].ToString() + "未封箱,不允许回流\n", Color.Green);
+                        }
+                    }
+                    WeighRecord.Clear();
+                    sb.Clear();
+                }
+                sql.Clear();
+                sql.Append("MERGE INTO makecraftdetail USING (select mcd_macode,mcd_detno,mcd_stepcode,mcd_stepname,nvl(count(distinct A.ms_sncode),0) n,nvl(count(distinct B.ms_sncode),0) bn,(select nvl(count(distinct sp_sncode),0) from STEPPASSED where SP_MAKECODE = mcd_macode AND SP_STEPCODE = mcd_stepcode) inqty from MAKECRAFTdetail");
+                sql.Append(" left join makeserial A on mcd_macode = A.ms_makecode and mcd_stepcode = A.ms_nextstepcode AND A.MS_STATUS = 1 LEFT JOIN MAKESERIAL B ON mcd_macode = B.ms_makecode AND MCD_STEPCODE = B.MS_STEPCODE AND B.MS_STATUS = 3 where mcd_macode = '" + ms_makecode.Text + "'  group by mcd_macode,mcd_detno, mcd_stepcode, mcd_stepname order by mcd_detno asc) A");
+                sql.Append(" ON (makecraftdetail.MCD_MACODE = A.MCD_MACODE and makecraftdetail.mcd_stepcode = A.mcd_stepcode)  ");
+                sql.Append(" WHEN MATCHED THEN UPDATE SET makecraftdetail.mcd_inqty = A.inqty,makecraftdetail.mcd_outqty = A.inqty,makecraftdetail.mcd_okqty = A.inqty ");
+                dh.ExecuteSql(sql.GetString(), "update");
+            }
+        }
+
+        private void bigboxBtn_Click(object sender, EventArgs e)
+        {
+            if (((RadioButton)sender).Checked == true)
+            {
+                if (WeighRecord.Items.Count > 0)
+                {
+                    string logout_confirm = MessageBox.Show(this.ParentForm, "是否更换采集项(已录入信息会清空)?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
+                    if (logout_confirm == "Yes")
+                    {
+                        WeighRecord.Items.Clear();
+                        sb.Clear();
+                        ms_makecode.Text = "";
+                        ms_prodcode.Text = "";
+                        cr_code.Text = "";
+                        cd_stepcode.Text = "";
+                    }
+                    else
+                    {
+                        serBtn.Checked = bigboxBtn.Checked;
+                        bigboxBtn.Checked = !serBtn.Checked;
+                    }
+                }
+                if (((RadioButton)sender).Name == "serBtn")
+                {
+                    input.Focus();
+                    OperatResult.AppendText("请输入序列号进行采集\n", Color.Black, input);
+                }
+                else if (((RadioButton)sender).Name == "bigboxBtn")
+                {
+                    input.Focus();
+                    OperatResult.AppendText("请输入箱号进行采集\n", Color.Black, input);
+                }
+            }
+        }
+
+        private void cr_code_TextChanged(object sender, EventArgs e)
+        {
+            cd_stepcode.Condition = "ST_STATUSCODE='AUDITED' and cr_code='" + cr_code.Text + "' and cr_prodcode='" + ms_prodcode.Text + "' order by cd_stepno";
+        }
+
+        private void input_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.KeyCode == Keys.Enter)
+            {
+                if (serBtn.Checked)
+                {
+                    dt = (DataTable)dh.ExecuteSql("select ms_sncode from makeserial where ms_imei1='" + input.Text + "' order by ms_id desc", "select");
+                    if (dt.Rows.Count > 0)
+                    {
+                        input.Text = dt.Rows[0]["ms_sncode"].ToString();
+                    }
+                    else
+                    {
+                        dt = (DataTable)dh.ExecuteSql("select ms_sncode from makeserial where ms_imei2='" + input.Text + "' order by ms_id desc", "select");
+                        if (dt.Rows.Count > 0)
+                        {
+                            input.Text = dt.Rows[0]["ms_sncode"].ToString();
+                        }
+                        else
+                        {
+                            dt = (DataTable)dh.ExecuteSql("select mil_sncode from makeimeilist where mil_imei1='" + input.Text + "' order by mil_id desc", "select");
+                            if (dt.Rows.Count > 0)
+                            {
+                                input.Text = dt.Rows[0]["mil_sncode"].ToString();
+                            }
+                            else
+                            {
+                                dt = (DataTable)dh.ExecuteSql("select mil_sncode from makeimeilist where mil_imei2='" + input.Text + "' order by mil_id desc", "select");
+                                if (dt.Rows.Count > 0)
+                                {
+                                    input.Text = dt.Rows[0]["mil_sncode"].ToString();
+                                }
+                            }
+                        }
+                    }
+                    dt = (DataTable)dh.ExecuteSql("select ms_makecode,ms_prodcode,ms_sncode,ms_craftcode cr_code,ms_status,ms_outboxcode from makeserial where ms_sncode = '" + input.Text + "' or ms_imei1='" + input.Text + "' or ms_imei2='" + input.Text + "' order by ms_id desc", "select");
+                    if (dt.Rows.Count > 0)
+                    {
+                        input.Text = dt.Rows[0]["ms_sncode"].ToString();
+                        if (ms_makecode.Text != "" && dt.Rows[0]["ms_makecode"].ToString() != ms_makecode.Text)
+                        {
+                            OperatResult.AppendText("SN:" + input.Text + "所属工单" + dt.Rows[0]["ms_makecode"].ToString() + "与当前工单" + ms_makecode.Text + "不一致\n", Color.Red, input);
+                            return;
+                        }
+                        if (dt.Rows[0]["ms_status"].ToString() == "3")
+                        {
+                            OperatResult.AppendText("SN:" + input.Text + "为不良品,不允许采集\n", Color.Red, input);
+                            return;
+                        }
+                        if (dt.Rows[0]["ms_outboxcode"].ToString() != "")
+                        {
+                            OperatResult.AppendText("SN:" + input.Text + "已装箱" + dt.Rows[0]["ms_outboxcode"].ToString() + ",不允许采集\n", Color.Red, input);
+                            return;
+                        }
+                        BaseUtil.SetFormValue(this.Controls, dt);
+                        if (sb.Contains(dt.Rows[0]["ms_sncode"].ToString()))
+                        {
+                            OperatResult.AppendText("SN:" + input.Text + "已采集\n", Color.Red, input);
+                            return;
+                        }
+                        WeighRecord.Items.Add(dt.Rows[0]["ms_sncode"].ToString());
+                        sb.Add(dt.Rows[0]["ms_sncode"].ToString());
+                        OperatResult.AppendText("SN:" + input.Text + "采集\n", Color.Green, input);
+                        cd_stepcode.Condition = "ST_STATUSCODE='AUDITED' and cr_code='" + cr_code.Text + "' and cr_prodcode='" + ms_prodcode.Text + "' order by cd_stepno";
+                    }
+                    else
+                    {
+                        OperatResult.AppendText("SN:" + input.Text + "不存在\n", Color.Red, input);
+                        return;
+                    }
+                }
+                else if (bigboxBtn.Checked)
+                {
+                    dt = (DataTable)dh.ExecuteSql("select pa_makecode ms_makecode,pa_prodcode ms_prodcode,pa_outboxcode,pa_mothercode,ma_craftcode,nvl(pa_iostatus,0)pa_iostatus,ma_craftcode cr_code from package left join make on pa_makecode = ma_code where pa_outboxcode = '" + input.Text + "' and pa_type = '1'", "select");
+                    if (dt.Rows.Count > 0)
+                    {
+                        if (ms_makecode.Text != "" && dt.Rows[0]["ms_makecode"].ToString() != ms_makecode.Text)
+                        {
+                            OperatResult.AppendText("SN:" + input.Text + "所属工单" + dt.Rows[0]["ms_makecode"].ToString() + "与当前工单" + ms_makecode.Text + "不一致\n", Color.Red, input);
+                            return;
+                        }
+                        if (dt.Rows[0]["pa_iostatus"].ToString() != "0")
+                        {
+                            OperatResult.AppendText("卡通箱:" + input.Text + "处于状态入库状态,不允许采集\n", Color.Red, input);
+                            return;
+                        }
+                        if (dt.Rows[0]["pa_mothercode"].ToString() != "")
+                        {
+                            OperatResult.AppendText("卡通箱:" + input.Text + "已装栈板" + dt.Rows[0]["pa_mothercode"].ToString() + ",不允许采集\n", Color.Red, input);
+                            return;
+                        }
+                        BaseUtil.SetFormValue(this.Controls, dt);
+                        if (sb.Contains(dt.Rows[0]["pa_outboxcode"].ToString()))
+                        {
+                            OperatResult.AppendText("卡通箱:" + input.Text + "已采集\n", Color.Red, input);
+                            return;
+                        }
+                        WeighRecord.Items.Add(dt.Rows[0]["pa_outboxcode"].ToString());
+                        sb.Add(dt.Rows[0]["pa_outboxcode"].ToString());
+                        OperatResult.AppendText("卡通箱:" + input.Text + "采集\n", Color.Green, input);
+                        cd_stepcode.Condition = "ST_STATUSCODE='AUDITED' and cr_code='" + cr_code.Text + "' and cr_prodcode='" + ms_prodcode.Text + "' order by cd_stepno";
+                    }
+                    else
+                    {
+                        OperatResult.AppendText("卡通箱:" + input.Text + "不存在\n", Color.Red, input);
+                        return;
+                    }
+                }
+            }
+        }
+
+        private void 数据清空_Click(object sender, EventArgs e)
+        {
+            BaseUtil.CleanControls(this.Controls);
+            WeighRecord.Items.Clear();
+            sb.Clear();
+        }
+
+        private void Special_Reset_SizeChanged(object sender, EventArgs e)
+        {
+            asc.controlAutoSize(this);
+        }
+
+        private void Export_Click(object sender, EventArgs e)
+        {
+            ExportFileDialog.Description = "选择导出的路径";
+            DialogResult result = ExportFileDialog.ShowDialog();
+            if (result == DialogResult.OK)
+            {
+                ExcelHandler eh = new ExcelHandler();
+                sql.Clear();
+                sql.Append("select ''箱号,'' SN from dual ");
+                dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                eh.ExportExcel(dt, ExportFileDialog.SelectedPath + "\\导出模板.xls");
+                //string close = MessageBox.Show(this.ParentForm, "导出成功,是否打开文件", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
+            }
+        }
+
+        private void ImportExcel_Click(object sender, EventArgs e)
+        {
+            ImportExcel1.Filter = "(*.xls)|*.xls";
+            DialogResult result;
+            result = ImportExcel1.ShowDialog();
+            if (result == DialogResult.OK)
+            {
+                DataTable dt = ExcelToDataTable(ImportExcel1.FileName, true);
+                for (int i = 0; i < dt.Rows.Count; i++)
+                {
+                    if (bigboxBtn.Checked)
+                    {
+                        input.Text = dt.Rows[i]["箱号"].ToString();
+                        input_KeyDown(sender, new KeyEventArgs(Keys.Enter));
+                    }
+                    if (serBtn.Checked)
+                    {
+                        input.Text = dt.Rows[i]["SN"].ToString();
+                        input_KeyDown(sender, new KeyEventArgs(Keys.Enter));
+                    }
+                }
+            }
+        }
+
+        public static DataTable ExcelToDataTable(string filePath, bool isColumnName)
+        {
+            DataTable dataTable = null;
+            FileStream fs = null;
+            DataColumn column = null;
+            DataRow dataRow = null;
+            IWorkbook workbook = null;
+            ISheet sheet = null;
+            IRow row = null;
+            ICell cell = null;
+            int startRow = 0;
+            try
+            {
+                using (fs = File.OpenRead(filePath))
+                {
+                    // 2007版本
+                    workbook = new HSSFWorkbook(fs);
+                    if (workbook != null)
+                    {
+                        sheet = workbook.GetSheetAt(0);//读取第一个sheet,当然也可以循环读取每个sheet
+                        dataTable = new DataTable();
+                        if (sheet != null)
+                        {
+                            int rowCount = sheet.LastRowNum;//总行数
+                            if (rowCount > 0)
+                            {
+                                IRow firstRow = sheet.GetRow(0);//第一行
+                                int cellCount = firstRow.LastCellNum;//列数
+
+                                //构建datatable的列
+                                if (isColumnName)
+                                {
+                                    startRow = 1;//如果第一行是列名,则从第二行开始读取
+                                    for (int i = firstRow.FirstCellNum; i < cellCount; ++i)
+                                    {
+                                        cell = firstRow.GetCell(i);
+                                        if (cell != null)
+                                        {
+                                            if (cell.StringCellValue != null)
+                                            {
+                                                column = new DataColumn(cell.StringCellValue);
+                                                dataTable.Columns.Add(column);
+                                            }
+                                        }
+                                    }
+                                }
+                                else
+                                {
+                                    for (int i = firstRow.FirstCellNum; i < cellCount; ++i)
+                                    {
+                                        column = new DataColumn("column" + (i + 1));
+                                        dataTable.Columns.Add(column);
+                                    }
+                                }
+                                //填充行
+                                for (int i = startRow; i <= rowCount; ++i)
+                                {
+                                    row = sheet.GetRow(i);
+                                    if (row == null) continue;
+
+                                    dataRow = dataTable.NewRow();
+                                    for (int j = row.FirstCellNum; j < cellCount; ++j)
+                                    {
+                                        cell = row.GetCell(j);
+                                        if (cell == null)
+                                        {
+                                            dataRow[j] = "";
+                                        }
+                                        else
+                                        {
+                                            //CellType(Unknown = -1,Numeric = 0,String = 1,Formula = 2,Blank = 3,Boolean = 4,Error = 5,)
+                                            switch (cell.CellType)
+                                            {
+                                                case CellType.BLANK:
+                                                    dataRow[j] = "";
+                                                    break;
+                                                case CellType.NUMERIC:
+                                                    short format = cell.CellStyle.DataFormat;
+                                                    //对时间格式(2015.12.5、2015/12/5、2015-12-5等)的处理
+                                                    if (format == 14 || format == 31 || format == 57 || format == 58)
+                                                        dataRow[j] = cell.DateCellValue;
+                                                    else
+                                                        dataRow[j] = cell.NumericCellValue;
+                                                    break;
+                                                case CellType.STRING:
+                                                    dataRow[j] = cell.StringCellValue;
+                                                    break;
+                                                case CellType.FORMULA:
+                                                    dataRow[j] = cell.StringCellValue;
+                                                    break;
+                                            }
+                                        }
+                                    }
+                                    dataTable.Rows.Add(dataRow);
+                                }
+                            }
+                        }
+                    }
+                }
+                return dataTable;
+            }
+            catch (Exception ex)
+            {
+                Console.WriteLine(ex.Message);
+                if (fs != null)
+                {
+                    fs.Close();
+                }
+                return null;
+            }
+        }
+    }
+}

+ 279 - 0
UAS_MES_YDCY/FunctionCode/Special/Special_Reset.resx

@@ -0,0 +1,279 @@
+<?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="ExportFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </metadata>
+  <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+  <data name="ImportExcel.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="ImportExcel.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="ImportExcel.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="Export.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFcSURBVFhH5di7UsJAFMbxtDT6QMI76IAFT0npIE0K
+        GcRORxHklpAIBHLfbILV8XxeNsMznJ35F5vu+82kWYuILD4N7oq75roCw27sb/x5WBdc27btntY64o/i
+        DnZjPxy4S6A0R6PHO1WUNHc9ep4uxIXd2D8eP/XZowWUThBG+n3p0stsKbbJ0qFDFFfscQuUbpzm9Pqx
+        Eh8c4PGLkuX0Nl+LDw4GJckUTRaO+OBQo+SKpitXfHAwKClfZuuN+OBgUDJV0NzxxAeHM5TFxhffGUpe
+        aFp5n+KDg0FRfHH8nfjgUKPoktztXnxwMCgFX7xdID441ChlRf7+ID44GBTNl21wFB8capSqot0xFB8c
+        /lE6Wa70IU5oH0Ziw/5cFebpoPUwHPbL04nCJKUgisWF3dgPB3gABc9v7fvBoBcnaVKdvkha2I39cPjx
+        oPrhusndcPinpIXd2N8gIusbTaFspKtR2SQAAAAASUVORK5CYII=
+</value>
+  </data>
+  <data name="Export.MoveImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFzSURBVFhH5djNSgJRGMZxL2P2gTfQFbZvHSEZFBEW
+        CEIQBEIgVFiS9qXWoDmp4/fHzDmjM2a+vU/QqUVX0DvwXxxn9fwYXJwYEcXWNzIWt83dcq7AsBv7LXgA
+        ZI0r71/aaqjCJf8o7sFu7IcDFwdK4vimrv1oSZXRnArdQFzYjf3pQkOzRxIoVWc6X5X6M7ruBGIr9mbU
+        9MIVe9hAcXvBO125WnxwgMcXSpcPF20tPjgYlI5eUK6lxAcHg9Lmw3nTFx8cDEpLLSjr+OKDg0FpqojO
+        Gp744GBQ3vyITutT8cHBoDheRCe1ifjgYFBe+ZCxJ+KDg0GpT0NKv4zFBweDUpuEdFQdiQ8OBsXmw2Fl
+        JD44/KCM53TwNBQfHAzKMx/2Hgfig8M3SrXYUasUfz67DwOxYf9dV5urg+RWzta4aEnxn83OfV9c2I39
+        cIAHUOJceTNbUfmW94GX0sJu7IcDPH5fXCe4EvfXxe5/D7ux3yKi2CfkPhTy27lqkwAAAABJRU5ErkJg
+        gg==
+</value>
+  </data>
+  <data name="Export.NormalImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAGVSURBVFhH5di7agJRFIXhDSKoYBQEC8FCECwEQRBE
+        4uUVEtTiPKVlom2wttM6IfF+15njXHRnL19jD/zFmanWV8zAEDNTp9OJS6/Sm2QUht3YH4cHtdvtF6k7
+        mUwG1tqd3FR3YTf2w0FKUVOu6XT68Xgw3+8PtWH/bDYbCkeLGo1Gz/d9JwzvrL0gCKx49KlerxtIBUGo
+        PjjAg2q1mqDc2fN99cEBHlStVk0oB+t56oMDPKhSqZggDNm1N/XBAR5ULpeNvGD46rrqgwM8qFQqGV8O
+        56ujPjjAg4rFosFL5ni5qA8O8KBCoWBuns/701l9cIAH5fN5QfF4dzipDw7woFwuZ+zN483+oD44wIOy
+        2azB52i13asPDvCgTCZjHGt5sdmqDw7woHQ6bRzX8ny1UR8c4EHJZNJc5fC7XKsPDvCgRCLR2x9Pzt9q
+        zT+Lpdqw/3A6W/HoUywWa32Nx8OL4zwffM8X6sJu7IcDPCgajaak7udoNNjsdgc81BZ2Yz8c4PH8cR2J
+        ROJSU3qXjMKwG/vjzEz/skOI3Zqgv7AAAAAASUVORK5CYII=
+</value>
+  </data>
+  <data name="数据清空.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="数据清空.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="数据清空.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="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="ImportExcel1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>792, 17</value>
+  </metadata>
+</root>

+ 9 - 0
UAS_MES_YDCY/UAS_MES_YDCY.csproj

@@ -1175,6 +1175,12 @@
     <Compile Include="FunctionCode\Special\Special_QCRecheck.Designer.cs">
       <DependentUpon>Special_QCRecheck.cs</DependentUpon>
     </Compile>
+    <Compile Include="FunctionCode\Special\Special_Reset.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="FunctionCode\Special\Special_Reset.Designer.cs">
+      <DependentUpon>Special_Reset.cs</DependentUpon>
+    </Compile>
     <Compile Include="FunctionCode\Special\Special_SeqTransform.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -1813,6 +1819,9 @@
     <EmbeddedResource Include="FunctionCode\Special\Special_QCRecheck.resx">
       <DependentUpon>Special_QCRecheck.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="FunctionCode\Special\Special_Reset.resx">
+      <DependentUpon>Special_Reset.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="FunctionCode\Special\Special_SeqTransform.resx">
       <DependentUpon>Special_SeqTransform.cs</DependentUpon>
     </EmbeddedResource>

+ 8 - 0
UAS_MES_ZDXW/FunctionCode/Query/ArrayList.cs

@@ -0,0 +1,8 @@
+using System.Collections;
+
+namespace UAS_MES_NEW.Query
+{
+    internal class ArrayList<T> : ArrayList
+    {
+    }
+}

+ 305 - 210
UAS_MES_ZDXW/FunctionCode/Query/Query_SN.Designer.cs

@@ -29,206 +29,142 @@
         private void InitializeComponent()
         {
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Query_SN));
-            this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog();
-            this.label5 = new System.Windows.Forms.Label();
-            this.label3 = new System.Windows.Forms.Label();
-            this.date = new System.Windows.Forms.DateTimePicker();
-            this.label6 = new System.Windows.Forms.Label();
+            this.ma_salecode_label = new System.Windows.Forms.Label();
+            this.ma_qty = new System.Windows.Forms.Label();
             this.label7 = new System.Windows.Forms.Label();
-            this.label9 = new System.Windows.Forms.Label();
-            this.label10 = new System.Windows.Forms.Label();
-            this.label11 = new System.Windows.Forms.Label();
-            this.currentSerial = new System.Windows.Forms.NumericUpDown();
-            this.Printer = new UAS_MES_NEW.CustomControl.ComBoxWithFocus.PrinterCombox();
-            this.Print = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
-            this.ma_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
-            this.num = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
-            this.seriallength = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.label5 = new System.Windows.Forms.Label();
+            this.pr_detail = new System.Windows.Forms.Label();
+            this.label4 = new System.Windows.Forms.Label();
+            this.label8 = new System.Windows.Forms.Label();
             this.pr_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.ma_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SearchTextBox();
             this.Export = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
-            ((System.ComponentModel.ISupportInitialize)(this.currentSerial)).BeginInit();
+            this.Setting = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
+            this.PrinterList = new UAS_MES_NEW.CustomControl.ComBoxWithFocus.PrinterCombox();
+            this.PrintTest = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
+            this.OneColumn = new System.Windows.Forms.RadioButton();
+            this.TwoColumn = new System.Windows.Forms.RadioButton();
+            this.ThreeColumn = new System.Windows.Forms.RadioButton();
+            this.FourColumn = new System.Windows.Forms.RadioButton();
+            this.GenSN = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
+            this.label1 = new System.Windows.Forms.Label();
+            this.ma_count = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.msl_type = new System.Windows.Forms.ComboBox();
+            this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog();
             this.SuspendLayout();
             // 
-            // label5
-            // 
-            this.label5.AutoSize = true;
-            this.label5.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label5.Location = new System.Drawing.Point(106, 112);
-            this.label5.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
-            this.label5.Name = "label5";
-            this.label5.Size = new System.Drawing.Size(146, 41);
-            this.label5.TabIndex = 11;
-            this.label5.Text = "产品代码";
-            // 
-            // label3
-            // 
-            this.label3.AutoSize = true;
-            this.label3.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label3.Location = new System.Drawing.Point(106, 274);
-            this.label3.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
-            this.label3.Name = "label3";
-            this.label3.Size = new System.Drawing.Size(146, 41);
-            this.label3.TabIndex = 13;
-            this.label3.Text = "流水长度";
-            // 
-            // date
-            // 
-            this.date.Location = new System.Drawing.Point(305, 197);
-            this.date.Name = "date";
-            this.date.Size = new System.Drawing.Size(388, 35);
-            this.date.TabIndex = 17;
-            this.date.Value = new System.DateTime(2020, 9, 7, 0, 0, 0, 0);
-            // 
-            // label6
-            // 
-            this.label6.AutoSize = true;
-            this.label6.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label6.Location = new System.Drawing.Point(106, 195);
-            this.label6.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
-            this.label6.Name = "label6";
-            this.label6.Size = new System.Drawing.Size(82, 41);
-            this.label6.TabIndex = 18;
-            this.label6.Text = "日期";
+            // ma_salecode_label
+            // 
+            this.ma_salecode_label.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+            this.ma_salecode_label.AutoSize = true;
+            this.ma_salecode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ma_salecode_label.Location = new System.Drawing.Point(142, 143);
+            this.ma_salecode_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.ma_salecode_label.Name = "ma_salecode_label";
+            this.ma_salecode_label.Size = new System.Drawing.Size(178, 41);
+            this.ma_salecode_label.TabIndex = 20;
+            this.ma_salecode_label.Text = "打印机列表";
+            // 
+            // ma_qty
+            // 
+            this.ma_qty.AutoSize = true;
+            this.ma_qty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ma_qty.Location = new System.Drawing.Point(349, 270);
+            this.ma_qty.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.ma_qty.Name = "ma_qty";
+            this.ma_qty.Size = new System.Drawing.Size(0, 41);
+            this.ma_qty.TabIndex = 236;
             // 
             // label7
             // 
             this.label7.AutoSize = true;
             this.label7.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label7.Location = new System.Drawing.Point(106, 344);
+            this.label7.Location = new System.Drawing.Point(171, 270);
             this.label7.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label7.Name = "label7";
-            this.label7.Size = new System.Drawing.Size(126, 41);
-            this.label7.TabIndex = 19;
-            this.label7.Text = "SN数量";
-            // 
-            // label9
-            // 
-            this.label9.AutoSize = true;
-            this.label9.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label9.Location = new System.Drawing.Point(106, 44);
-            this.label9.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
-            this.label9.Name = "label9";
-            this.label9.Size = new System.Drawing.Size(114, 41);
-            this.label9.TabIndex = 23;
-            this.label9.Text = "工单号";
-            // 
-            // label10
-            // 
-            this.label10.AutoSize = true;
-            this.label10.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label10.Location = new System.Drawing.Point(106, 415);
-            this.label10.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
-            this.label10.Name = "label10";
-            this.label10.Size = new System.Drawing.Size(146, 41);
-            this.label10.TabIndex = 25;
-            this.label10.Text = "当前流水";
-            // 
-            // label11
-            // 
-            this.label11.AutoSize = true;
-            this.label11.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label11.Location = new System.Drawing.Point(836, 44);
-            this.label11.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
-            this.label11.Name = "label11";
-            this.label11.Size = new System.Drawing.Size(178, 41);
-            this.label11.TabIndex = 29;
-            this.label11.Text = "打印机列表";
-            // 
-            // currentSerial
-            // 
-            this.currentSerial.Location = new System.Drawing.Point(305, 421);
-            this.currentSerial.Name = "currentSerial";
-            this.currentSerial.Size = new System.Drawing.Size(388, 35);
-            this.currentSerial.TabIndex = 30;
-            // 
-            // Printer
-            // 
-            this.Printer.Location = new System.Drawing.Point(1030, 47);
-            this.Printer.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
-            this.Printer.Name = "Printer";
-            this.Printer.Size = new System.Drawing.Size(378, 45);
-            this.Printer.TabIndex = 28;
-            // 
-            // Print
-            // 
-            this.Print.AllPower = null;
-            this.Print.BackColor = System.Drawing.Color.Transparent;
-            this.Print.DownImage = ((System.Drawing.Image)(resources.GetObject("Print.DownImage")));
-            this.Print.Image = null;
-            this.Print.IsShowBorder = true;
-            this.Print.Location = new System.Drawing.Point(519, 488);
-            this.Print.Margin = new System.Windows.Forms.Padding(6);
-            this.Print.MoveImage = ((System.Drawing.Image)(resources.GetObject("Print.MoveImage")));
-            this.Print.Name = "Print";
-            this.Print.NormalImage = ((System.Drawing.Image)(resources.GetObject("Print.NormalImage")));
-            this.Print.Power = null;
-            this.Print.Size = new System.Drawing.Size(150, 56);
-            this.Print.TabIndex = 27;
-            this.Print.Text = "打印";
-            this.Print.UseVisualStyleBackColor = false;
-            this.Print.Visible = false;
-            this.Print.Click += new System.EventHandler(this.Print_Click);
+            this.label7.Size = new System.Drawing.Size(146, 41);
+            this.label7.TabIndex = 234;
+            this.label7.Text = "工单数量";
             // 
-            // ma_code
+            // label5
             // 
-            this.ma_code.AllPower = null;
-            this.ma_code.BackColor = System.Drawing.Color.White;
-            this.ma_code.ID = null;
-            this.ma_code.Location = new System.Drawing.Point(305, 47);
-            this.ma_code.Margin = new System.Windows.Forms.Padding(6);
-            this.ma_code.Name = "ma_code";
-            this.ma_code.Power = null;
-            this.ma_code.Size = new System.Drawing.Size(388, 35);
-            this.ma_code.Str = null;
-            this.ma_code.Str1 = null;
-            this.ma_code.Str2 = null;
-            this.ma_code.TabIndex = 24;
-            // 
-            // num
-            // 
-            this.num.AllPower = null;
-            this.num.BackColor = System.Drawing.Color.White;
-            this.num.ID = null;
-            this.num.Location = new System.Drawing.Point(305, 345);
-            this.num.Margin = new System.Windows.Forms.Padding(6);
-            this.num.Name = "num";
-            this.num.Power = null;
-            this.num.Size = new System.Drawing.Size(388, 35);
-            this.num.Str = null;
-            this.num.Str1 = null;
-            this.num.Str2 = null;
-            this.num.TabIndex = 20;
-            // 
-            // seriallength
-            // 
-            this.seriallength.AllPower = null;
-            this.seriallength.BackColor = System.Drawing.Color.White;
-            this.seriallength.ID = null;
-            this.seriallength.Location = new System.Drawing.Point(305, 275);
-            this.seriallength.Margin = new System.Windows.Forms.Padding(6);
-            this.seriallength.Name = "seriallength";
-            this.seriallength.Power = null;
-            this.seriallength.Size = new System.Drawing.Size(388, 35);
-            this.seriallength.Str = null;
-            this.seriallength.Str1 = null;
-            this.seriallength.Str2 = null;
-            this.seriallength.TabIndex = 14;
-            this.seriallength.Text = "6";
+            this.label5.AutoSize = true;
+            this.label5.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label5.Location = new System.Drawing.Point(171, 204);
+            this.label5.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label5.Name = "label5";
+            this.label5.Size = new System.Drawing.Size(146, 41);
+            this.label5.TabIndex = 232;
+            this.label5.Text = "工单编号";
+            // 
+            // pr_detail
+            // 
+            this.pr_detail.AutoSize = true;
+            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(349, 463);
+            this.pr_detail.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.pr_detail.Name = "pr_detail";
+            this.pr_detail.Size = new System.Drawing.Size(0, 41);
+            this.pr_detail.TabIndex = 241;
+            // 
+            // label4
+            // 
+            this.label4.AutoSize = true;
+            this.label4.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label4.Location = new System.Drawing.Point(171, 463);
+            this.label4.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label4.Name = "label4";
+            this.label4.Size = new System.Drawing.Size(146, 41);
+            this.label4.TabIndex = 240;
+            this.label4.Text = "产品名称";
+            // 
+            // label8
+            // 
+            this.label8.AutoSize = true;
+            this.label8.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label8.Location = new System.Drawing.Point(171, 386);
+            this.label8.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label8.Name = "label8";
+            this.label8.Size = new System.Drawing.Size(146, 41);
+            this.label8.TabIndex = 238;
+            this.label8.Text = "产品代码";
             // 
             // pr_code
             // 
             this.pr_code.AllPower = null;
             this.pr_code.BackColor = System.Drawing.Color.White;
             this.pr_code.ID = null;
-            this.pr_code.Location = new System.Drawing.Point(305, 118);
-            this.pr_code.Margin = new System.Windows.Forms.Padding(6);
+            this.pr_code.Location = new System.Drawing.Point(356, 395);
             this.pr_code.Name = "pr_code";
             this.pr_code.Power = null;
             this.pr_code.Size = new System.Drawing.Size(388, 35);
             this.pr_code.Str = null;
             this.pr_code.Str1 = null;
             this.pr_code.Str2 = null;
-            this.pr_code.TabIndex = 12;
+            this.pr_code.TabIndex = 239;
+            // 
+            // ma_code
+            // 
+            this.ma_code.AllPower = "IFALL";
+            this.ma_code.Caller = null;
+            this.ma_code.Condition = null;
+            this.ma_code.DBTitle = "";
+            this.ma_code.Font = new System.Drawing.Font("微软雅黑", 9F);
+            this.ma_code.FormName = null;
+            this.ma_code.Location = new System.Drawing.Point(356, 204);
+            this.ma_code.Margin = new System.Windows.Forms.Padding(6);
+            this.ma_code.Name = "ma_code";
+            this.ma_code.Power = "";
+            this.ma_code.ReturnData = null;
+            this.ma_code.SelectField = null;
+            this.ma_code.SetValueField = null;
+            this.ma_code.Size = new System.Drawing.Size(409, 46);
+            this.ma_code.TabIndex = 233;
+            this.ma_code.TableName = null;
+            this.ma_code.Tag = "makecode";
+            this.ma_code.TextBoxEnable = true;
             // 
             // Export
             // 
@@ -237,69 +173,228 @@
             this.Export.DownImage = ((System.Drawing.Image)(resources.GetObject("Export.DownImage")));
             this.Export.Image = null;
             this.Export.IsShowBorder = true;
-            this.Export.Location = new System.Drawing.Point(305, 488);
+            this.Export.Location = new System.Drawing.Point(603, 658);
             this.Export.Margin = new System.Windows.Forms.Padding(6);
             this.Export.MoveImage = ((System.Drawing.Image)(resources.GetObject("Export.MoveImage")));
             this.Export.Name = "Export";
             this.Export.NormalImage = ((System.Drawing.Image)(resources.GetObject("Export.NormalImage")));
             this.Export.Power = null;
             this.Export.Size = new System.Drawing.Size(150, 56);
-            this.Export.TabIndex = 0;
+            this.Export.TabIndex = 32;
             this.Export.Text = "导出";
             this.Export.UseVisualStyleBackColor = false;
             this.Export.Click += new System.EventHandler(this.Export_Click);
             // 
+            // Setting
+            // 
+            this.Setting.AllPower = null;
+            this.Setting.BackColor = System.Drawing.Color.Transparent;
+            this.Setting.DownImage = ((System.Drawing.Image)(resources.GetObject("Setting.DownImage")));
+            this.Setting.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.Setting.Image = ((System.Drawing.Image)(resources.GetObject("Setting.Image")));
+            this.Setting.IsShowBorder = true;
+            this.Setting.Location = new System.Drawing.Point(988, 143);
+            this.Setting.Margin = new System.Windows.Forms.Padding(4);
+            this.Setting.MoveImage = ((System.Drawing.Image)(resources.GetObject("Setting.MoveImage")));
+            this.Setting.Name = "Setting";
+            this.Setting.NormalImage = ((System.Drawing.Image)(resources.GetObject("Setting.NormalImage")));
+            this.Setting.Power = null;
+            this.Setting.Size = new System.Drawing.Size(126, 48);
+            this.Setting.TabIndex = 23;
+            this.Setting.Text = "参数设置";
+            this.Setting.UseVisualStyleBackColor = true;
+            this.Setting.Click += new System.EventHandler(this.Setting_Click);
+            // 
+            // PrinterList
+            // 
+            this.PrinterList.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.PrinterList.Location = new System.Drawing.Point(356, 143);
+            this.PrinterList.Margin = new System.Windows.Forms.Padding(6, 8, 6, 8);
+            this.PrinterList.Name = "PrinterList";
+            this.PrinterList.Size = new System.Drawing.Size(426, 62);
+            this.PrinterList.TabIndex = 22;
+            // 
+            // PrintTest
+            // 
+            this.PrintTest.AllPower = null;
+            this.PrintTest.BackColor = System.Drawing.Color.Transparent;
+            this.PrintTest.DownImage = ((System.Drawing.Image)(resources.GetObject("PrintTest.DownImage")));
+            this.PrintTest.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.PrintTest.Image = ((System.Drawing.Image)(resources.GetObject("PrintTest.Image")));
+            this.PrintTest.IsShowBorder = true;
+            this.PrintTest.Location = new System.Drawing.Point(826, 143);
+            this.PrintTest.Margin = new System.Windows.Forms.Padding(4);
+            this.PrintTest.MoveImage = ((System.Drawing.Image)(resources.GetObject("PrintTest.MoveImage")));
+            this.PrintTest.Name = "PrintTest";
+            this.PrintTest.NormalImage = ((System.Drawing.Image)(resources.GetObject("PrintTest.NormalImage")));
+            this.PrintTest.Power = null;
+            this.PrintTest.Size = new System.Drawing.Size(126, 48);
+            this.PrintTest.TabIndex = 21;
+            this.PrintTest.Text = "打印测试";
+            this.PrintTest.UseVisualStyleBackColor = true;
+            this.PrintTest.Click += new System.EventHandler(this.PrintTest_Click);
+            // 
+            // OneColumn
+            // 
+            this.OneColumn.AutoSize = true;
+            this.OneColumn.Location = new System.Drawing.Point(356, 598);
+            this.OneColumn.Name = "OneColumn";
+            this.OneColumn.Size = new System.Drawing.Size(89, 28);
+            this.OneColumn.TabIndex = 242;
+            this.OneColumn.TabStop = true;
+            this.OneColumn.Text = "单排";
+            this.OneColumn.UseVisualStyleBackColor = true;
+            // 
+            // TwoColumn
+            // 
+            this.TwoColumn.AutoSize = true;
+            this.TwoColumn.Location = new System.Drawing.Point(465, 598);
+            this.TwoColumn.Name = "TwoColumn";
+            this.TwoColumn.Size = new System.Drawing.Size(89, 28);
+            this.TwoColumn.TabIndex = 243;
+            this.TwoColumn.TabStop = true;
+            this.TwoColumn.Text = "双排";
+            this.TwoColumn.UseVisualStyleBackColor = true;
+            // 
+            // ThreeColumn
+            // 
+            this.ThreeColumn.AutoSize = true;
+            this.ThreeColumn.Checked = true;
+            this.ThreeColumn.Location = new System.Drawing.Point(583, 598);
+            this.ThreeColumn.Name = "ThreeColumn";
+            this.ThreeColumn.Size = new System.Drawing.Size(89, 28);
+            this.ThreeColumn.TabIndex = 244;
+            this.ThreeColumn.TabStop = true;
+            this.ThreeColumn.Text = "三排";
+            this.ThreeColumn.UseVisualStyleBackColor = true;
+            // 
+            // FourColumn
+            // 
+            this.FourColumn.AutoSize = true;
+            this.FourColumn.Location = new System.Drawing.Point(693, 598);
+            this.FourColumn.Name = "FourColumn";
+            this.FourColumn.Size = new System.Drawing.Size(89, 28);
+            this.FourColumn.TabIndex = 245;
+            this.FourColumn.TabStop = true;
+            this.FourColumn.Text = "四排";
+            this.FourColumn.UseVisualStyleBackColor = true;
+            // 
+            // GenSN
+            // 
+            this.GenSN.AccessibleRole = System.Windows.Forms.AccessibleRole.PageTabList;
+            this.GenSN.AllPower = null;
+            this.GenSN.BackColor = System.Drawing.Color.Transparent;
+            this.GenSN.DownImage = ((System.Drawing.Image)(resources.GetObject("GenSN.DownImage")));
+            this.GenSN.Image = null;
+            this.GenSN.IsShowBorder = true;
+            this.GenSN.Location = new System.Drawing.Point(358, 658);
+            this.GenSN.Margin = new System.Windows.Forms.Padding(6);
+            this.GenSN.MoveImage = ((System.Drawing.Image)(resources.GetObject("GenSN.MoveImage")));
+            this.GenSN.Name = "GenSN";
+            this.GenSN.NormalImage = ((System.Drawing.Image)(resources.GetObject("GenSN.NormalImage")));
+            this.GenSN.Power = null;
+            this.GenSN.Size = new System.Drawing.Size(150, 56);
+            this.GenSN.TabIndex = 246;
+            this.GenSN.Text = "生成SN";
+            this.GenSN.UseVisualStyleBackColor = false;
+            this.GenSN.Click += new System.EventHandler(this.GenSN_Click);
+            // 
+            // 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(171, 329);
+            this.label1.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(146, 41);
+            this.label1.TabIndex = 248;
+            this.label1.Text = "工单数量";
+            // 
+            // ma_count
+            // 
+            this.ma_count.AllPower = null;
+            this.ma_count.BackColor = System.Drawing.Color.White;
+            this.ma_count.ID = null;
+            this.ma_count.Location = new System.Drawing.Point(356, 338);
+            this.ma_count.Name = "ma_count";
+            this.ma_count.Power = null;
+            this.ma_count.Size = new System.Drawing.Size(152, 35);
+            this.ma_count.Str = null;
+            this.ma_count.Str1 = null;
+            this.ma_count.Str2 = null;
+            this.ma_count.TabIndex = 249;
+            // 
+            // msl_type
+            // 
+            this.msl_type.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.msl_type.FormattingEnabled = true;
+            this.msl_type.Items.AddRange(new object[] {
+            "转号前",
+            "转号后"});
+            this.msl_type.Location = new System.Drawing.Point(356, 531);
+            this.msl_type.Name = "msl_type";
+            this.msl_type.Size = new System.Drawing.Size(183, 32);
+            this.msl_type.TabIndex = 250;
+            // 
             // Query_SN
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(1494, 1075);
-            this.Controls.Add(this.currentSerial);
-            this.Controls.Add(this.label11);
-            this.Controls.Add(this.Printer);
-            this.Controls.Add(this.Print);
-            this.Controls.Add(this.label10);
-            this.Controls.Add(this.ma_code);
-            this.Controls.Add(this.label9);
-            this.Controls.Add(this.num);
-            this.Controls.Add(this.label7);
-            this.Controls.Add(this.label6);
-            this.Controls.Add(this.date);
-            this.Controls.Add(this.seriallength);
-            this.Controls.Add(this.label3);
+            this.ClientSize = new System.Drawing.Size(2034, 1118);
+            this.Controls.Add(this.msl_type);
+            this.Controls.Add(this.ma_count);
+            this.Controls.Add(this.label1);
+            this.Controls.Add(this.GenSN);
+            this.Controls.Add(this.FourColumn);
+            this.Controls.Add(this.ThreeColumn);
+            this.Controls.Add(this.TwoColumn);
+            this.Controls.Add(this.OneColumn);
+            this.Controls.Add(this.pr_detail);
+            this.Controls.Add(this.label4);
             this.Controls.Add(this.pr_code);
+            this.Controls.Add(this.label8);
+            this.Controls.Add(this.ma_qty);
+            this.Controls.Add(this.label7);
+            this.Controls.Add(this.ma_code);
             this.Controls.Add(this.label5);
             this.Controls.Add(this.Export);
+            this.Controls.Add(this.Setting);
+            this.Controls.Add(this.PrinterList);
+            this.Controls.Add(this.PrintTest);
+            this.Controls.Add(this.ma_salecode_label);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
             this.Margin = new System.Windows.Forms.Padding(6);
             this.Name = "Query_SN";
-            this.Tag = "Query!SpecialReport";
-            this.Text = "Query_SpecialReport";
-            this.Load += new System.EventHandler(this.Query_SpecialReport_Load);
-            ((System.ComponentModel.ISupportInitialize)(this.currentSerial)).EndInit();
+            this.Tag = "Query_SN";
+            this.Text = "打印机调试";
+            this.Load += new System.EventHandler(this.SystemSetting_PrinterTest_Load);
             this.ResumeLayout(false);
             this.PerformLayout();
 
         }
 
         #endregion
-
+        private System.Windows.Forms.Label ma_salecode_label;
+        private CustomControl.ButtonUtil.NormalButton PrintTest;
+        private CustomControl.ComBoxWithFocus.PrinterCombox PrinterList;
+        private CustomControl.ButtonUtil.NormalButton Setting;
         private CustomControl.ButtonUtil.NormalButton Export;
-        private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog1;
-        private CustomControl.TextBoxWithIcon.EnterTextBox pr_code;
-        private System.Windows.Forms.Label label5;
-        private CustomControl.TextBoxWithIcon.EnterTextBox seriallength;
-        private System.Windows.Forms.Label label3;
-        private System.Windows.Forms.DateTimePicker date;
-        private System.Windows.Forms.Label label6;
-        private CustomControl.TextBoxWithIcon.EnterTextBox num;
+        private System.Windows.Forms.Label ma_qty;
         private System.Windows.Forms.Label label7;
-        private CustomControl.TextBoxWithIcon.EnterTextBox ma_code;
-        private System.Windows.Forms.Label label9;
-        private System.Windows.Forms.Label label10;
-        private CustomControl.ButtonUtil.NormalButton Print;
-        private CustomControl.ComBoxWithFocus.PrinterCombox Printer;
-        private System.Windows.Forms.Label label11;
-        private System.Windows.Forms.NumericUpDown currentSerial;
+        private CustomControl.TextBoxWithIcon.SearchTextBox ma_code;
+        private System.Windows.Forms.Label label5;
+        private System.Windows.Forms.Label pr_detail;
+        private System.Windows.Forms.Label label4;
+        private CustomControl.TextBoxWithIcon.EnterTextBox pr_code;
+        private System.Windows.Forms.Label label8;
+        private System.Windows.Forms.RadioButton OneColumn;
+        private System.Windows.Forms.RadioButton TwoColumn;
+        private System.Windows.Forms.RadioButton ThreeColumn;
+        private System.Windows.Forms.RadioButton FourColumn;
+        private CustomControl.ButtonUtil.NormalButton GenSN;
+        private System.Windows.Forms.Label label1;
+        private CustomControl.TextBoxWithIcon.EnterTextBox ma_count;
+        private System.Windows.Forms.ComboBox msl_type;
+        private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog1;
     }
 }

+ 294 - 59
UAS_MES_ZDXW/FunctionCode/Query/Query_SN.cs

@@ -1,13 +1,14 @@
-using LabelManager2;
+using NPOI.SS.Formula.Functions;
+using Seagull.BarTender.Print;
 using System;
 using System.Data;
+using System.Drawing;
+using System.Drawing.Printing;
 using System.Security.Cryptography;
-using System.Text;
-using System.Threading;
+using System.Text.RegularExpressions;
 using System.Windows.Forms;
 using UAS_MES_NEW.DataOperate;
 using UAS_MES_NEW.Entity;
-using UAS_MES_NEW.PublicForm;
 using UAS_MES_NEW.PublicMethod;
 
 namespace UAS_MES_NEW.Query
@@ -15,29 +16,54 @@ namespace UAS_MES_NEW.Query
     public partial class Query_SN : Form
     {
 
-        DataHelper dh = SystemInf.dh;
+        int serialnum = 0;
+        //客户的流水号
+        int custserialnum = 0;
+
+        Engine engine = new Engine();
 
-        ApplicationClass lbl;
+        LabelFormatDocument format;
+
+        DataHelper dh = SystemInf.dh;
 
-        Thread InitPrint;
+        //前缀条件
 
-        Document doc;
+        //生成条码的流水号
 
+        DataTable Dbfind;
         public Query_SN()
         {
             InitializeComponent();
         }
 
-        private void Export_Click(object sender, EventArgs e)
+        private void PrintTest_Click(object sender, EventArgs e)
+        {
+            PrintDocument print = new PrintDocument();
+            print.PrinterSettings.PrinterName = PrinterList.Text;
+            print.PrintPage += Print_PrintPage;
+            print.Print();
+        }
+
+        private void Print_PrintPage(object sender, PrintPageEventArgs e)
         {
-            ExcelExport("");
+            Graphics g = e.Graphics;
+            float leftMargin = 10f; //左边距
+            SolidBrush myBrush = new SolidBrush(Color.Black);//刷子
+            float yPosition = 5f;//行定位
+            Font printFont = new Font("微软雅黑", 20f, FontStyle.Bold);//设置字体
+            yPosition += printFont.GetHeight(g);//另起一行
+            g.DrawString("成功连接此打印机", printFont, myBrush, leftMargin, yPosition, new StringFormat());
         }
 
-        //选择导出Excel时是选择导出数据的还是模板
-        private void ExcelExport(string DataOrTemplet)
+        private void Setting_Click(object sender, EventArgs e)
+        {
+            PrintDialog printd = new PrintDialog();
+            printd.PrinterSettings.PrinterName = PrinterList.Text;
+            printd.ShowDialog();
+        }
+
+        private void Export_Click(object sender, EventArgs e)
         {
-            //Data表示导出数据
-            //Templet表示导出模板
             MD5 md5 = MD5.Create();
             folderBrowserDialog1.Description = "选择导出的路径";
             DialogResult result = folderBrowserDialog1.ShowDialog();
@@ -45,72 +71,281 @@ namespace UAS_MES_NEW.Query
             {
                 string FolderPath = folderBrowserDialog1.SelectedPath;
                 ExcelHandler eh = new ExcelHandler();
-                DataTable dt = new DataTable();
-                dt.Columns.Add("工单号");
-                dt.Columns.Add("序列号");
-                for (decimal i = currentSerial.Value; i < currentSerial.Value + int.Parse(num.Text); i++)
-                {
-                    DataRow dr = dt.NewRow();
-                    dr["工单号"] = ma_code.Text;
-                    string serial = ma_code.Text
-                        + lpad(int.Parse(seriallength.Text), (i + 1).ToString());
-                    dr["序列号"] = serial;
-                    dt.Rows.Add(dr);
-                }
+                DataTable dt = (DataTable)dh.ExecuteSql("select msl_makecode 工单号,msl_sncode 序列号 from makesnlist " +
+                    "where msl_makecode='" + ma_code.Text + "' order by msl_sncode", "select");
                 eh.ExportExcel(dt, FolderPath);
             }
         }
 
-        private void Query_SpecialReport_Load(object sender, EventArgs e)
+        public string BarcodeMethod1(string Prefix, string Suffix, int Index, int Length, int radix, string char_out)
         {
-            InitPrint = new Thread(InPrint);
-            SetLoadingWindow stw = new SetLoadingWindow(InitPrint, "初始化打印程序");
-            BaseUtil.SetFormCenter(stw);
-            stw.ShowDialog();
-            doc = lbl.Documents.Open(System.Windows.Forms.Application.StartupPath + @"\SN.lab");
+            string str = Prefix;
+            //如果是流水则需要在前面加0
+            string serialcode = BaseUtil.DToAny(custserialnum, radix, char_out);
+            for (int j = serialcode.ToString().Length; j < Length; j++)
+            {
+                serialcode = "0" + serialcode;
+            }
+            str += serialcode;
+            str += Suffix;
+            custserialnum = custserialnum + 1;
+            return str;
         }
 
-        private void InPrint()
+        private static string lpad(int length, string number)
         {
-            try
-            {
-                lbl = new ApplicationClass();
-                BaseUtil.WriteLbl();
-            }
-            catch (Exception)
+            while (number.Length < length)
             {
-                MessageBox.Show("未正确安装CodeSoft软件");
+                number = "0" + number;
             }
+            number = number.Substring(number.Length - length, length);
+            return number;
         }
 
-        private static string MD5Encoding(string rawPass)
+        private void SystemSetting_PrinterTest_Load(object sender, EventArgs e)
         {
-            // 创建MD5类的默认实例:MD5CryptoServiceProvider
-            MD5 md5 = MD5.Create();
-            byte[] bs = Encoding.UTF8.GetBytes(rawPass);
-            byte[] hs = md5.ComputeHash(bs);
-            StringBuilder stb = new StringBuilder();
-            foreach (byte b in hs)
-            {
-                // 以十六进制格式格式化
-                stb.Append(b.ToString("x2"));
-            }
-            return stb.ToString().ToUpper();
+            engine.Start();
+
+
+            ma_code.TableName = " make left join product on ma_prodcode=pr_code";
+            ma_code.SelectField = "ma_code # 工单编号,pr_code # 产品编号,pr_spec # 型号";
+            ma_code.FormName = Name;
+            ma_code.SetValueField = new string[] { "ma_code" };
+            //ma_code.Condition = "ma_statuscode='STARTED'";
+            ma_code.DbChange += pr_code_DbChange;
         }
 
-        private static string lpad(int length, string number)
+        private void pr_code_DbChange(object sender, EventArgs e)
         {
-            while (number.Length < length)
+            Dbfind = ma_code.ReturnData;
+            BaseUtil.SetFormValue(this.Controls, Dbfind);
+            DataTable dt = (DataTable)dh.ExecuteSql("select ma_qty,ma_prodcode,pr_detail from make left join product on ma_prodcode=pr_code  where ma_code='" + ma_code.Text + "'", "select");
+            if (dt.Rows.Count > 0)
             {
-                number = "0" + number;
+                pr_code.Text = dt.Rows[0]["ma_prodcode"].ToString();
+                ma_qty.Text = dt.Rows[0]["ma_qty"].ToString();
+                pr_detail.Text = dt.Rows[0]["pr_detail"].ToString();
             }
-            number = number.Substring(number.Length - length, length);
-            return number;
+            ma_count.Text = ma_qty.Text;
         }
 
-        private void Print_Click(object sender, EventArgs e)
+        private void GenSN_Click(object sender, EventArgs e)
         {
+            string Prefix = "";
 
+            string Suffix = "";
+            //获取编码规则
+            if (!dh.CheckExist("make", "ma_code='" + ma_code.Text + "'"))
+            {
+                MessageBox.Show("工单号不存在");
+                return;
+            }
+            DataTable dt = (DataTable)dh.ExecuteSql("select pr_exbarcode,ma_qty from make left join product on ma_prodcode=pr_code where ma_code='" + ma_code.Text + "'", "select");
+            string pr_exbarcode = "";
+            string ma_qty = "";
+            if (dt.Rows.Count > 0)
+            {
+                pr_exbarcode = dt.Rows[0]["pr_exbarcode"].ToString();
+                ma_qty = dt.Rows[0]["ma_qty"].ToString();
+            }
+            if (dh.getRowCount("makesnlist", "msl_makecode='" + ma_code.Text + "' and msl_type='" + (msl_type.Text == "转号前" ? "before" : "after") + "'") + int.Parse(ma_count.Text) > int.Parse(ma_qty))
+            {
+                MessageBox.Show("工单号" + ma_code.Text + "生产序列号超出工单数");
+                return;
+            }
+            DataTable Nr = (DataTable)dh.ExecuteSql("select nrd_detno,nrd_name,nrd_type,nrd_radix,nrd_sql,nrd_length,nrd_content,nvl(nr_changenum,0)nr_changenum from NoRuleDetail left join norule on nrd_nrid=nr_id where nr_code='" + pr_exbarcode + "' order by nrd_detno", "select");
+            //如果没有则取公共规则
+            if (Nr.Rows.Count == 0)
+                Nr = (DataTable)dh.ExecuteSql("select nrd_detno,nrd_name,nrd_radix,nrd_type,nrd_sql,nrd_length,nrd_content,nvl(nr_changenum,0)nr_changenum from NoRuleDetail left join norule on nrd_nrid=nr_id where nr_custcode is null and nr_isdefault <> 0 order by nrd_detno", "select");
+            //用于过滤参数的正则表达式
+            Regex match = new Regex("{\\w+}");
+            //用于存放每一项的明细的数据
+            string[] NrData = new string[Nr.Rows.Count];
+            //流水号的索引
+            int SerialNumIndex = 0;
+            //流水长度
+            int SerialNumLength = 0;
+            //存放键值对
+            int Radix = 10;
+            string PrefixFixed = "";
+            string char_out = "";
+            string nr_changenum = Nr.Rows[0]["nr_changenum"].ToString();
+            //如果是
+            if (nr_changenum != "-1")
+            {
+                for (int m = 0; m < Nr.Rows.Count; m++)
+                {
+                    switch (Nr.Rows[m]["nrd_type"].ToString())
+                    {
+                        //常量直接进行拼接
+                        case "常量":
+                            NrData[m] = Nr.Rows[m]["nrd_sql"].ToString();
+                            Prefix += NrData[m];
+                            Suffix += NrData[m];
+                            break;
+                        case "SQL":
+                            string SQL = Nr.Rows[m]["nrd_sql"].ToString();
+                            DataTable Temp;
+                            //如果不包含参数替换
+                            if (SQL.IndexOf("{") == 0)
+                            {
+                                Temp = (DataTable)dh.ExecuteSql(SQL, "select");
+                            }
+                            else
+                            {
+                                //替换参数后重新执行SQL
+                                foreach (System.Text.RegularExpressions.Match mch in match.Matches(SQL))
+                                {
+                                    SQL = SQL.Replace(mch.Value.Trim(), "'" + ma_code.Text + "'");
+                                }
+                                Temp = (DataTable)dh.ExecuteSql(SQL, "select");
+                            }
+                            if (Temp.Rows.Count > 0)
+                            {
+                                NrData[m] = Temp.Rows[0][0].ToString();
+                                Prefix += NrData[m];
+                                Suffix += NrData[m];
+                            }
+                            else
+                            {
+                                NrData[m] = "";
+                                Prefix += NrData[m];
+                                Suffix += NrData[m];
+                            }
+                            break;
+                        //流水需要通过MaxNumber去取
+                        case "流水":
+                            NrData[m] = dh.getFieldDataByCondition("RuleMaxNum", "rmn_maxnumber", "rmn_nrcode='" + pr_exbarcode + "'").ToString();
+                            Suffix = "";
+                            PrefixFixed = Prefix;
+                            //设置当前流水
+                            custserialnum = int.Parse(NrData[m] == "" ? "0" : NrData[m]);
+                            SerialNumIndex = m;
+                            SerialNumLength = int.Parse(Nr.Rows[m]["nrd_length"].ToString());
+                            Radix = int.Parse(Nr.Rows[m]["nrd_radix"].ToString());
+                            char_out = Nr.Rows[m]["nrd_content"].ToString();
+                            break;
+                        default:
+                            break;
+                    }
+                }
+                //获取最大的流水号
+                string maxnum = dh.getFieldDataByCondition("RuleMaxNum", "rmn_maxnumber", "rmn_nrcode='" + pr_exbarcode + "' and rmn_prefix='" + Prefix + "'").ToString();
+                //如果流水号为空则插入一条新记录,从1开始取
+                if (maxnum == "")
+                {
+                    dh.ExecuteSql("insert into RuleMaxNum(rmn_id,rmn_nrcode,rmn_prefix,rmn_maxnumber) values(RuleMaxNum_seq.nextval,'" + pr_exbarcode + "','" + Prefix + "','1')", "insert");
+                    custserialnum = 1;
+                }
+                //如果流水号不为空则取当前流水
+                else
+                {
+                    custserialnum = int.Parse(maxnum);
+                }
+                //遍历整个Grid,勾选的项目全部进行条码生成
+                ArrayList<string> custbarcode = new ArrayList<string>();
+                for (int i = 0; i < int.Parse(ma_count.Text); i++)
+                {
+                    string data = BarcodeMethod1(PrefixFixed, Suffix, SerialNumIndex, SerialNumLength, Radix, char_out);
+                    if (!custbarcode.Contains(data))
+                        custbarcode.Add(data);
+                }
+                //插入条码
+                string sql = "insert into makesnlist(MSL_ID, MSL_INDATE, MSL_MAKECODE, MSL_SNCODE,msl_status,MSL_TYPE)" +
+                    "select makesnlist_seq.nextval,sysdate,'" + ma_code.Text + "',:custbarcode,0,'" + (msl_type.Text == "转号前" ? "before" : "after") + "' from dual where :custbarcode not in " +
+                  "(select msl_sncode from makesnlist)";
+                dh.BatchInsert(sql, new string[] { "custbarcode", "custbarcode" }, custbarcode.ToArray(), custbarcode.ToArray());
+                //更新最大流水号
+                dh.UpdateByCondition("RuleMaxNum", "rmn_maxnumber='" + custserialnum + "'", "rmn_nrcode='" + pr_exbarcode + "' and rmn_prefix='" + Prefix + "'");
+            }
+            else
+            {
+                for (int m = 0; m < Nr.Rows.Count; m++)
+                {
+                    switch (Nr.Rows[m]["nrd_type"].ToString())
+                    {
+                        //常量直接进行拼接
+                        case "常量":
+                            NrData[m] = Nr.Rows[m]["nrd_sql"].ToString();
+                            Prefix += NrData[m];
+                            Suffix += NrData[m];
+                            break;
+                        case "SQL":
+                            string SQL = Nr.Rows[m]["nrd_sql"].ToString();
+                            DataTable Temp;
+                            //如果不包含参数替换
+                            if (SQL.IndexOf("{") == 0)
+                            {
+                                Temp = (DataTable)dh.ExecuteSql(SQL, "select");
+                            }
+                            else
+                            {
+                                //替换参数后重新执行SQL
+                                foreach (System.Text.RegularExpressions.Match mch in match.Matches(SQL))
+                                {
+                                    SQL = SQL.Replace(mch.Value.Trim(), "'" + ma_code.Text + "'");
+                                }
+                                Temp = (DataTable)dh.ExecuteSql(SQL, "select");
+                            }
+                            if (Temp.Rows.Count > 0)
+                            {
+                                NrData[m] = Temp.Rows[0][0].ToString();
+                                Prefix += NrData[m];
+                                Suffix += NrData[m];
+                            }
+                            else
+                            {
+                                NrData[m] = "";
+                                Prefix += NrData[m];
+                                Suffix += NrData[m];
+                            }
+                            break;
+                        //流水需要通过MaxNumber去取
+                        case "流水":
+                            NrData[m] = dh.getFieldDataByCondition("RuleMaxNum", "rmn_maxnumber", "rmn_nrcode='" + pr_exbarcode + "'").ToString();
+                            Suffix = "";
+                            PrefixFixed = Prefix;
+                            //设置当前流水
+                            custserialnum = int.Parse(NrData[m] == "" ? "0" : NrData[m]);
+                            SerialNumIndex = m;
+                            SerialNumLength = int.Parse(Nr.Rows[m]["nrd_length"].ToString());
+                            Radix = int.Parse(Nr.Rows[m]["nrd_radix"].ToString());
+                            char_out = Nr.Rows[m]["nrd_content"].ToString();
+                            break;
+                        default:
+                            break;
+                    }
+                }
+                //获取最大的流水号
+                string maxnum = dh.getFieldDataByCondition("RuleMaxNum", "rmn_maxnumber", "rmn_nrcode='" + pr_exbarcode + "'").ToString();
+                //如果流水号为空则插入一条新记录,从1开始取
+                if (maxnum == "")
+                {
+                    dh.ExecuteSql("insert into RuleMaxNum(rmn_id,rmn_nrcode,rmn_maxnumber) values(RuleMaxNum_seq.nextval,'" + pr_exbarcode + "','1')", "insert");
+                    custserialnum = 1;
+                }
+                //如果流水号不为空则取当前流水
+                else
+                {
+                    custserialnum = int.Parse(maxnum);
+                }
+                //遍历整个Grid,勾选的项目全部进行条码生成
+                ArrayList<string> custbarcode = new ArrayList<string>();
+                for (int i = 0; i < int.Parse(ma_count.Text); i++)
+                {
+                    string data = BarcodeMethod1(PrefixFixed, Suffix, SerialNumIndex, SerialNumLength, Radix, char_out);
+                    if (!custbarcode.Contains(data))
+                        custbarcode.Add(data);
+                }
+                string sql = "insert into makesnlist(MSL_ID, MSL_INDATE, MSL_MAKECODE, MSL_SNCODE, MSL_TYPE,msl_status)" +
+              "select makesnlist_seq.nextval,sysdate,'" + ma_code.Text + "',:custbarcode,'before',0 from dual where :custbarcode not in " +
+              "(select msl_sncode from makesnlist)";
+                dh.BatchInsert(sql, new string[] { "custbarcode", "custbarcode" }, custbarcode.ToArray(), custbarcode.ToArray());
+                //更新最大流水号
+                dh.UpdateByCondition("RuleMaxNum", "rmn_maxnumber='" + custserialnum + "'", "rmn_nrcode='" + pr_exbarcode + "'");
+            }
+            //插入条码
+            MessageBox.Show("工单" + ma_code.Text + "生成SN清单成功");
         }
     }
-}
+}

+ 317 - 55
UAS_MES_ZDXW/FunctionCode/Query/Query_SN.resx

@@ -117,84 +117,346 @@
   <resheader name="writer">
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
-  <metadata name="folderBrowserDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
-    <value>17, 17</value>
-  </metadata>
   <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
-  <data name="Print.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+  <data name="Export.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
-        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFcSURBVFhH5di7UsJAFMbxtDT6QMI76IAFT0npIE0K
-        GcRORxHklpAIBHLfbILV8XxeNsMznJ35F5vu+82kWYuILD4N7oq75roCw27sb/x5WBdc27btntY64o/i
-        DnZjPxy4S6A0R6PHO1WUNHc9ep4uxIXd2D8eP/XZowWUThBG+n3p0stsKbbJ0qFDFFfscQuUbpzm9Pqx
-        Eh8c4PGLkuX0Nl+LDw4GJckUTRaO+OBQo+SKpitXfHAwKClfZuuN+OBgUDJV0NzxxAeHM5TFxhffGUpe
-        aFp5n+KDg0FRfHH8nfjgUKPoktztXnxwMCgFX7xdID441ChlRf7+ID44GBTNl21wFB8capSqot0xFB8c
-        /lE6Wa70IU5oH0Ziw/5cFebpoPUwHPbL04nCJKUgisWF3dgPB3gABc9v7fvBoBcnaVKdvkha2I39cPjx
-        oPrhusndcPinpIXd2N8gIusbTaFspKtR2SQAAAAASUVORK5CYII=
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFfSURBVFhH5dhNTsJgFIXhM2WiCxL2oAEHrJKhQSYM
+        JIgzjSLIX0sRKPSPtl+Lo2uOgVbWcJu8CzhP8nVwISIAUAFwA+AWQFNh3M39lZMHrgDUu91uyxjji8KP
+        u7mfDgCuiVLt958fkjSTie3I62iqLu7m/sHgpQ2gRpSG6/nmc2bL23imtuHMkp0f5ADuidIMoljev+bq
+        o8PpH4NmcIjlY7JQHx0KlPCQyHBqqY8OJUqcyGhuq48OBUoUJzJeLNVHhwLlkKQysRz10eECZbpcqe8C
+        JU6NzJ1v9dGhQElSI9Zqoz46lCgmE3u9VR8dCpTUZOJsXPXRoUTJclltd+qjQ4FislzW7l59dChR8lw2
+        e099dDijNA5xYnZBKFvPVxv3x0lanA5qT71eOzsexQsjcf1AXdzN/XQ4H5l4fqs/djqtIIzC/Pgj2uJu
+        7i/Okf8O11UAd6c3pS3u5v6/w/UvTaFspAxAMh4AAAAASUVORK5CYII=
 </value>
   </data>
-  <data name="Print.MoveImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+  <data name="Export.MoveImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
-        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFzSURBVFhH5djNSgJRGMZxL2P2gTfQFbZvHSEZFBEW
-        CEIQBEIgVFiS9qXWoDmp4/fHzDmjM2a+vU/QqUVX0DvwXxxn9fwYXJwYEcXWNzIWt83dcq7AsBv7LXgA
-        ZI0r71/aaqjCJf8o7sFu7IcDFwdK4vimrv1oSZXRnArdQFzYjf3pQkOzRxIoVWc6X5X6M7ruBGIr9mbU
-        9MIVe9hAcXvBO125WnxwgMcXSpcPF20tPjgYlI5eUK6lxAcHg9Lmw3nTFx8cDEpLLSjr+OKDg0FpqojO
-        Gp744GBQ3vyITutT8cHBoDheRCe1ifjgYFBe+ZCxJ+KDg0GpT0NKv4zFBweDUpuEdFQdiQ8OBsXmw2Fl
-        JD44/KCM53TwNBQfHAzKMx/2Hgfig8M3SrXYUasUfz67DwOxYf9dV5urg+RWzta4aEnxn83OfV9c2I39
-        cIAHUOJceTNbUfmW94GX0sJu7IcDPH5fXCe4EvfXxe5/D7ux3yKi2CfkPhTy27lqkwAAAABJRU5ErkJg
-        gg==
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAF3SURBVFhH5djbSgJRFMbxHsP7wBfYT7jvu46QDIoI
+        C4QNQRAIgVBRSdpxpgZN83wYx5nZOjNqrvgEd73DGvhfzdX3g32ztohoS0iVElLtCakehVQdhmE39qfg
+        AZBtIdX70Y0TjsJ4SQw/7MZ+OAip0kDJnD3UdJAsyXIjKvWm7MJu7M+X6lpIlQWK3ZhEq8pgRvfdKdvK
+        /Rk1/XglpHKA0ulPF3Tb0eyDAzzWKL3pgq7bmn1wMChdPadiK2QfHAxKW8/pqhmwDw4GpRXOqdAI2AcH
+        g9IME7qs++yDg0H5DhK6qE3YBweD0vATOq967IODQfnyE1KOxz44GJTaJKb855h9cDAoVS+mU9tlHxwM
+        iuPFdGK57IPDH8o4ouO3EfvgYFA+xhEdvg7ZB4cNil3uhquc5dLBy5Bt2P/U0+Z0kN0tOhqHlpzt0v7z
+        gF3Yjf1w2ByZ0jjD7RSs8K7l/+Ant7Ab+8058t/hOiOkquBNMQy7sX99uP4F5D4U8hdr4uMAAAAASUVO
+        RK5CYII=
 </value>
   </data>
-  <data name="Print.NormalImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+  <data name="Export.NormalImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
-        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAGVSURBVFhH5di7agJRFIXhDSKoYBQEC8FCECwEQRBE
-        4uUVEtTiPKVlom2wttM6IfF+15njXHRnL19jD/zFmanWV8zAEDNTp9OJS6/Sm2QUht3YH4cHtdvtF6k7
-        mUwG1tqd3FR3YTf2w0FKUVOu6XT68Xgw3+8PtWH/bDYbCkeLGo1Gz/d9JwzvrL0gCKx49KlerxtIBUGo
-        PjjAg2q1mqDc2fN99cEBHlStVk0oB+t56oMDPKhSqZggDNm1N/XBAR5ULpeNvGD46rrqgwM8qFQqGV8O
-        56ujPjjAg4rFosFL5ni5qA8O8KBCoWBuns/701l9cIAH5fN5QfF4dzipDw7woFwuZ+zN483+oD44wIOy
-        2azB52i13asPDvCgTCZjHGt5sdmqDw7woHQ6bRzX8ny1UR8c4EHJZNJc5fC7XKsPDvCgRCLR2x9Pzt9q
-        zT+Lpdqw/3A6W/HoUywWa32Nx8OL4zwffM8X6sJu7IcDPCgajaak7udoNNjsdgc81BZ2Yz8c4PH8cR2J
-        ROJSU3qXjMKwG/vjzEz/skOI3Zqgv7AAAAAASUVORK5CYII=
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAGpSURBVFhH5dg/ayJBGMfxB4YFXTARBAvBQhAsBEEQ
+        ZLnNzFu4I6aYV5kyF9tgbad1jrsYY9T4Z3fcnV2f45e38Sx8q6l+n2IWhpiZjDFVY8wPY8xPY4wVGHZj
+        fxUepLW+0Vrfz+fzR+fclgV+2I39cNBa31Icx/FisXi6XpnL8io27F8ul89xHN9RFEWTPM+ToihZet57
+        F0XRA43HYwsp7wvxwQEeNBqNbFmWnOW5+OAADxoOh7YoS3ZZJj44wIMGg4H1RcGpu4gPDvCgfr9vvfd8
+        TlPxwQEe1Ov1bO49H8+J+OAAD+p2uxaXzNfpJD44wIM6nY69ZDnvDkfxwQEe1G637SXLeLs/iA8O8KBW
+        q2XdJePNbi8+OMCDms2mxe9o/bkTHxzgQY1GwybO8WrzKT44wIPq9bpNUsdv64344AAPqtVq9pw6/vv+
+        IT44wIPCMJzsvg7Jv/UH/1m9iw3794ejC8PwgSqVyt3LbPZ8SpLvg9e3lbiwG/vhAA8KguA2CIL739Pp
+        42a73eNQWtiN/XCAB+GhVilVVUrFSqlfSikrMOzG/u+H6/+yQ4jdXN8e9AAAAABJRU5ErkJggg==
 </value>
   </data>
-  <data name="Export.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+  <data name="Setting.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=
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFfSURBVFhH5dhNTsJgFIXhM2WiCxL2oAEHrJKhQSYM
+        JIgzjSLIX0sRKPSPtl+Lo2uOgVbWcJu8CzhP8nVwISIAUAFwA+AWQFNh3M39lZMHrgDUu91uyxjji8KP
+        u7mfDgCuiVLt958fkjSTie3I62iqLu7m/sHgpQ2gRpSG6/nmc2bL23imtuHMkp0f5ADuidIMoljev+bq
+        o8PpH4NmcIjlY7JQHx0KlPCQyHBqqY8OJUqcyGhuq48OBUoUJzJeLNVHhwLlkKQysRz10eECZbpcqe8C
+        JU6NzJ1v9dGhQElSI9Zqoz46lCgmE3u9VR8dCpTUZOJsXPXRoUTJclltd+qjQ4FislzW7l59dChR8lw2
+        e099dDijNA5xYnZBKFvPVxv3x0lanA5qT71eOzsexQsjcf1AXdzN/XQ4H5l4fqs/djqtIIzC/Pgj2uJu
+        7i/Okf8O11UAd6c3pS3u5v6/w/UvTaFspAxAMh4AAAAASUVORK5CYII=
 </value>
   </data>
-  <data name="Export.MoveImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+  <data name="Setting.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAACH
+        DwAAjA8AAP1SAACBQAAAfXkAAOmLAAA85QAAGcxzPIV3AAAKOWlDQ1BQaG90b3Nob3AgSUNDIHByb2Zp
+        bGUAAEjHnZZ3VFTXFofPvXd6oc0w0hl6ky4wgPQuIB0EURhmBhjKAMMMTWyIqEBEEREBRZCggAGjoUis
+        iGIhKKhgD0gQUGIwiqioZEbWSnx5ee/l5ffHvd/aZ+9z99l7n7UuACRPHy4vBZYCIJkn4Ad6ONNXhUfQ
+        sf0ABniAAaYAMFnpqb5B7sFAJC83F3q6yAn8i94MAUj8vmXo6U+ng/9P0qxUvgAAyF/E5mxOOkvE+SJO
+        yhSkiu0zIqbGJIoZRomZL0pQxHJijlvkpZ99FtlRzOxkHlvE4pxT2clsMfeIeHuGkCNixEfEBRlcTqaI
+        b4tYM0mYzBXxW3FsMoeZDgCKJLYLOKx4EZuImMQPDnQR8XIAcKS4LzjmCxZwsgTiQ7mkpGbzuXHxArou
+        S49uam3NoHtyMpM4AoGhP5OVyOSz6S4pyalMXjYAi2f+LBlxbemiIluaWltaGpoZmX5RqP+6+Dcl7u0i
+        vQr43DOI1veH7a/8UuoAYMyKarPrD1vMfgA6tgIgd/8Pm+YhACRFfWu/8cV5aOJ5iRcIUm2MjTMzM424
+        HJaRuKC/6386/A198T0j8Xa/l4fuyollCpMEdHHdWClJKUI+PT2VyeLQDf88xP848K/zWBrIieXwOTxR
+        RKhoyri8OFG7eWyugJvCo3N5/6mJ/zDsT1qca5Eo9Z8ANcoISN2gAuTnPoCiEAESeVDc9d/75oMPBeKb
+        F6Y6sTj3nwX9+65wifiRzo37HOcSGExnCfkZi2viawnQgAAkARXIAxWgAXSBITADVsAWOAI3sAL4gWAQ
+        DtYCFogHyYAPMkEu2AwKQBHYBfaCSlAD6kEjaAEnQAc4DS6Ay+A6uAnugAdgBIyD52AGvAHzEARhITJE
+        geQhVUgLMoDMIAZkD7lBPlAgFA5FQ3EQDxJCudAWqAgqhSqhWqgR+hY6BV2ArkID0D1oFJqCfoXewwhM
+        gqmwMqwNG8MM2An2hoPhNXAcnAbnwPnwTrgCroOPwe3wBfg6fAcegZ/DswhAiAgNUUMMEQbigvghEUgs
+        wkc2IIVIOVKHtCBdSC9yCxlBppF3KAyKgqKjDFG2KE9UCIqFSkNtQBWjKlFHUe2oHtQt1ChqBvUJTUYr
+        oQ3QNmgv9Cp0HDoTXYAuRzeg29CX0HfQ4+g3GAyGhtHBWGE8MeGYBMw6TDHmAKYVcx4zgBnDzGKxWHms
+        AdYO64dlYgXYAux+7DHsOewgdhz7FkfEqeLMcO64CBwPl4crxzXhzuIGcRO4ebwUXgtvg/fDs/HZ+BJ8
+        Pb4LfwM/jp8nSBN0CHaEYEICYTOhgtBCuER4SHhFJBLVidbEACKXuIlYQTxOvEIcJb4jyZD0SS6kSJKQ
+        tJN0hHSedI/0ikwma5MdyRFkAXknuZF8kfyY/FaCImEk4SXBltgoUSXRLjEo8UISL6kl6SS5VjJHslzy
+        pOQNyWkpvJS2lIsUU2qDVJXUKalhqVlpirSptJ90snSxdJP0VelJGayMtoybDFsmX+awzEWZMQpC0aC4
+        UFiULZR6yiXKOBVD1aF6UROoRdRvqP3UGVkZ2WWyobJZslWyZ2RHaAhNm+ZFS6KV0E7QhmjvlygvcVrC
+        WbJjScuSwSVzcopyjnIcuUK5Vrk7cu/l6fJu8onyu+U75B8poBT0FQIUMhUOKlxSmFakKtoqshQLFU8o
+        3leClfSVApXWKR1W6lOaVVZR9lBOVd6vfFF5WoWm4qiSoFKmclZlSpWiaq/KVS1TPaf6jC5Ld6In0Svo
+        PfQZNSU1TzWhWq1av9q8uo56iHqeeqv6Iw2CBkMjVqNMo1tjRlNV01czV7NZ874WXouhFa+1T6tXa05b
+        RztMe5t2h/akjpyOl06OTrPOQ12yroNumm6d7m09jB5DL1HvgN5NfVjfQj9ev0r/hgFsYGnANThgMLAU
+        vdR6KW9p3dJhQ5Khk2GGYbPhqBHNyMcoz6jD6IWxpnGE8W7jXuNPJhYmSSb1Jg9MZUxXmOaZdpn+aqZv
+        xjKrMrttTjZ3N99o3mn+cpnBMs6yg8vuWlAsfC22WXRbfLS0suRbtlhOWWlaRVtVWw0zqAx/RjHjijXa
+        2tl6o/Vp63c2ljYCmxM2v9ga2ibaNtlOLtdZzllev3zMTt2OaVdrN2JPt4+2P2Q/4qDmwHSoc3jiqOHI
+        dmxwnHDSc0pwOub0wtnEme/c5jznYuOy3uW8K+Lq4Vro2u8m4xbiVun22F3dPc692X3Gw8Jjncd5T7Sn
+        t+duz2EvZS+WV6PXzAqrFetX9HiTvIO8K72f+Oj78H26fGHfFb57fB+u1FrJW9nhB/y8/Pb4PfLX8U/z
+        /z4AE+AfUBXwNNA0MDewN4gSFBXUFPQm2Dm4JPhBiG6IMKQ7VDI0MrQxdC7MNaw0bGSV8ar1q66HK4Rz
+        wzsjsBGhEQ0Rs6vdVu9dPR5pEVkQObRGZ03WmqtrFdYmrT0TJRnFjDoZjY4Oi26K/sD0Y9YxZ2O8Yqpj
+        ZlgurH2s52xHdhl7imPHKeVMxNrFlsZOxtnF7YmbineIL4+f5rpwK7kvEzwTahLmEv0SjyQuJIUltSbj
+        kqOTT/FkeIm8nhSVlKyUgVSD1ILUkTSbtL1pM3xvfkM6lL4mvVNAFf1M9Ql1hVuFoxn2GVUZbzNDM09m
+        SWfxsvqy9bN3ZE/kuOd8vQ61jrWuO1ctd3Pu6Hqn9bUboA0xG7o3amzM3zi+yWPT0c2EzYmbf8gzySvN
+        e70lbEtXvnL+pvyxrR5bmwskCvgFw9tst9VsR23nbu/fYb5j/45PhezCa0UmReVFH4pZxde+Mv2q4quF
+        nbE7+0ssSw7uwuzi7Rra7bD7aKl0aU7p2B7fPe1l9LLCstd7o/ZeLV9WXrOPsE+4b6TCp6Jzv+b+Xfs/
+        VMZX3qlyrmqtVqreUT13gH1g8KDjwZYa5ZqimveHuIfu1nrUttdp15UfxhzOOPy0PrS+92vG140NCg1F
+        DR+P8I6MHA082tNo1djYpNRU0gw3C5unjkUeu/mN6zedLYYtta201qLj4Ljw+LNvo78dOuF9ovsk42TL
+        d1rfVbdR2grbofbs9pmO+I6RzvDOgVMrTnV32Xa1fW/0/ZHTaqerzsieKTlLOJt/duFczrnZ86nnpy/E
+        XRjrjup+cHHVxds9AT39l7wvXbnsfvlir1PvuSt2V05ftbl66hrjWsd1y+vtfRZ9bT9Y/NDWb9nffsPq
+        RudN65tdA8sHzg46DF645Xrr8m2v29fvrLwzMBQydHc4cnjkLvvu5L2key/vZ9yff7DpIfph4SOpR+WP
+        lR7X/aj3Y+uI5ciZUdfRvidBTx6Mscae/5T+04fx/Kfkp+UTqhONk2aTp6fcp24+W/1s/Hnq8/npgp+l
+        f65+ofviu18cf+mbWTUz/pL/cuHX4lfyr468Xva6e9Z/9vGb5Dfzc4Vv5d8efcd41/s+7P3EfOYH7IeK
+        j3ofuz55f3q4kLyw8Bv3hPP74uYdwgAAAAlwSFlzAAALDAAACwwBP0AiyAAACdNJREFUeF7t3dtOW4cW
+        heFe9VUibakv1/eoVGk/TFedps2hnCGAjTnYnAlgbGNzJpUqza2xgL2zmSlL4oqV8V98Fx2q190/YxwC
+        30XEdwA8pQGAjzQA8JEGAD7SAMBHGgD4SAMAH2kA4CMNAHykAYCPNADwkQYAPtIAwEcaAPhIAwAfaQDg
+        Iw0AfKQBgI80APCRBgA+0gDARxoA+EgDAB9pAOAjDQB8pAGAjzQA8JEGAD7SAMBHGgD4SAMAH2kA4CMN
+        AHykAYCPNADwkQYAPtIAwEcaAPhIAwAfaQDgIw0AfKQBgI80APCRBgA+0gDARxoA+EgDAB9pAOAjDQB8
+        pAGAjzQA8JEGAD7SAMBHGgD4SAMAH2kA4CMNAHykAYCPNADwkQYAPtIAwEcaAPhIAwAfaQDgIw0AfKQB
+        gI80APCRBgA+0gDARxoA+EgDAB9pAOAjDQB8pAGAjzQA8JEGAD7SAMBHGgD4SAMAH2kA4CMNAHykAYCP
+        NADwkQYAPtIAwEcaAPhIAwAfaQDgIw0AfKQBgI80APCRBgA+0gDARxoA+EjDg6JovCqKxk9F0Zgvisbf
+        RdEIAC+eWlWzavfV464fS8N9/D8WReNmc3MrBsNh3H7+HJ+/oP8G8DI8blPNql01rJYf9/2PB6AoGt8X
+        ReOXZnMlRqNx3Nx+jpub27gGUBtqVu2qYbWsptX24/i/dgB+brXacXN796Cr65t713F5BeClU6sP3ZbH
+        4PY21LS+JHgc//8dgKJo/KCvH670ED3s8iouLq/i/OISQM2oXTX80PL9ZwP/euoA/NzpdP8b/dn5RYzP
+        zu+dxWgM4KVTqw/dquGHY7DR6X71XcCXB2C91x/E+PwyRmfncTo+i+HoLAanYwA1o3bVsFpW072Tvg5A
+        +6kD8NdofB6no/MY6iGDUfQHozjpnwKoGbWrhtXyQ9NF0Th76gDEqf7EH46jPziN3skweieDOO4BqBu1
+        q4bVsppW22r8yQOg//Hk5LR8wOFRPw6PTuLTIYC6UbtqWC2rabVdeQB0MY6O++UDDg6OY2//CEBNqWG1
+        rKZPTobVB+CoN4iDw17sHRzH7v5h7Ox+im0AtaN21bBaVtNqu/IA6FroBTu7h7G1cxCb2/vR3QJQN2pX
+        DatlNa22Kw/A/kHvLv7tg+hu7kWnuxsbHQB1o3bVsFpW02q78gDs7t3Frxevb+zE2vp2rK5tAagZtauG
+        1bKaVtuVB2B7+1N0unuxtr4T7dWtWGlvRmulC6Bm1K4aVstqWm1XHoDu5n55NfTCZqsby81OLC1vAKgZ
+        tauG1bKaVtuVB2Cjuxvtta1ornRicXk9Pi6txcLiKoCaUbtqWC2rabVdeQD0dYPePuiF8x9XY26hHbPz
+        KwBqRu2qYbWsptV25QHQ24Xl5kYsKP75lZiZbcX0TBNAzahdNayW1bTarjwArXY3FpfWY26+HdOzzZic
+        Xo6JqSUANaN21bBaVtNqu/IANFud8uuHmblWTE4vxZ+Ti/Fh4iOAmlG7algtq2m1XXkA9OmhLsbUdDP+
+        nFiM9x8+xrv3CwBqRu2qYbWsptV25QFYXFyP2dmVmJhcivcfFuLtu/n44+0cgJpRu2pYLatptV15ABYW
+        12J6thUfJhbj7fv5+P3tXLz5YxZAzahdNayW1bTarjwA8wvt8sMDXQ494LffZ+L1m2kANaN21bBaVtNq
+        u/IA6GsFfYL47sN8eUX0oMZvUwBqRu2qYbWsptV25QHQNxBMTN69/dcF0YN+fT0JoGbUrhpWy2pabVce
+        gJm5lfKTwz/ezcfrNzPx6+upKBqTAGpG7aphtaym1Xb1Abj/AFBfOzR+my4f9MuvEwBqRu2qYbWsptU2
+        BwAwwQEAjD3vAPAZAPBNeNZnAPwtAPBteNbfAvB9AMC34VnfB8B3AgLfhmd9JyD/FgD4Njzr3wLoBwfM
+        zq3ExNRyvP/zY7x9v1B+iACgXtSuGlbLalptVx6ApeZG+bPEpmaa5Q8U0APefVgAUDNqVw2rZTWttisP
+        QHOlGx8X18pPDKdm7n4cmB4CoF7UrhpWy2pabVcegHZ7s/zJIfMLqzE7d/cDQaemlwHUjNpVw2pZTavt
+        ygOwur599y5gaf3uCMy3y28gAFAvalcNq2U1rbYrD8B6ZzdW9KPBW53yhfrkUD9bHEC9qF01rJbVtNqu
+        PAD6baJrG9uxsrpZvlAfHOgXCwCoF7V7F/9m2bTarjwAW9ufYqO7F6vrO+XVaLU3y7cPAOpF7aphtaym
+        1XblAeDXgwPfhmf9evD9g17s7N4dAf02Ub14owOgbtSuGlbLalptVx6Aw8OT2D84jt3dw9jeOYit7f3Y
+        3AJQN2pXDatlNX14dFJ9AI57w/sj0Iu9/aPY3TsqrweAelG7algtq2m1XXkA+v3TOO4N4vCoH58Oe3Hw
+        qVdeDwD1onbVsFpW02q76gD8NRiOoj84jd7JsHzR0XG/fOsAoF7UrhpWy2paiqJx+dQB6B73+nE6OovB
+        cBz9wShO+nfHAEC9qF01rJbV9NFx+RlA+6kD8O+NTjfOzi9idHZevmh4Oo7Bvb7eHQB40R56VbtqWC2r
+        6fWN8h8D/fzUAfihKBp/X1xcxfnFVZydX8b47CLGZ+cxGgOoCzWrdtWwWlbTaluN/+MBeHgX0Gq14+r6
+        Ji6vruPi8u4Y3NHD7unBAF6GL9u871XtqmG1rKa/9qf/1w7A90XR+KXZbMXwdBTX1zflA66ur+Pq6rp8
+        IICXSY2WrV7flO2qYbWsptX24/jTAfjiEPxYFI2bbnczBoNh3Nx+/sItgBfnf42qWbWrhtXy474rD8D9
+        EXhVFI2fiqKxqL8/BFAbalbtvnrc9WNpAOAjDQB8pAGAjzQA8JEGAD7SAMBHGgD4SAMAH2kA4CMNAHyk
+        AYCPNADwkQYAPtIAwEcaAPhIAwAfaQDgIw0AfKQBgI80APCRBgA+0gDARxoA+EgDAB9pAOAjDQB8pAGA
+        jzQA8JEGAD7SAMBHGgD4SAMAH2kA4CMNAHykAYCPNADwkQYAPtIAwEcaAPhIAwAfaQDgIw0AfKQBgI80
+        APCRBgA+0gDARxoA+EgDAB9pAOAjDQB8pAGAjzQA8JEGAD7SAMBHGgD4SAMAH2kA4CMNAHykAYCPNADw
+        kQYAPtIAwEcaAPhIAwAfaQDgIw0AfKQBgI80APCRBgA+0gDARxoA+EgDAB9pAOAjDQB8pAGAjzQA8JEG
+        AD7SAMBHGgD4SAMAH2kA4CMNAHykAYCPNADwkQYAPtIAwEcaAPhIAwAfaQDgIw0AfKQBgI80APCRBgA+
+        0gDARxoA+EgDAB9pAOAjDQB8pAGAjzQA8JEGAD7SAMBHGgD4SAMAH/8BZ2GaHZyucrQAAAAASUVORK5C
+        YII=
+</value>
+  </data>
+  <data name="Setting.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==
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAF3SURBVFhH5djbSgJRFMbxHsP7wBfYT7jvu46QDIoI
+        C4QNQRAIgVBRSdpxpgZN83wYx5nZOjNqrvgEd73DGvhfzdX3g32ztohoS0iVElLtCakehVQdhmE39qfg
+        AZBtIdX70Y0TjsJ4SQw/7MZ+OAip0kDJnD3UdJAsyXIjKvWm7MJu7M+X6lpIlQWK3ZhEq8pgRvfdKdvK
+        /Rk1/XglpHKA0ulPF3Tb0eyDAzzWKL3pgq7bmn1wMChdPadiK2QfHAxKW8/pqhmwDw4GpRXOqdAI2AcH
+        g9IME7qs++yDg0H5DhK6qE3YBweD0vATOq967IODQfnyE1KOxz44GJTaJKb855h9cDAoVS+mU9tlHxwM
+        iuPFdGK57IPDH8o4ouO3EfvgYFA+xhEdvg7ZB4cNil3uhquc5dLBy5Bt2P/U0+Z0kN0tOhqHlpzt0v7z
+        gF3Yjf1w2ByZ0jjD7RSs8K7l/+Ant7Ab+8058t/hOiOkquBNMQy7sX99uP4F5D4U8hdr4uMAAAAASUVO
+        RK5CYII=
 </value>
   </data>
-  <data name="Export.NormalImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+  <data name="Setting.NormalImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAGpSURBVFhH5dg/ayJBGMfxB4YFXTARBAvBQhAsBEEQ
+        ZLnNzFu4I6aYV5kyF9tgbad1jrsYY9T4Z3fcnV2f45e38Sx8q6l+n2IWhpiZjDFVY8wPY8xPY4wVGHZj
+        fxUepLW+0Vrfz+fzR+fclgV+2I39cNBa31Icx/FisXi6XpnL8io27F8ul89xHN9RFEWTPM+ToihZet57
+        F0XRA43HYwsp7wvxwQEeNBqNbFmWnOW5+OAADxoOh7YoS3ZZJj44wIMGg4H1RcGpu4gPDvCgfr9vvfd8
+        TlPxwQEe1Ov1bO49H8+J+OAAD+p2uxaXzNfpJD44wIM6nY69ZDnvDkfxwQEe1G637SXLeLs/iA8O8KBW
+        q2XdJePNbi8+OMCDms2mxe9o/bkTHxzgQY1GwybO8WrzKT44wIPq9bpNUsdv64344AAPqtVq9pw6/vv+
+        IT44wIPCMJzsvg7Jv/UH/1m9iw3794ejC8PwgSqVyt3LbPZ8SpLvg9e3lbiwG/vhAA8KguA2CIL739Pp
+        42a73eNQWtiN/XCAB+GhVilVVUrFSqlfSikrMOzG/u+H6/+yQ4jdXN8e9AAAAABJRU5ErkJggg==
+</value>
+  </data>
+  <data name="PrintTest.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFfSURBVFhH5dhNTsJgFIXhM2WiCxL2oAEHrJKhQSYM
+        JIgzjSLIX0sRKPSPtl+Lo2uOgVbWcJu8CzhP8nVwISIAUAFwA+AWQFNh3M39lZMHrgDUu91uyxjji8KP
+        u7mfDgCuiVLt958fkjSTie3I62iqLu7m/sHgpQ2gRpSG6/nmc2bL23imtuHMkp0f5ADuidIMoljev+bq
+        o8PpH4NmcIjlY7JQHx0KlPCQyHBqqY8OJUqcyGhuq48OBUoUJzJeLNVHhwLlkKQysRz10eECZbpcqe8C
+        JU6NzJ1v9dGhQElSI9Zqoz46lCgmE3u9VR8dCpTUZOJsXPXRoUTJclltd+qjQ4FislzW7l59dChR8lw2
+        e099dDijNA5xYnZBKFvPVxv3x0lanA5qT71eOzsexQsjcf1AXdzN/XQ4H5l4fqs/djqtIIzC/Pgj2uJu
+        7i/Okf8O11UAd6c3pS3u5v6/w/UvTaFspAxAMh4AAAAASUVORK5CYII=
+</value>
+  </data>
+  <data name="PrintTest.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAACH
+        DwAAjA8AAP1SAACBQAAAfXkAAOmLAAA85QAAGcxzPIV3AAAKOWlDQ1BQaG90b3Nob3AgSUNDIHByb2Zp
+        bGUAAEjHnZZ3VFTXFofPvXd6oc0w0hl6ky4wgPQuIB0EURhmBhjKAMMMTWyIqEBEEREBRZCggAGjoUis
+        iGIhKKhgD0gQUGIwiqioZEbWSnx5ee/l5ffHvd/aZ+9z99l7n7UuACRPHy4vBZYCIJkn4Ad6ONNXhUfQ
+        sf0ABniAAaYAMFnpqb5B7sFAJC83F3q6yAn8i94MAUj8vmXo6U+ng/9P0qxUvgAAyF/E5mxOOkvE+SJO
+        yhSkiu0zIqbGJIoZRomZL0pQxHJijlvkpZ99FtlRzOxkHlvE4pxT2clsMfeIeHuGkCNixEfEBRlcTqaI
+        b4tYM0mYzBXxW3FsMoeZDgCKJLYLOKx4EZuImMQPDnQR8XIAcKS4LzjmCxZwsgTiQ7mkpGbzuXHxArou
+        S49uam3NoHtyMpM4AoGhP5OVyOSz6S4pyalMXjYAi2f+LBlxbemiIluaWltaGpoZmX5RqP+6+Dcl7u0i
+        vQr43DOI1veH7a/8UuoAYMyKarPrD1vMfgA6tgIgd/8Pm+YhACRFfWu/8cV5aOJ5iRcIUm2MjTMzM424
+        HJaRuKC/6386/A198T0j8Xa/l4fuyollCpMEdHHdWClJKUI+PT2VyeLQDf88xP848K/zWBrIieXwOTxR
+        RKhoyri8OFG7eWyugJvCo3N5/6mJ/zDsT1qca5Eo9Z8ANcoISN2gAuTnPoCiEAESeVDc9d/75oMPBeKb
+        F6Y6sTj3nwX9+65wifiRzo37HOcSGExnCfkZi2viawnQgAAkARXIAxWgAXSBITADVsAWOAI3sAL4gWAQ
+        DtYCFogHyYAPMkEu2AwKQBHYBfaCSlAD6kEjaAEnQAc4DS6Ay+A6uAnugAdgBIyD52AGvAHzEARhITJE
+        geQhVUgLMoDMIAZkD7lBPlAgFA5FQ3EQDxJCudAWqAgqhSqhWqgR+hY6BV2ArkID0D1oFJqCfoXewwhM
+        gqmwMqwNG8MM2An2hoPhNXAcnAbnwPnwTrgCroOPwe3wBfg6fAcegZ/DswhAiAgNUUMMEQbigvghEUgs
+        wkc2IIVIOVKHtCBdSC9yCxlBppF3KAyKgqKjDFG2KE9UCIqFSkNtQBWjKlFHUe2oHtQt1ChqBvUJTUYr
+        oQ3QNmgv9Cp0HDoTXYAuRzeg29CX0HfQ4+g3GAyGhtHBWGE8MeGYBMw6TDHmAKYVcx4zgBnDzGKxWHms
+        AdYO64dlYgXYAux+7DHsOewgdhz7FkfEqeLMcO64CBwPl4crxzXhzuIGcRO4ebwUXgtvg/fDs/HZ+BJ8
+        Pb4LfwM/jp8nSBN0CHaEYEICYTOhgtBCuER4SHhFJBLVidbEACKXuIlYQTxOvEIcJb4jyZD0SS6kSJKQ
+        tJN0hHSedI/0ikwma5MdyRFkAXknuZF8kfyY/FaCImEk4SXBltgoUSXRLjEo8UISL6kl6SS5VjJHslzy
+        pOQNyWkpvJS2lIsUU2qDVJXUKalhqVlpirSptJ90snSxdJP0VelJGayMtoybDFsmX+awzEWZMQpC0aC4
+        UFiULZR6yiXKOBVD1aF6UROoRdRvqP3UGVkZ2WWyobJZslWyZ2RHaAhNm+ZFS6KV0E7QhmjvlygvcVrC
+        WbJjScuSwSVzcopyjnIcuUK5Vrk7cu/l6fJu8onyu+U75B8poBT0FQIUMhUOKlxSmFakKtoqshQLFU8o
+        3leClfSVApXWKR1W6lOaVVZR9lBOVd6vfFF5WoWm4qiSoFKmclZlSpWiaq/KVS1TPaf6jC5Ld6In0Svo
+        PfQZNSU1TzWhWq1av9q8uo56iHqeeqv6Iw2CBkMjVqNMo1tjRlNV01czV7NZ874WXouhFa+1T6tXa05b
+        RztMe5t2h/akjpyOl06OTrPOQ12yroNumm6d7m09jB5DL1HvgN5NfVjfQj9ev0r/hgFsYGnANThgMLAU
+        vdR6KW9p3dJhQ5Khk2GGYbPhqBHNyMcoz6jD6IWxpnGE8W7jXuNPJhYmSSb1Jg9MZUxXmOaZdpn+aqZv
+        xjKrMrttTjZ3N99o3mn+cpnBMs6yg8vuWlAsfC22WXRbfLS0suRbtlhOWWlaRVtVWw0zqAx/RjHjijXa
+        2tl6o/Vp63c2ljYCmxM2v9ga2ibaNtlOLtdZzllev3zMTt2OaVdrN2JPt4+2P2Q/4qDmwHSoc3jiqOHI
+        dmxwnHDSc0pwOub0wtnEme/c5jznYuOy3uW8K+Lq4Vro2u8m4xbiVun22F3dPc692X3Gw8Jjncd5T7Sn
+        t+duz2EvZS+WV6PXzAqrFetX9HiTvIO8K72f+Oj78H26fGHfFb57fB+u1FrJW9nhB/y8/Pb4PfLX8U/z
+        /z4AE+AfUBXwNNA0MDewN4gSFBXUFPQm2Dm4JPhBiG6IMKQ7VDI0MrQxdC7MNaw0bGSV8ar1q66HK4Rz
+        wzsjsBGhEQ0Rs6vdVu9dPR5pEVkQObRGZ03WmqtrFdYmrT0TJRnFjDoZjY4Oi26K/sD0Y9YxZ2O8Yqpj
+        ZlgurH2s52xHdhl7imPHKeVMxNrFlsZOxtnF7YmbineIL4+f5rpwK7kvEzwTahLmEv0SjyQuJIUltSbj
+        kqOTT/FkeIm8nhSVlKyUgVSD1ILUkTSbtL1pM3xvfkM6lL4mvVNAFf1M9Ql1hVuFoxn2GVUZbzNDM09m
+        SWfxsvqy9bN3ZE/kuOd8vQ61jrWuO1ctd3Pu6Hqn9bUboA0xG7o3amzM3zi+yWPT0c2EzYmbf8gzySvN
+        e70lbEtXvnL+pvyxrR5bmwskCvgFw9tst9VsR23nbu/fYb5j/45PhezCa0UmReVFH4pZxde+Mv2q4quF
+        nbE7+0ssSw7uwuzi7Rra7bD7aKl0aU7p2B7fPe1l9LLCstd7o/ZeLV9WXrOPsE+4b6TCp6Jzv+b+Xfs/
+        VMZX3qlyrmqtVqreUT13gH1g8KDjwZYa5ZqimveHuIfu1nrUttdp15UfxhzOOPy0PrS+92vG140NCg1F
+        DR+P8I6MHA082tNo1djYpNRU0gw3C5unjkUeu/mN6zedLYYtta201qLj4Ljw+LNvo78dOuF9ovsk42TL
+        d1rfVbdR2grbofbs9pmO+I6RzvDOgVMrTnV32Xa1fW/0/ZHTaqerzsieKTlLOJt/duFczrnZ86nnpy/E
+        XRjrjup+cHHVxds9AT39l7wvXbnsfvlir1PvuSt2V05ftbl66hrjWsd1y+vtfRZ9bT9Y/NDWb9nffsPq
+        RudN65tdA8sHzg46DF645Xrr8m2v29fvrLwzMBQydHc4cnjkLvvu5L2key/vZ9yff7DpIfph4SOpR+WP
+        lR7X/aj3Y+uI5ciZUdfRvidBTx6Mscae/5T+04fx/Kfkp+UTqhONk2aTp6fcp24+W/1s/Hnq8/npgp+l
+        f65+ofviu18cf+mbWTUz/pL/cuHX4lfyr468Xva6e9Z/9vGb5Dfzc4Vv5d8efcd41/s+7P3EfOYH7IeK
+        j3ofuz55f3q4kLyw8Bv3hPP74uYdwgAAAAlwSFlzAAALDAAACwwBP0AiyAAACdNJREFUeF7t3dtOW4cW
+        heFe9VUibakv1/eoVGk/TFedps2hnCGAjTnYnAlgbGNzJpUqza2xgL2zmSlL4oqV8V98Fx2q190/YxwC
+        30XEdwA8pQGAjzQA8JEGAD7SAMBHGgD4SAMAH2kA4CMNAHykAYCPNADwkQYAPtIAwEcaAPhIAwAfaQDg
+        Iw0AfKQBgI80APCRBgA+0gDARxoA+EgDAB9pAOAjDQB8pAGAjzQA8JEGAD7SAMBHGgD4SAMAH2kA4CMN
+        AHykAYCPNADwkQYAPtIAwEcaAPhIAwAfaQDgIw0AfKQBgI80APCRBgA+0gDARxoA+EgDAB9pAOAjDQB8
+        pAGAjzQA8JEGAD7SAMBHGgD4SAMAH2kA4CMNAHykAYCPNADwkQYAPtIAwEcaAPhIAwAfaQDgIw0AfKQB
+        gI80APCRBgA+0gDARxoA+EgDAB9pAOAjDQB8pAGAjzQA8JEGAD7SAMBHGgD4SAMAH2kA4CMNAHykAYCP
+        NADwkQYAPtIAwEcaAPhIAwAfaQDgIw0AfKQBgI80APCRBgA+0gDARxoA+EjDg6JovCqKxk9F0Zgvisbf
+        RdEIAC+eWlWzavfV464fS8N9/D8WReNmc3MrBsNh3H7+HJ+/oP8G8DI8blPNql01rJYf9/2PB6AoGt8X
+        ReOXZnMlRqNx3Nx+jpub27gGUBtqVu2qYbWsptX24/i/dgB+brXacXN796Cr65t713F5BeClU6sP3ZbH
+        4PY21LS+JHgc//8dgKJo/KCvH670ED3s8iouLq/i/OISQM2oXTX80PL9ZwP/euoA/NzpdP8b/dn5RYzP
+        zu+dxWgM4KVTqw/dquGHY7DR6X71XcCXB2C91x/E+PwyRmfncTo+i+HoLAanYwA1o3bVsFpW072Tvg5A
+        +6kD8NdofB6no/MY6iGDUfQHozjpnwKoGbWrhtXyQ9NF0Th76gDEqf7EH46jPziN3skweieDOO4BqBu1
+        q4bVsppW22r8yQOg//Hk5LR8wOFRPw6PTuLTIYC6UbtqWC2rabVdeQB0MY6O++UDDg6OY2//CEBNqWG1
+        rKZPTobVB+CoN4iDw17sHRzH7v5h7Ox+im0AtaN21bBaVtNqu/IA6FroBTu7h7G1cxCb2/vR3QJQN2pX
+        DatlNa22Kw/A/kHvLv7tg+hu7kWnuxsbHQB1o3bVsFpW02q78gDs7t3Frxevb+zE2vp2rK5tAagZtauG
+        1bKaVtuVB2B7+1N0unuxtr4T7dWtWGlvRmulC6Bm1K4aVstqWm1XHoDu5n55NfTCZqsby81OLC1vAKgZ
+        tauG1bKaVtuVB2Cjuxvtta1ornRicXk9Pi6txcLiKoCaUbtqWC2rabVdeQD0dYPePuiF8x9XY26hHbPz
+        KwBqRu2qYbWsptV25QHQ24Xl5kYsKP75lZiZbcX0TBNAzahdNayW1bTarjwArXY3FpfWY26+HdOzzZic
+        Xo6JqSUANaN21bBaVtNqu/IANFud8uuHmblWTE4vxZ+Ti/Fh4iOAmlG7algtq2m1XXkA9OmhLsbUdDP+
+        nFiM9x8+xrv3CwBqRu2qYbWsptV25QFYXFyP2dmVmJhcivcfFuLtu/n44+0cgJpRu2pYLatptV15ABYW
+        12J6thUfJhbj7fv5+P3tXLz5YxZAzahdNayW1bTarjwA8wvt8sMDXQ494LffZ+L1m2kANaN21bBaVtNq
+        u/IA6GsFfYL47sN8eUX0oMZvUwBqRu2qYbWsptV25QHQNxBMTN69/dcF0YN+fT0JoGbUrhpWy2pabVce
+        gJm5lfKTwz/ezcfrNzPx6+upKBqTAGpG7aphtaym1Xb1Abj/AFBfOzR+my4f9MuvEwBqRu2qYbWsptU2
+        BwAwwQEAjD3vAPAZAPBNeNZnAPwtAPBteNbfAvB9AMC34VnfB8B3AgLfhmd9JyD/FgD4Njzr3wLoBwfM
+        zq3ExNRyvP/zY7x9v1B+iACgXtSuGlbLalptVx6ApeZG+bPEpmaa5Q8U0APefVgAUDNqVw2rZTWttisP
+        QHOlGx8X18pPDKdm7n4cmB4CoF7UrhpWy2pabVcegHZ7s/zJIfMLqzE7d/cDQaemlwHUjNpVw2pZTavt
+        ygOwur599y5gaf3uCMy3y28gAFAvalcNq2U1rbYrD8B6ZzdW9KPBW53yhfrkUD9bHEC9qF01rJbVtNqu
+        PAD6baJrG9uxsrpZvlAfHOgXCwCoF7V7F/9m2bTarjwAW9ufYqO7F6vrO+XVaLU3y7cPAOpF7aphtaym
+        1XblAeDXgwPfhmf9evD9g17s7N4dAf02Ub14owOgbtSuGlbLalptVx6Aw8OT2D84jt3dw9jeOYit7f3Y
+        3AJQN2pXDatlNX14dFJ9AI57w/sj0Iu9/aPY3TsqrweAelG7algtq2m1XXkA+v3TOO4N4vCoH58Oe3Hw
+        qVdeDwD1onbVsFpW02q76gD8NRiOoj84jd7JsHzR0XG/fOsAoF7UrhpWy2paiqJx+dQB6B73+nE6OovB
+        cBz9wShO+nfHAEC9qF01rJbV9NFx+RlA+6kD8O+NTjfOzi9idHZevmh4Oo7Bvb7eHQB40R56VbtqWC2r
+        6fWN8h8D/fzUAfihKBp/X1xcxfnFVZydX8b47CLGZ+cxGgOoCzWrdtWwWlbTaluN/+MBeHgX0Gq14+r6
+        Ji6vruPi8u4Y3NHD7unBAF6GL9u871XtqmG1rKa/9qf/1w7A90XR+KXZbMXwdBTX1zflA66ur+Pq6rp8
+        IICXSY2WrV7flO2qYbWsptX24/jTAfjiEPxYFI2bbnczBoNh3Nx+/sItgBfnf42qWbWrhtXy474rD8D9
+        EXhVFI2fiqKxqL8/BFAbalbtvnrc9WNpAOAjDQB8pAGAjzQA8JEGAD7SAMBHGgD4SAMAH2kA4CMNAHyk
+        AYCPNADwkQYAPtIAwEcaAPhIAwAfaQDgIw0AfKQBgI80APCRBgA+0gDARxoA+EgDAB9pAOAjDQB8pAGA
+        jzQA8JEGAD7SAMBHGgD4SAMAH2kA4CMNAHykAYCPNADwkQYAPtIAwEcaAPhIAwAfaQDgIw0AfKQBgI80
+        APCRBgA+0gDARxoA+EgDAB9pAOAjDQB8pAGAjzQA8JEGAD7SAMBHGgD4SAMAH2kA4CMNAHykAYCPNADw
+        kQYAPtIAwEcaAPhIAwAfaQDgIw0AfKQBgI80APCRBgA+0gDARxoA+EgDAB9pAOAjDQB8pAGAjzQA8JEG
+        AD7SAMBHGgD4SAMAH2kA4CMNAHykAYCPNADwkQYAPtIAwEcaAPhIAwAfaQDgIw0AfKQBgI80APCRBgA+
+        0gDARxoA+EgDAB9pAOAjDQB8pAGAjzQA8JEGAD7SAMBHGgD4SAMAH/8BZ2GaHZyucrQAAAAASUVORK5C
+        YII=
+</value>
+  </data>
+  <data name="PrintTest.MoveImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAF3SURBVFhH5djbSgJRFMbxHsP7wBfYT7jvu46QDIoI
+        C4QNQRAIgVBRSdpxpgZN83wYx5nZOjNqrvgEd73DGvhfzdX3g32ztohoS0iVElLtCakehVQdhmE39qfg
+        AZBtIdX70Y0TjsJ4SQw/7MZ+OAip0kDJnD3UdJAsyXIjKvWm7MJu7M+X6lpIlQWK3ZhEq8pgRvfdKdvK
+        /Rk1/XglpHKA0ulPF3Tb0eyDAzzWKL3pgq7bmn1wMChdPadiK2QfHAxKW8/pqhmwDw4GpRXOqdAI2AcH
+        g9IME7qs++yDg0H5DhK6qE3YBweD0vATOq967IODQfnyE1KOxz44GJTaJKb855h9cDAoVS+mU9tlHxwM
+        iuPFdGK57IPDH8o4ouO3EfvgYFA+xhEdvg7ZB4cNil3uhquc5dLBy5Bt2P/U0+Z0kN0tOhqHlpzt0v7z
+        gF3Yjf1w2ByZ0jjD7RSs8K7l/+Ant7Ab+8058t/hOiOkquBNMQy7sX99uP4F5D4U8hdr4uMAAAAASUVO
+        RK5CYII=
+</value>
+  </data>
+  <data name="PrintTest.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=
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAGpSURBVFhH5dg/ayJBGMfxB4YFXTARBAvBQhAsBEEQ
+        ZLnNzFu4I6aYV5kyF9tgbad1jrsYY9T4Z3fcnV2f45e38Sx8q6l+n2IWhpiZjDFVY8wPY8xPY4wVGHZj
+        fxUepLW+0Vrfz+fzR+fclgV+2I39cNBa31Icx/FisXi6XpnL8io27F8ul89xHN9RFEWTPM+ToihZet57
+        F0XRA43HYwsp7wvxwQEeNBqNbFmWnOW5+OAADxoOh7YoS3ZZJj44wIMGg4H1RcGpu4gPDvCgfr9vvfd8
+        TlPxwQEe1Ov1bO49H8+J+OAAD+p2uxaXzNfpJD44wIM6nY69ZDnvDkfxwQEe1G637SXLeLs/iA8O8KBW
+        q2XdJePNbi8+OMCDms2mxe9o/bkTHxzgQY1GwybO8WrzKT44wIPq9bpNUsdv64344AAPqtVq9pw6/vv+
+        IT44wIPCMJzsvg7Jv/UH/1m9iw3794ejC8PwgSqVyt3LbPZ8SpLvg9e3lbiwG/vhAA8KguA2CIL739Pp
+        42a73eNQWtiN/XCAB+GhVilVVUrFSqlfSikrMOzG/u+H6/+yQ4jdXN8e9AAAAABJRU5ErkJggg==
 </value>
   </data>
+  <data name="GenSN.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFfSURBVFhH5dhNTsJgFIXhM2WiCxL2oAEHrJKhQSYM
+        JIgzjSLIX0sRKPSPtl+Lo2uOgVbWcJu8CzhP8nVwISIAUAFwA+AWQFNh3M39lZMHrgDUu91uyxjji8KP
+        u7mfDgCuiVLt958fkjSTie3I62iqLu7m/sHgpQ2gRpSG6/nmc2bL23imtuHMkp0f5ADuidIMoljev+bq
+        o8PpH4NmcIjlY7JQHx0KlPCQyHBqqY8OJUqcyGhuq48OBUoUJzJeLNVHhwLlkKQysRz10eECZbpcqe8C
+        JU6NzJ1v9dGhQElSI9Zqoz46lCgmE3u9VR8dCpTUZOJsXPXRoUTJclltd+qjQ4FislzW7l59dChR8lw2
+        e099dDijNA5xYnZBKFvPVxv3x0lanA5qT71eOzsexQsjcf1AXdzN/XQ4H5l4fqs/djqtIIzC/Pgj2uJu
+        7i/Okf8O11UAd6c3pS3u5v6/w/UvTaFspAxAMh4AAAAASUVORK5CYII=
+</value>
+  </data>
+  <data name="GenSN.MoveImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAF3SURBVFhH5djbSgJRFMbxHsP7wBfYT7jvu46QDIoI
+        C4QNQRAIgVBRSdpxpgZN83wYx5nZOjNqrvgEd73DGvhfzdX3g32ztohoS0iVElLtCakehVQdhmE39qfg
+        AZBtIdX70Y0TjsJ4SQw/7MZ+OAip0kDJnD3UdJAsyXIjKvWm7MJu7M+X6lpIlQWK3ZhEq8pgRvfdKdvK
+        /Rk1/XglpHKA0ulPF3Tb0eyDAzzWKL3pgq7bmn1wMChdPadiK2QfHAxKW8/pqhmwDw4GpRXOqdAI2AcH
+        g9IME7qs++yDg0H5DhK6qE3YBweD0vATOq967IODQfnyE1KOxz44GJTaJKb855h9cDAoVS+mU9tlHxwM
+        iuPFdGK57IPDH8o4ouO3EfvgYFA+xhEdvg7ZB4cNil3uhquc5dLBy5Bt2P/U0+Z0kN0tOhqHlpzt0v7z
+        gF3Yjf1w2ByZ0jjD7RSs8K7l/+Ant7Ab+8058t/hOiOkquBNMQy7sX99uP4F5D4U8hdr4uMAAAAASUVO
+        RK5CYII=
+</value>
+  </data>
+  <data name="GenSN.NormalImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAGpSURBVFhH5dg/ayJBGMfxB4YFXTARBAvBQhAsBEEQ
+        ZLnNzFu4I6aYV5kyF9tgbad1jrsYY9T4Z3fcnV2f45e38Sx8q6l+n2IWhpiZjDFVY8wPY8xPY4wVGHZj
+        fxUepLW+0Vrfz+fzR+fclgV+2I39cNBa31Icx/FisXi6XpnL8io27F8ul89xHN9RFEWTPM+ToihZet57
+        F0XRA43HYwsp7wvxwQEeNBqNbFmWnOW5+OAADxoOh7YoS3ZZJj44wIMGg4H1RcGpu4gPDvCgfr9vvfd8
+        TlPxwQEe1Ov1bO49H8+J+OAAD+p2uxaXzNfpJD44wIM6nY69ZDnvDkfxwQEe1G637SXLeLs/iA8O8KBW
+        q2XdJePNbi8+OMCDms2mxe9o/bkTHxzgQY1GwybO8WrzKT44wIPq9bpNUsdv64344AAPqtVq9pw6/vv+
+        IT44wIPCMJzsvg7Jv/UH/1m9iw3794ejC8PwgSqVyt3LbPZ8SpLvg9e3lbiwG/vhAA8KguA2CIL739Pp
+        42a73eNQWtiN/XCAB+GhVilVVUrFSqlfSikrMOzG/u+H6/+yQ4jdXN8e9AAAAABJRU5ErkJggg==
+</value>
+  </data>
+  <metadata name="folderBrowserDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </metadata>
 </root>

+ 1 - 1
UAS_MES_ZDXW/Properties/Settings.Designer.cs

@@ -12,7 +12,7 @@ namespace UAS_MES_NEW.Properties {
     
     
     [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.8.0.0")]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.6.0.0")]
     internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
         
         private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));

+ 104 - 0
UAS_MES_ZDXW/PublicMethod/BaseUtil.cs

@@ -40,6 +40,110 @@ namespace UAS_MES_NEW.PublicMethod
             return !((c.Client.Poll(1000, SelectMode.SelectRead) && (c.Client.Available == 0)) || !c.Client.Connected);
         }
 
+        public static string GetRandomChar(string str)
+        {
+            byte[] buffer = Guid.NewGuid().ToByteArray();
+            int iSeed = BitConverter.ToInt32(buffer, 0);
+            Random random = new Random(iSeed);
+            string data = "";
+            for (int i = 0; i < 5; i++)
+            {
+                int index = random.Next(0, 31);
+                data += str[index];
+            }
+            return data;
+        }
+
+        public static string DToAny(double DB, int Type, string char_out)
+        {
+            string H = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+            long D;
+            double B;
+            string tempD = "", tempB = "";
+            for (int i = 0; i < char_out.Length; i++)
+            {
+                H = H.Replace(char_out[i].ToString(), "");
+            }
+            if (Type != H.Length && Type != 10 && Type != 16)
+            {
+                ShowError("字符长度截取错误,请检查进制和去除字符");
+                return "";
+            }
+            D = (long)DB;
+            B = DB - D;
+            if (D == 0)
+            {
+                tempD = "0";
+            }
+            while (D != 0)
+            {
+                tempD = H[(((int)D % Type))] + tempD;
+                D = D / Type;
+            }
+            for (int i = 0; i < 7; i++)
+            {
+                if (B == 0)
+                {
+                    break;
+                }
+                tempB += H[((int)(B * Type))];
+                B = B * Type - (int)(B * Type);
+            }
+            if (tempB == "")
+            {
+                return tempD;
+            }
+            else
+            {
+                return tempD + "." + tempB;
+            }
+        }
+
+        public static string DToAny(double DB, int Type)
+        {
+            string H = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+            string H1 = "23456789ABCDEFGHJKLMNPQRSTUVWXYZ";
+            long D;
+            double B;
+            string tempD = "", tempB = "";
+            if (Type == 32)
+            {
+                return GetRandomChar(H1);
+            }
+            else
+            {
+                D = (long)DB;
+                B = DB - D;
+                if (D == 0)
+                {
+                    tempD = "0";
+                }
+                while (D != 0)
+                {
+                    tempD = H[(((int)D % Type))] + tempD;
+                    D = D / Type;
+                }
+                for (int i = 0; i < 7; i++)
+                {
+                    if (B == 0)
+                    {
+                        break;
+                    }
+                    tempB += H[((int)(B * Type))];
+                    B = B * Type - (int)(B * Type);
+                }
+                if (tempB == "")
+                {
+                    return tempD;
+                }
+                else
+                {
+                    return tempD + "." + tempB;
+                }
+            }
+        }
+
+
         /// <summary>
         /// 通过DataTable的ColumnName和Caption来拼接一条语句
         /// </summary>

+ 1 - 0
UAS_MES_ZDXW/UAS_MES_ZDXW.csproj

@@ -897,6 +897,7 @@
     <Compile Include="FunctionCode\Packing\Packing_ProdWeightSet.Designer.cs">
       <DependentUpon>Packing_ProdWeightSet.cs</DependentUpon>
     </Compile>
+    <Compile Include="FunctionCode\Query\ArrayList.cs" />
     <Compile Include="FunctionCode\Query\Query_ExeProgress.cs">
       <SubType>Form</SubType>
     </Compile>

Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio