Jelajahi Sumber

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

Hcsy 8 tahun lalu
induk
melakukan
e44e255b64
31 mengubah file dengan 1780 tambahan dan 582 penghapusan
  1. 6 0
      MES_Interface/App.config
  2. 87 0
      MES_Interface/MES_Interface.csproj
  3. 22 0
      MES_Interface/Program.cs
  4. 36 0
      MES_Interface/Properties/AssemblyInfo.cs
  5. 71 0
      MES_Interface/Properties/Resources.Designer.cs
  6. 117 0
      MES_Interface/Properties/Resources.resx
  7. 30 0
      MES_Interface/Properties/Settings.Designer.cs
  8. 7 0
      MES_Interface/Properties/Settings.settings
  9. 1 1
      MES接口/DataHelper.cs
  10. 83 0
      TestProject/AutoSizeControl.cs
  11. 2 2
      UAS-MES/App.config
  12. 289 0
      UAS-MES/FunctionCode/Make/Make_LabelCheck.Designer.cs
  13. 216 0
      UAS-MES/FunctionCode/Make/Make_LabelCheck.cs
  14. 159 0
      UAS-MES/FunctionCode/Make/Make_LabelCheck.resx
  15. 88 118
      UAS-MES/FunctionCode/Make/Make_PackageCollection.Designer.cs
  16. 7 3
      UAS-MES/FunctionCode/Make/Make_PackageCollection.cs
  17. 15 0
      UAS-MES/FunctionCode/Make/Make_PackageCollection.resx
  18. 4 4
      UAS-MES/Properties/Settings.Designer.cs
  19. 2 2
      UAS-MES/Properties/Settings.settings
  20. 92 0
      UAS-MES/PublicMethod/AutoSizeControl.cs
  21. 28 4
      UAS-MES/PublicMethod/LogicHandler.cs
  22. 5 3
      UAS-MES/UAS-MES.csproj
  23. 3 3
      UAS_KanBan/UAS_KanBan.csproj
  24. 330 370
      UAS_MesInterface/DataHelper.cs
  25. 70 66
      UAS_MesInterface/LogicHandler.cs
  26. 1 0
      UAS_MesInterface/UAS_MesInterface.csproj
  27. TEMPAT SAMPAH
      UAS_MesInterface/tool/Oracle.ManagedDataAccess.dll
  28. TEMPAT SAMPAH
      UAS_WinForm.zip
  29. 1 1
      UAS_XmlAnalysor/Form1.Designer.cs
  30. 7 4
      UAS_XmlAnalysor/Form1.cs
  31. 1 1
      UAS_XmlAnalysor/UAS_XmlAnalysor.csproj

+ 6 - 0
MES_Interface/App.config

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+    <startup> 
+        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
+    </startup>
+</configuration>

+ 87 - 0
MES_Interface/MES_Interface.csproj

@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{7B7322F9-F0F3-4AC8-B7D2-C2120E9AEA8C}</ProjectGuid>
+    <OutputType>WinExe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>MES_Interface</RootNamespace>
+    <AssemblyName>MES_Interface</AssemblyName>
+    <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Deployment" />
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Net.Http" />
+    <Reference Include="System.Windows.Forms" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Form1.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="Form1.Designer.cs">
+      <DependentUpon>Form1.cs</DependentUpon>
+    </Compile>
+    <Compile Include="Program.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <EmbeddedResource Include="Properties\Resources.resx">
+      <Generator>ResXFileCodeGenerator</Generator>
+      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
+      <SubType>Designer</SubType>
+    </EmbeddedResource>
+    <Compile Include="Properties\Resources.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DependentUpon>Resources.resx</DependentUpon>
+    </Compile>
+    <None Include="Properties\Settings.settings">
+      <Generator>SettingsSingleFileGenerator</Generator>
+      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
+    </None>
+    <Compile Include="Properties\Settings.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DependentUpon>Settings.settings</DependentUpon>
+      <DesignTimeSharedInput>True</DesignTimeSharedInput>
+    </Compile>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="App.config" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>

+ 22 - 0
MES_Interface/Program.cs

@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace MES_Interface
+{
+    static class Program
+    {
+        /// <summary>
+        /// 应用程序的主入口点。
+        /// </summary>
+        [STAThread]
+        static void Main()
+        {
+            Application.EnableVisualStyles();
+            Application.SetCompatibleTextRenderingDefault(false);
+            Application.Run(new Form1());
+        }
+    }
+}

+ 36 - 0
MES_Interface/Properties/AssemblyInfo.cs

@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// 有关程序集的一般信息由以下
+// 控制。更改这些特性值可修改
+// 与程序集关联的信息。
+[assembly: AssemblyTitle("MES_Interface")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("MES_Interface")]
+[assembly: AssemblyCopyright("Copyright ©  2017")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+//将 ComVisible 设置为 false 将使此程序集中的类型
+//对 COM 组件不可见。  如果需要从 COM 访问此程序集中的类型,
+//请将此类型的 ComVisible 特性设置为 true。
+[assembly: ComVisible(false)]
+
+// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
+[assembly: Guid("7b7322f9-f0f3-4ac8-b7d2-c2120e9aea8c")]
+
+// 程序集的版本信息由下列四个值组成: 
+//
+//      主版本
+//      次版本
+//      生成号
+//      修订号
+//
+//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
+// 方法是按如下所示使用“*”: :
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

+ 71 - 0
MES_Interface/Properties/Resources.Designer.cs

@@ -0,0 +1,71 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     此代码由工具生成。
+//     运行时版本: 4.0.30319.42000
+//
+//     对此文件的更改可能导致不正确的行为,如果
+//     重新生成代码,则所做更改将丢失。
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace MES_Interface.Properties
+{
+
+
+    /// <summary>
+    ///   强类型资源类,用于查找本地化字符串等。
+    /// </summary>
+    // 此类是由 StronglyTypedResourceBuilder
+    // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
+    // 若要添加或删除成员,请编辑 .ResX 文件,然后重新运行 ResGen
+    // (以 /str 作为命令选项),或重新生成 VS 项目。
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    internal class Resources
+    {
+
+        private static global::System.Resources.ResourceManager resourceMan;
+
+        private static global::System.Globalization.CultureInfo resourceCulture;
+
+        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+        internal Resources()
+        {
+        }
+
+        /// <summary>
+        ///   返回此类使用的缓存 ResourceManager 实例。
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        internal static global::System.Resources.ResourceManager ResourceManager
+        {
+            get
+            {
+                if ((resourceMan == null))
+                {
+                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MES_Interface.Properties.Resources", typeof(Resources).Assembly);
+                    resourceMan = temp;
+                }
+                return resourceMan;
+            }
+        }
+
+        /// <summary>
+        ///   覆盖当前线程的 CurrentUICulture 属性
+        ///   使用此强类型的资源类的资源查找。
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        internal static global::System.Globalization.CultureInfo Culture
+        {
+            get
+            {
+                return resourceCulture;
+            }
+            set
+            {
+                resourceCulture = value;
+            }
+        }
+    }
+}

+ 117 - 0
MES_Interface/Properties/Resources.resx

@@ -0,0 +1,117 @@
+<?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.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: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" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+            </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" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+            </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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 30 - 0
MES_Interface/Properties/Settings.Designer.cs

@@ -0,0 +1,30 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//     Runtime Version:4.0.30319.42000
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace MES_Interface.Properties
+{
+
+
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
+    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
+    {
+
+        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+        public static Settings Default
+        {
+            get
+            {
+                return defaultInstance;
+            }
+        }
+    }
+}

+ 7 - 0
MES_Interface/Properties/Settings.settings

@@ -0,0 +1,7 @@
+<?xml version='1.0' encoding='utf-8'?>
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
+  <Profiles>
+    <Profile Name="(Default)" />
+  </Profiles>
+  <Settings />
+</SettingsFile>

+ 1 - 1
MES接口/DataHelper.cs

@@ -11,7 +11,7 @@ namespace MES_Interface
     /// </summary>
     class DataHelper
     {
-        //系统默认的的连接字符串
+        //系统默认的的连接字符串  
         private string ConnectionStrings = "";
         //用户选择的数据库的连接字符串
         public static OracleConnection connection = null;

+ 83 - 0
TestProject/AutoSizeControl.cs

@@ -0,0 +1,83 @@
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Windows.Forms;
+
+namespace TestProject
+{
+    class AutoSizeControl
+    {
+        /// <summary>
+        /// 记录所有控件
+        /// </summary>
+        List<Control> ctl = new List<Control>();
+        /// <summary>
+        /// 记录控件的初始化位置
+        /// </summary>
+        Dictionary<string, Point> CtlPoint = new Dictionary<string, Point>();
+        /// <summary>
+        /// 初始化的窗体宽度
+        /// </summary>
+        int InitFormWidth = 0;
+        /// <summary>
+        /// 初始化的窗体高度
+        /// </summary>
+        int InitFormHeight = 0;
+        /// <summary>
+        /// 窗体调整时的宽度
+        /// </summary>
+        int AutoSizeFormWidth = 0;
+        /// <summary>
+        /// 窗体调整时的高度
+        /// </summary>
+        int AutoSizeFormHeight = 0;
+        /// <summary>
+        /// 自适应宽度比例
+        /// </summary>
+        float AutoSizeWidthRate;
+        /// <summary>
+        /// 
+        /// </summary>
+        float AutoSizeHeigthRate;
+
+        public void InitControl(Control control)
+        {
+            InitFormWidth = control.Width;
+            InitFormHeight = control.Height;
+            foreach (Control item in control.Controls)
+            {
+                ctl.Add(item);
+                CtlPoint.Add(item.Name, item.Location);
+                if (item.Controls.Count > 0)
+                {
+                    AddControl(item);
+                }
+            }
+        }
+
+        public void AddControl(Control control)
+        {
+            foreach (Control item in control.Controls)
+            {
+                ctl.Add(item);
+                CtlPoint.Add(item.Name, item.Location);
+                if (item.Controls.Count > 0)
+                {
+                    AddControl(item);
+                }
+            }
+        }
+
+        public void AutoSize(Control control)
+        {
+            AutoSizeFormHeight = control.Height;
+            AutoSizeFormWidth = control.Width;
+            AutoSizeWidthRate = (float)(AutoSizeFormWidth * 1.0 / InitFormWidth);
+            AutoSizeHeigthRate = (float)(AutoSizeFormHeight * 1.0 / InitFormHeight);
+            for (int i = 0; i < ctl.Count; i++)
+            {
+                ctl[i].Location = new Point((int)(CtlPoint[ctl[i].Name].X * AutoSizeWidthRate), (int)(CtlPoint[ctl[i].Name].Y * AutoSizeHeigthRate));
+            }
+        }
+    }
+}

+ 2 - 2
UAS-MES/App.config

@@ -37,14 +37,14 @@
         <value />
       </setting>
       <setting name="FTPAddress" serializeAs="String">
-        <value>ftp://172.16.11.99/print/|uasmes|Administrator1@#</value>
+        <value>ftp://192.168.253.9/MESSetting/print/|mesconfig|Administrator1@#</value>
       </setting>
     </UAS_MES.Properties.Settings>
   </userSettings>
   <applicationSettings>
     <UAS_MES.Properties.Settings>
       <setting name="MES" serializeAs="String">
-        <value>Password=select!#%*(;User ID=MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=117.25.180.218)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));</value>
+        <value>Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=117.25.180.218)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));</value>
       </setting>
     </UAS_MES.Properties.Settings>
   </applicationSettings>

+ 289 - 0
UAS-MES/FunctionCode/Make/Make_LabelCheck.Designer.cs

@@ -0,0 +1,289 @@
+namespace UAS_MES.FunctionCode.Make
+{
+    partial class Make_LabelCheck
+    {
+        /// <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(Make_LabelCheck));
+            this.label1 = new System.Windows.Forms.Label();
+            this.label2 = new System.Windows.Forms.Label();
+            this.label3 = new System.Windows.Forms.Label();
+            this.label4 = new System.Windows.Forms.Label();
+            this.label5 = new System.Windows.Forms.Label();
+            this.ma_code = new System.Windows.Forms.Label();
+            this.ma_prodcode = new System.Windows.Forms.Label();
+            this.mcd_okqty = new System.Windows.Forms.Label();
+            this.remain_qty = new System.Windows.Forms.Label();
+            this.label10 = new System.Windows.Forms.Label();
+            this.sncode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.close = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
+            this.OperateResult = new UAS_MES.CustomControl.RichText.RichTextAutoBottom();
+            this.pr_detailspec = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
+            this.showResult = new System.Windows.Forms.ListView();
+            this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+            this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+            this.columnHeader3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+            this.columnHeader4 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+            this.SuspendLayout();
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.label1.Location = new System.Drawing.Point(39, 30);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(110, 31);
+            this.label1.TabIndex = 0;
+            this.label1.Text = "工单编号";
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.label2.Location = new System.Drawing.Point(429, 30);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(110, 31);
+            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(828, 30);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(158, 31);
+            this.label3.TabIndex = 2;
+            this.label3.Text = "产品名称规格";
+            // 
+            // label4
+            // 
+            this.label4.AutoSize = true;
+            this.label4.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.label4.Location = new System.Drawing.Point(42, 99);
+            this.label4.Name = "label4";
+            this.label4.Size = new System.Drawing.Size(86, 31);
+            this.label4.TabIndex = 3;
+            this.label4.Text = "剩余数";
+            // 
+            // label5
+            // 
+            this.label5.AutoSize = true;
+            this.label5.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.label5.Location = new System.Drawing.Point(432, 98);
+            this.label5.Name = "label5";
+            this.label5.Size = new System.Drawing.Size(62, 31);
+            this.label5.TabIndex = 4;
+            this.label5.Text = "计数";
+            // 
+            // ma_code
+            // 
+            this.ma_code.AutoSize = true;
+            this.ma_code.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ma_code.Location = new System.Drawing.Point(155, 30);
+            this.ma_code.Name = "ma_code";
+            this.ma_code.Size = new System.Drawing.Size(0, 31);
+            this.ma_code.TabIndex = 5;
+            // 
+            // ma_prodcode
+            // 
+            this.ma_prodcode.AutoSize = true;
+            this.ma_prodcode.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.ma_prodcode.Location = new System.Drawing.Point(545, 30);
+            this.ma_prodcode.Name = "ma_prodcode";
+            this.ma_prodcode.Size = new System.Drawing.Size(0, 31);
+            this.ma_prodcode.TabIndex = 6;
+            // 
+            // mcd_okqty
+            // 
+            this.mcd_okqty.AutoSize = true;
+            this.mcd_okqty.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.mcd_okqty.Location = new System.Drawing.Point(545, 98);
+            this.mcd_okqty.Name = "mcd_okqty";
+            this.mcd_okqty.Size = new System.Drawing.Size(0, 31);
+            this.mcd_okqty.TabIndex = 7;
+            // 
+            // remain_qty
+            // 
+            this.remain_qty.AutoSize = true;
+            this.remain_qty.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.remain_qty.Location = new System.Drawing.Point(155, 98);
+            this.remain_qty.Name = "remain_qty";
+            this.remain_qty.Size = new System.Drawing.Size(0, 31);
+            this.remain_qty.TabIndex = 8;
+            // 
+            // label10
+            // 
+            this.label10.AutoSize = true;
+            this.label10.Font = new System.Drawing.Font("微软雅黑", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label10.Location = new System.Drawing.Point(80, 582);
+            this.label10.Name = "label10";
+            this.label10.Size = new System.Drawing.Size(40, 27);
+            this.label10.TabIndex = 12;
+            this.label10.Text = "SN";
+            // 
+            // sncode
+            // 
+            this.sncode.AllPower = null;
+            this.sncode.BackColor = System.Drawing.Color.White;
+            this.sncode.ID = null;
+            this.sncode.Location = new System.Drawing.Point(175, 581);
+            this.sncode.Name = "sncode";
+            this.sncode.Power = null;
+            this.sncode.Size = new System.Drawing.Size(196, 28);
+            this.sncode.Str = null;
+            this.sncode.Str1 = null;
+            this.sncode.Str2 = null;
+            this.sncode.TabIndex = 14;
+            this.sncode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.sncode_KeyDown);
+            // 
+            // close
+            // 
+            this.close.AllPower = null;
+            this.close.BackColor = System.Drawing.Color.Transparent;
+            this.close.DownImage = ((System.Drawing.Image)(resources.GetObject("close.DownImage")));
+            this.close.Image = null;
+            this.close.IsShowBorder = true;
+            this.close.Location = new System.Drawing.Point(623, 579);
+            this.close.MoveImage = ((System.Drawing.Image)(resources.GetObject("close.MoveImage")));
+            this.close.Name = "close";
+            this.close.NormalImage = ((System.Drawing.Image)(resources.GetObject("close.NormalImage")));
+            this.close.Power = null;
+            this.close.Size = new System.Drawing.Size(75, 28);
+            this.close.TabIndex = 13;
+            this.close.Text = "关闭";
+            this.close.UseVisualStyleBackColor = false;
+            this.close.Click += new System.EventHandler(this.close_Click);
+            // 
+            // OperateResult
+            // 
+            this.OperateResult.Location = new System.Drawing.Point(45, 176);
+            this.OperateResult.Name = "OperateResult";
+            this.OperateResult.Size = new System.Drawing.Size(602, 383);
+            this.OperateResult.TabIndex = 10;
+            this.OperateResult.Text = "";
+            // 
+            // pr_detailspec
+            // 
+            this.pr_detailspec.AutoSize = true;
+            this.pr_detailspec.CutLength = null;
+            this.pr_detailspec.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.pr_detailspec.Location = new System.Drawing.Point(992, 30);
+            this.pr_detailspec.MaximumSize = new System.Drawing.Size(200, 0);
+            this.pr_detailspec.Name = "pr_detailspec";
+            this.pr_detailspec.Size = new System.Drawing.Size(0, 31);
+            this.pr_detailspec.TabIndex = 9;
+            // 
+            // showResult
+            // 
+            this.showResult.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
+            this.columnHeader1,
+            this.columnHeader2,
+            this.columnHeader3,
+            this.columnHeader4});
+            this.showResult.Location = new System.Drawing.Point(708, 176);
+            this.showResult.Name = "showResult";
+            this.showResult.Size = new System.Drawing.Size(585, 383);
+            this.showResult.TabIndex = 15;
+            this.showResult.UseCompatibleStateImageBehavior = false;
+            this.showResult.View = System.Windows.Forms.View.Details;
+            // 
+            // columnHeader1
+            // 
+            this.columnHeader1.Text = "";
+            this.columnHeader1.Width = 69;
+            // 
+            // columnHeader2
+            // 
+            this.columnHeader2.Text = "SN";
+            this.columnHeader2.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
+            this.columnHeader2.Width = 150;
+            // 
+            // columnHeader3
+            // 
+            this.columnHeader3.Text = "时间";
+            this.columnHeader3.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
+            this.columnHeader3.Width = 159;
+            // 
+            // columnHeader4
+            // 
+            this.columnHeader4.Text = "结果";
+            this.columnHeader4.Width = 96;
+            // 
+            // Make_LabelCheck
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(1329, 651);
+            this.Controls.Add(this.showResult);
+            this.Controls.Add(this.sncode);
+            this.Controls.Add(this.close);
+            this.Controls.Add(this.label10);
+            this.Controls.Add(this.OperateResult);
+            this.Controls.Add(this.pr_detailspec);
+            this.Controls.Add(this.remain_qty);
+            this.Controls.Add(this.mcd_okqty);
+            this.Controls.Add(this.ma_prodcode);
+            this.Controls.Add(this.ma_code);
+            this.Controls.Add(this.label5);
+            this.Controls.Add(this.label4);
+            this.Controls.Add(this.label3);
+            this.Controls.Add(this.label2);
+            this.Controls.Add(this.label1);
+            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
+            this.Name = "Make_LabelCheck";
+            this.Tag = "Make!LabelCheck";
+            this.Load += new System.EventHandler(this.Make_LabelCheck_Load);
+            this.SizeChanged += new System.EventHandler(this.Make_LabelCheck_SizeChanged);
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.Label label3;
+        private System.Windows.Forms.Label label4;
+        private System.Windows.Forms.Label label5;
+        private System.Windows.Forms.Label ma_code;
+        private System.Windows.Forms.Label ma_prodcode;
+        private System.Windows.Forms.Label mcd_okqty;
+        private System.Windows.Forms.Label remain_qty;
+        private CustomControl.ValueLabel.ValueLabel pr_detailspec;
+        private CustomControl.RichText.RichTextAutoBottom OperateResult;
+        private System.Windows.Forms.Label label10;
+        private CustomControl.ButtonUtil.NormalButton close;
+        private CustomControl.TextBoxWithIcon.EnterTextBox sncode;
+        private System.Windows.Forms.ListView showResult;
+        private System.Windows.Forms.ColumnHeader columnHeader1;
+        private System.Windows.Forms.ColumnHeader columnHeader2;
+        private System.Windows.Forms.ColumnHeader columnHeader3;
+        private System.Windows.Forms.ColumnHeader columnHeader4;
+    }
+}

+ 216 - 0
UAS-MES/FunctionCode/Make/Make_LabelCheck.cs

@@ -0,0 +1,216 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+using UAS_MES.DataOperate;
+using UAS_MES.Entity;
+using UAS_MES.PublicMethod;
+
+namespace UAS_MES.FunctionCode.Make
+{
+    public partial class Make_LabelCheck : Form
+    {
+        AutoSizeFormClass asc = new AutoSizeFormClass();
+
+        DataHelper dh;
+
+        LogStringBuilder sql;
+
+        DataTable dt;
+
+        DataTable info;
+
+        string imei1 = "";
+
+        bool isImei1 = false;
+
+        string oErrorMessage = "";
+
+        string SN = "";
+
+        string omakeCode = "";
+
+        string oMsid = "";
+        public Make_LabelCheck()
+        {
+            InitializeComponent();
+            dh = new DataHelper();
+        }
+
+        private void Make_LabelCheck_Load(object sender, EventArgs e)
+        {
+            asc.controllInitializeSize(this);
+            //聚焦SN号
+            sncode.Focus();
+            //打开界面提示用户:请输入SN 
+            OperateResult.AppendText(">>请输入SN\n", Color.Green);
+            sql = new LogStringBuilder();
+        }
+
+        private void Make_LabelCheck_SizeChanged(object sender, EventArgs e)
+        {
+            asc.controlAutoSize(this);
+        }
+
+        private void close_Click(object sender, EventArgs e)
+        {
+            //关闭当前页面
+        }
+
+        private void sncode_KeyDown(object sender, KeyEventArgs e)
+        {
+            //判断是enter事件
+            if (e.KeyCode == Keys.Enter)
+            {
+                if (sncode.Text == "") {
+                    OperateResult.AppendText("<<输入不能为空\n", Color.Red);
+                    return;
+                }
+                //输入的是SN
+                if (!isImei1)
+                {
+                    //查询是否存在该ms_id
+                    sql.Clear();
+                    sql.Append("select max(ms_id) ms_id from makeserial where ms_sncode =:sncode or exists (select 1 from  makesnrelation where beforesn=:beforesn  and ms_makecode=makecode)");
+                    dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select", sncode.Text, sncode.Text);
+                    if (dt.Rows.Count == 0 || dt.Rows[0]["ms_id"].ToString() == "0")
+                    {
+                        //SN错误,不存在
+                        //请输入SN
+                        OperateResult.AppendText("<<SN错误,序列号" + sncode.Text + "不存在\n", Color.Red);
+                        sncode.Text = "";
+                        OperateResult.AppendText(">>请输入SN\n", Color.Green);
+                    }
+                    //存在该SN号
+                    else
+                    {
+                        //根据该ms_id查询ms_imei1,ms_makecode信息
+                        sql.Clear();
+                        sql.Append("select ms_imei1 from  makeserial  where ms_id=:msid");
+                        info = (DataTable)dh.ExecuteSql(sql.GetString(), "select", dt.Rows[0]["ms_id"].ToString());
+                        //不为null 并且不为””才继续
+                        if (info.Rows[0]["ms_imei1"].ToString() == null || info.Rows[0]["ms_imei1"].ToString() == "")
+                        {
+                            // SN对应的IMEI不存在
+                            //>> 请输入SN
+                            OperateResult.AppendText("<<SN" + sncode.Text + "对应的IMEI不存在\n", Color.Red);
+                            sncode.Text = "";
+                            OperateResult.AppendText(">>请输入SN\n", Color.Green);
+                        }
+                        else
+                        //存在该imei信息
+                        {
+                            //用变量记录imei1和makecode
+                            imei1 = info.Rows[0]["ms_imei1"].ToString();
+                            SN = sncode.Text;
+                            //>>SN对应的IMEI号为:xxxxxxxxx
+                            //>> 请输入彩盒上的IMEI
+                            OperateResult.AppendText("<<SN对应的IMEI号为:" + imei1 + "\n", Color.Green);
+                            OperateResult.AppendText(">>请输入彩盒上的IMEI\n", Color.Green);
+                            sncode.Text = "";
+                            //设定要输入imei1
+                            isImei1 = true;
+                        }
+                    }
+                }
+                //输入的是imei1
+                else
+                {
+                    if (imei1 == sncode.Text)
+                    {
+                        //说明输入的imei1对比一致
+                        //判断工序属性attribute
+                        if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out oErrorMessage))
+                        {
+                            //判断序列号下一工序(CHECKSTEPSNANDMACODE)
+                            if (LogicHandler.CheckStepSNAndMacode("", User.UserSourceCode, SN, User.UserCode, out omakeCode, out oMsid, out oErrorMessage))
+                            {
+                                //调用  SETSTEPRESULT ,获取返回的工单号,
+                                if (LogicHandler.SetStepFinish(omakeCode, User.UserSourceCode, SN, "标签核对", "OK", User.UserCode, out oErrorMessage))
+                                {
+                                    //根据工单号查询makecraftdetail 表中的 mcd_okqty 计数,剩余数为ma_qty - nvl(mcd_inqty,0),刷新页面中工单信息的显示
+                                    sql.Clear();
+                                    sql.Append("select ma_code,nvl(mcd_okqty,0) mcd_okqty,ma_prodcode,pr_detail ||','|| pr_spec pr_detailspec,");
+                                    sql.Append("ma_qty - nvl(mcd_okqty, 0) remain_qty from make left join makecraftdetail on ");
+                                    sql.Append("mcd_maid=ma_id left join product on pr_code=ma_prodcode where ma_code=:omakeCode  and mcd_stepcode=:CurrentStepCode");
+                                    dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select",omakeCode,User.CurrentStepCode);
+                                    BaseUtil.SetFormValue(Controls, dt);
+                                    //将SN,时间,结果记录在页面
+                                    recordResult(SN, DateTime.Now.ToString(), "成功");
+                                    //IMEI核对成功
+                                    //>> 请输入SN
+                                    OperateResult.AppendText("<<IMEI核对成功\n", Color.Green);
+                                    sncode.Text = "";
+                                    OperateResult.AppendText(">>请输入SN\n", Color.Green);
+                                }
+                                else
+                                {
+                                    //setstepresult不通过
+                                    OperateResult.AppendText(">>" + oErrorMessage + "\n", Color.Red);
+                                    recordResult(SN, DateTime.Now.ToString(), "失败");
+                                    sncode.Text = "";
+                                }
+                            }
+                            else
+                            {
+                                //判定序列号下一工序不通过
+                                OperateResult.AppendText(">>" + oErrorMessage + "\n", Color.Red);
+                                recordResult(SN, DateTime.Now.ToString(), "失败");
+                                sncode.Text = "";
+                            }
+                        }
+                        else
+                        {
+                            //判定工序属性不通过
+                            OperateResult.AppendText(">>" + oErrorMessage + "\n", Color.Red);
+                            recordResult(SN, DateTime.Now.ToString(), "失败");
+                            sncode.Text = "";
+                        }
+                    }
+                    //说明比对不一致
+                    else
+                    {
+                        //清空imei1变量的值
+                        imei1 = "";
+                        //IMEI核对失败
+                        //>> 请输入SN
+                        OperateResult.AppendText(">>IMEI核对失败\n", Color.Red);
+                        sncode.Text = "";
+                        OperateResult.AppendText(">>请输入SN\n", Color.Green);
+                    }
+                    //imei1校对结束,下次输入的是SN
+                    isImei1 = false;
+                }
+            }
+        }
+        private void recordResult(string SN, string time, string result) {
+            if (showResult.Items.Count >= 10)
+            {
+                //如果有10行的话,则删除最前一行
+                showResult.Items.RemoveAt(0);
+            }
+            else
+            {
+                //创建一个item
+                ListViewItem lvi = new ListViewItem();
+                //分条赋值
+                lvi.SubItems[1].Text = SN;
+                lvi.SubItems[2].Text = time;
+                lvi.SubItems[3].Text = result;
+                //添加结果的信息进去
+                showResult.Items.Add(lvi);
+            }
+        }
+        private void clear() {
+            //清空变量的值
+            omakeCode = "";
+            oMsid = "";
+            SN = "";
+            imei1 = "";
+        }
+    }
+}

+ 159 - 0
UAS-MES/FunctionCode/Make/Make_LabelCheck.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="close.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="close.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="close.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>

+ 88 - 118
UAS-MES/FunctionCode/Make/Make_PackageCollection.Designer.cs

@@ -48,9 +48,9 @@
             this.label3 = new System.Windows.Forms.Label();
             this.pr_id = new System.Windows.Forms.Label();
             this.label2 = new System.Windows.Forms.Label();
+            this.PrintNum = new System.Windows.Forms.NumericUpDown();
             this.pa_code = new UAS_MES.CustomControl.TextBoxWithIcon.TextBoxGeneratePaCode();
             this.PrintList = new UAS_MES.CustomControl.ComBoxWithFocus.PrinterCombox();
-            this.PrintNum = new UAS_MES.CustomControl.TextBoxWithIcon.NumOnlyTextBox();
             this.OperateResult = new UAS_MES.CustomControl.RichText.RichTextAutoBottom();
             this.ma_code = new UAS_MES.CustomControl.TextBoxWithIcon.SearchTextBox();
             this.Printing = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
@@ -68,6 +68,7 @@
             this.pa_indate = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pd_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.panel2.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.PrintNum)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.PackageDetail)).BeginInit();
             this.SuspendLayout();
             // 
@@ -76,10 +77,9 @@
             this.pr_code_label.AutoSize = true;
             this.pr_code_label.Enabled = false;
             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(700, 66);
-            this.pr_code_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_code_label.Location = new System.Drawing.Point(525, 53);
             this.pr_code_label.Name = "pr_code_label";
-            this.pr_code_label.Size = new System.Drawing.Size(92, 27);
+            this.pr_code_label.Size = new System.Drawing.Size(74, 21);
             this.pr_code_label.TabIndex = 81;
             this.pr_code_label.Text = "产品编号";
             // 
@@ -87,10 +87,9 @@
             // 
             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(27, 128);
-            this.pr_detail_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_detail_label.Location = new System.Drawing.Point(20, 102);
             this.pr_detail_label.Name = "pr_detail_label";
-            this.pr_detail_label.Size = new System.Drawing.Size(92, 27);
+            this.pr_detail_label.Size = new System.Drawing.Size(74, 21);
             this.pr_detail_label.TabIndex = 80;
             this.pr_detail_label.Text = "产品名称";
             // 
@@ -98,10 +97,9 @@
             // 
             this.ma_code_label.AutoSize = true;
             this.ma_code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_code_label.Location = new System.Drawing.Point(377, 68);
-            this.ma_code_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ma_code_label.Location = new System.Drawing.Point(283, 54);
             this.ma_code_label.Name = "ma_code_label";
-            this.ma_code_label.Size = new System.Drawing.Size(72, 27);
+            this.ma_code_label.Size = new System.Drawing.Size(58, 21);
             this.ma_code_label.TabIndex = 76;
             this.ma_code_label.Text = "工单号";
             // 
@@ -111,9 +109,8 @@
             this.panel2.Controls.Add(this.label1);
             this.panel2.Dock = System.Windows.Forms.DockStyle.Top;
             this.panel2.Location = new System.Drawing.Point(0, 0);
-            this.panel2.Margin = new System.Windows.Forms.Padding(4);
             this.panel2.Name = "panel2";
-            this.panel2.Size = new System.Drawing.Size(1359, 36);
+            this.panel2.Size = new System.Drawing.Size(1019, 29);
             this.panel2.TabIndex = 88;
             this.panel2.Tag = "NoAuto";
             // 
@@ -122,10 +119,9 @@
             this.label1.AutoSize = true;
             this.label1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label1.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
-            this.label1.Location = new System.Drawing.Point(16, 5);
-            this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label1.Location = new System.Drawing.Point(12, 4);
             this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(92, 27);
+            this.label1.Size = new System.Drawing.Size(74, 21);
             this.label1.TabIndex = 0;
             this.label1.Text = "工单信息";
             // 
@@ -133,10 +129,9 @@
             // 
             this.pa_packageqty_label.AutoSize = true;
             this.pa_packageqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pa_packageqty_label.Location = new System.Drawing.Point(357, 128);
-            this.pa_packageqty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pa_packageqty_label.Location = new System.Drawing.Point(268, 102);
             this.pa_packageqty_label.Name = "pa_packageqty_label";
-            this.pa_packageqty_label.Size = new System.Drawing.Size(92, 27);
+            this.pa_packageqty_label.Size = new System.Drawing.Size(74, 21);
             this.pa_packageqty_label.TabIndex = 95;
             this.pa_packageqty_label.Text = "已装数量";
             // 
@@ -144,10 +139,9 @@
             // 
             this.pa_totalqty_label.AutoSize = true;
             this.pa_totalqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pa_totalqty_label.Location = new System.Drawing.Point(359, 186);
-            this.pa_totalqty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pa_totalqty_label.Location = new System.Drawing.Point(269, 149);
             this.pa_totalqty_label.Name = "pa_totalqty_label";
-            this.pa_totalqty_label.Size = new System.Drawing.Size(92, 27);
+            this.pa_totalqty_label.Size = new System.Drawing.Size(74, 21);
             this.pa_totalqty_label.TabIndex = 97;
             this.pa_totalqty_label.Text = "箱内容量";
             // 
@@ -156,10 +150,9 @@
             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(27, 715);
-            this.label13.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label13.Location = new System.Drawing.Point(20, 572);
             this.label13.Name = "label13";
-            this.label13.Size = new System.Drawing.Size(72, 27);
+            this.label13.Size = new System.Drawing.Size(58, 21);
             this.label13.TabIndex = 105;
             this.label13.Text = "序列号";
             // 
@@ -167,10 +160,9 @@
             // 
             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(69, 66);
-            this.pa_code_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pa_code_label.Location = new System.Drawing.Point(52, 53);
             this.pa_code_label.Name = "pa_code_label";
-            this.pa_code_label.Size = new System.Drawing.Size(52, 27);
+            this.pa_code_label.Size = new System.Drawing.Size(42, 21);
             this.pa_code_label.TabIndex = 113;
             this.pa_code_label.Text = "箱号";
             // 
@@ -178,10 +170,9 @@
             // 
             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(9, 186);
-            this.PrintList_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.PrintList_label.Location = new System.Drawing.Point(7, 149);
             this.PrintList_label.Name = "PrintList_label";
-            this.PrintList_label.Size = new System.Drawing.Size(112, 27);
+            this.PrintList_label.Size = new System.Drawing.Size(90, 21);
             this.PrintList_label.TabIndex = 116;
             this.PrintList_label.Text = "打印机列表";
             // 
@@ -189,10 +180,9 @@
             // 
             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(1043, 186);
-            this.PrintNum_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.PrintNum_label.Location = new System.Drawing.Point(782, 149);
             this.PrintNum_label.Name = "PrintNum_label";
-            this.PrintNum_label.Size = new System.Drawing.Size(52, 27);
+            this.PrintNum_label.Size = new System.Drawing.Size(42, 21);
             this.PrintNum_label.TabIndex = 124;
             this.PrintNum_label.Text = "份数";
             // 
@@ -200,10 +190,9 @@
             // 
             this.pa_restqty_label.AutoSize = true;
             this.pa_restqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pa_restqty_label.Location = new System.Drawing.Point(700, 128);
-            this.pa_restqty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pa_restqty_label.Location = new System.Drawing.Point(525, 102);
             this.pa_restqty_label.Name = "pa_restqty_label";
-            this.pa_restqty_label.Size = new System.Drawing.Size(92, 27);
+            this.pa_restqty_label.Size = new System.Drawing.Size(74, 21);
             this.pa_restqty_label.TabIndex = 126;
             this.pa_restqty_label.Text = "剩余容量";
             // 
@@ -211,10 +200,9 @@
             // 
             this.AutoPrint.AutoSize = true;
             this.AutoPrint.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.AutoPrint.Location = new System.Drawing.Point(1048, 128);
-            this.AutoPrint.Margin = new System.Windows.Forms.Padding(4);
+            this.AutoPrint.Location = new System.Drawing.Point(786, 102);
             this.AutoPrint.Name = "AutoPrint";
-            this.AutoPrint.Size = new System.Drawing.Size(154, 31);
+            this.AutoPrint.Size = new System.Drawing.Size(125, 25);
             this.AutoPrint.TabIndex = 128;
             this.AutoPrint.Text = "满箱自动打印";
             this.AutoPrint.UseVisualStyleBackColor = true;
@@ -223,10 +211,9 @@
             // 
             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(429, 715);
-            this.Cancel.Margin = new System.Windows.Forms.Padding(4);
+            this.Cancel.Location = new System.Drawing.Point(322, 572);
             this.Cancel.Name = "Cancel";
-            this.Cancel.Size = new System.Drawing.Size(114, 31);
+            this.Cancel.Size = new System.Drawing.Size(93, 25);
             this.Cancel.TabIndex = 129;
             this.Cancel.Text = "取消采集";
             this.Cancel.UseVisualStyleBackColor = true;
@@ -235,10 +222,9 @@
             // 
             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(1285, 58);
-            this.pa_id.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pa_id.Location = new System.Drawing.Point(964, 46);
             this.pa_id.Name = "pa_id";
-            this.pa_id.Size = new System.Drawing.Size(63, 27);
+            this.pa_id.Size = new System.Drawing.Size(50, 21);
             this.pa_id.TabIndex = 153;
             this.pa_id.Text = "pa_id";
             this.pa_id.Visible = false;
@@ -247,20 +233,19 @@
             // 
             this.PrintLabel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
             this.PrintLabel.FormattingEnabled = true;
-            this.PrintLabel.Location = new System.Drawing.Point(815, 186);
-            this.PrintLabel.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.PrintLabel.Location = new System.Drawing.Point(611, 149);
+            this.PrintLabel.Margin = new System.Windows.Forms.Padding(2);
             this.PrintLabel.Name = "PrintLabel";
-            this.PrintLabel.Size = new System.Drawing.Size(199, 23);
+            this.PrintLabel.Size = new System.Drawing.Size(150, 20);
             this.PrintLabel.TabIndex = 159;
             // 
             // 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(700, 186);
-            this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label3.Location = new System.Drawing.Point(525, 149);
             this.label3.Name = "label3";
-            this.label3.Size = new System.Drawing.Size(92, 27);
+            this.label3.Size = new System.Drawing.Size(74, 21);
             this.label3.TabIndex = 160;
             this.label3.Text = "打印标签";
             // 
@@ -268,10 +253,9 @@
             // 
             this.pr_id.AutoSize = true;
             this.pr_id.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_id.Location = new System.Drawing.Point(1285, 89);
-            this.pr_id.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_id.Location = new System.Drawing.Point(964, 71);
             this.pr_id.Name = "pr_id";
-            this.pr_id.Size = new System.Drawing.Size(60, 27);
+            this.pr_id.Size = new System.Drawing.Size(47, 21);
             this.pr_id.TabIndex = 161;
             this.pr_id.Tag = "pr_id";
             this.pr_id.Text = "pr_id";
@@ -283,54 +267,49 @@
             this.label2.AutoSize = true;
             this.label2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label2.ForeColor = System.Drawing.Color.Black;
-            this.label2.Location = new System.Drawing.Point(16, 237);
-            this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label2.Location = new System.Drawing.Point(12, 190);
             this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(92, 27);
+            this.label2.Size = new System.Drawing.Size(74, 22);
             this.label2.TabIndex = 162;
             this.label2.Text = "采集信息";
             // 
+            // PrintNum
+            // 
+            this.PrintNum.Location = new System.Drawing.Point(828, 151);
+            this.PrintNum.Name = "PrintNum";
+            this.PrintNum.Size = new System.Drawing.Size(50, 21);
+            this.PrintNum.TabIndex = 164;
+            this.PrintNum.Value = new decimal(new int[] {
+            1,
+            0,
+            0,
+            0});
+            // 
             // pa_code
             // 
             this.pa_code.ErrorMsg = null;
-            this.pa_code.Location = new System.Drawing.Point(144, 68);
-            this.pa_code.Margin = new System.Windows.Forms.Padding(5);
+            this.pa_code.Location = new System.Drawing.Point(108, 54);
+            this.pa_code.Margin = new System.Windows.Forms.Padding(4);
             this.pa_code.Name = "pa_code";
             this.pa_code.Pr_id = null;
-            this.pa_code.Size = new System.Drawing.Size(199, 26);
+            this.pa_code.Size = new System.Drawing.Size(149, 21);
             this.pa_code.TabIndex = 163;
+            this.pa_code.KeyDown += new System.Windows.Forms.KeyEventHandler(this.pa_code_KeyDown);
             // 
             // PrintList
             // 
-            this.PrintList.Location = new System.Drawing.Point(144, 186);
-            this.PrintList.Margin = new System.Windows.Forms.Padding(5);
+            this.PrintList.Location = new System.Drawing.Point(108, 149);
+            this.PrintList.Margin = new System.Windows.Forms.Padding(4);
             this.PrintList.Name = "PrintList";
-            this.PrintList.Size = new System.Drawing.Size(200, 31);
+            this.PrintList.Size = new System.Drawing.Size(150, 25);
             this.PrintList.TabIndex = 158;
             // 
-            // PrintNum
-            // 
-            this.PrintNum.AllPower = null;
-            this.PrintNum.BackColor = System.Drawing.Color.White;
-            this.PrintNum.ID = null;
-            this.PrintNum.Location = new System.Drawing.Point(1105, 186);
-            this.PrintNum.Margin = new System.Windows.Forms.Padding(4);
-            this.PrintNum.Name = "PrintNum";
-            this.PrintNum.Negative = false;
-            this.PrintNum.Power = null;
-            this.PrintNum.Size = new System.Drawing.Size(52, 25);
-            this.PrintNum.Str = null;
-            this.PrintNum.Str1 = null;
-            this.PrintNum.Str2 = null;
-            this.PrintNum.TabIndex = 156;
-            // 
             // 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(1036, 268);
-            this.OperateResult.Margin = new System.Windows.Forms.Padding(4);
+            this.OperateResult.Location = new System.Drawing.Point(777, 214);
             this.OperateResult.Name = "OperateResult";
-            this.OperateResult.Size = new System.Drawing.Size(291, 429);
+            this.OperateResult.Size = new System.Drawing.Size(219, 344);
             this.OperateResult.TabIndex = 155;
             this.OperateResult.Text = "";
             // 
@@ -342,18 +321,18 @@
             this.ma_code.Condition = null;
             this.ma_code.DBTitle = "工单查询";
             this.ma_code.FormName = null;
-            this.ma_code.Location = new System.Drawing.Point(468, 68);
-            this.ma_code.Margin = new System.Windows.Forms.Padding(4);
+            this.ma_code.Location = new System.Drawing.Point(352, 54);
             this.ma_code.Name = "ma_code";
             this.ma_code.Power = null;
+            this.ma_code.ReturnData = null;
             this.ma_code.SelectField = null;
             this.ma_code.SetValueField = null;
-            this.ma_code.Size = new System.Drawing.Size(200, 26);
+            this.ma_code.Size = new System.Drawing.Size(149, 21);
             this.ma_code.TabIndex = 152;
             this.ma_code.TableName = null;
             this.ma_code.Tag = "ma_code";
             this.ma_code.TextBoxEnable = true;
-            this.ma_code.TextKeyDown += new UAS_MES.CustomControl.TextBoxWithIcon.SearchTextBox.OnTextKeyDown(this.ma_code_TextKeyDown);
+            this.ma_code.UserControlTextChanged += new UAS_MES.CustomControl.TextBoxWithIcon.SearchTextBox.OnTextChange(this.ma_code_UserControlTextChanged);
             // 
             // Printing
             // 
@@ -362,13 +341,12 @@
             this.Printing.DownImage = ((System.Drawing.Image)(resources.GetObject("Printing.DownImage")));
             this.Printing.Image = ((System.Drawing.Image)(resources.GetObject("Printing.Image")));
             this.Printing.IsShowBorder = true;
-            this.Printing.Location = new System.Drawing.Point(1183, 186);
-            this.Printing.Margin = new System.Windows.Forms.Padding(4);
+            this.Printing.Location = new System.Drawing.Point(887, 149);
             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(80, 30);
+            this.Printing.Size = new System.Drawing.Size(60, 24);
             this.Printing.TabIndex = 150;
             this.Printing.Tag = "ifread";
             this.Printing.Text = "打印";
@@ -382,13 +360,12 @@
             this.Clean.DownImage = ((System.Drawing.Image)(resources.GetObject("Clean.DownImage")));
             this.Clean.Image = ((System.Drawing.Image)(resources.GetObject("Clean.Image")));
             this.Clean.IsShowBorder = true;
-            this.Clean.Location = new System.Drawing.Point(1141, 714);
-            this.Clean.Margin = new System.Windows.Forms.Padding(4);
+            this.Clean.Location = new System.Drawing.Point(856, 571);
             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(80, 30);
+            this.Clean.Size = new System.Drawing.Size(60, 24);
             this.Clean.TabIndex = 148;
             this.Clean.Text = "清除";
             this.Clean.UseVisualStyleBackColor = true;
@@ -400,11 +377,10 @@
             this.pa_packageqty.BackColor = System.Drawing.Color.White;
             this.pa_packageqty.Enabled = false;
             this.pa_packageqty.ID = null;
-            this.pa_packageqty.Location = new System.Drawing.Point(468, 128);
-            this.pa_packageqty.Margin = new System.Windows.Forms.Padding(4);
+            this.pa_packageqty.Location = new System.Drawing.Point(351, 102);
             this.pa_packageqty.Name = "pa_packageqty";
             this.pa_packageqty.Power = null;
-            this.pa_packageqty.Size = new System.Drawing.Size(199, 25);
+            this.pa_packageqty.Size = new System.Drawing.Size(150, 21);
             this.pa_packageqty.Str = null;
             this.pa_packageqty.Str1 = null;
             this.pa_packageqty.Str2 = null;
@@ -418,11 +394,10 @@
             this.ma_prodcode.BackColor = System.Drawing.Color.White;
             this.ma_prodcode.Enabled = false;
             this.ma_prodcode.ID = null;
-            this.ma_prodcode.Location = new System.Drawing.Point(817, 69);
-            this.ma_prodcode.Margin = new System.Windows.Forms.Padding(4);
+            this.ma_prodcode.Location = new System.Drawing.Point(611, 55);
             this.ma_prodcode.Name = "ma_prodcode";
             this.ma_prodcode.Power = null;
-            this.ma_prodcode.Size = new System.Drawing.Size(199, 25);
+            this.ma_prodcode.Size = new System.Drawing.Size(150, 21);
             this.ma_prodcode.Str = null;
             this.ma_prodcode.Str1 = null;
             this.ma_prodcode.Str2 = null;
@@ -435,11 +410,10 @@
             this.pa_totalqty.AllPower = null;
             this.pa_totalqty.BackColor = System.Drawing.Color.White;
             this.pa_totalqty.ID = null;
-            this.pa_totalqty.Location = new System.Drawing.Point(469, 186);
-            this.pa_totalqty.Margin = new System.Windows.Forms.Padding(4);
+            this.pa_totalqty.Location = new System.Drawing.Point(352, 149);
             this.pa_totalqty.Name = "pa_totalqty";
             this.pa_totalqty.Power = null;
-            this.pa_totalqty.Size = new System.Drawing.Size(199, 25);
+            this.pa_totalqty.Size = new System.Drawing.Size(150, 21);
             this.pa_totalqty.Str = null;
             this.pa_totalqty.Str1 = null;
             this.pa_totalqty.Str2 = null;
@@ -452,11 +426,10 @@
             this.ma_prodname.BackColor = System.Drawing.Color.White;
             this.ma_prodname.Enabled = false;
             this.ma_prodname.ID = null;
-            this.ma_prodname.Location = new System.Drawing.Point(144, 128);
-            this.ma_prodname.Margin = new System.Windows.Forms.Padding(4);
+            this.ma_prodname.Location = new System.Drawing.Point(108, 102);
             this.ma_prodname.Name = "ma_prodname";
             this.ma_prodname.Power = null;
-            this.ma_prodname.Size = new System.Drawing.Size(199, 25);
+            this.ma_prodname.Size = new System.Drawing.Size(150, 21);
             this.ma_prodname.Str = null;
             this.ma_prodname.Str1 = null;
             this.ma_prodname.Str2 = null;
@@ -469,11 +442,10 @@
             this.pa_restqty.BackColor = System.Drawing.Color.White;
             this.pa_restqty.Enabled = false;
             this.pa_restqty.ID = null;
-            this.pa_restqty.Location = new System.Drawing.Point(815, 128);
-            this.pa_restqty.Margin = new System.Windows.Forms.Padding(4);
+            this.pa_restqty.Location = new System.Drawing.Point(611, 102);
             this.pa_restqty.Name = "pa_restqty";
             this.pa_restqty.Power = null;
-            this.pa_restqty.Size = new System.Drawing.Size(199, 25);
+            this.pa_restqty.Size = new System.Drawing.Size(150, 21);
             this.pa_restqty.Str = null;
             this.pa_restqty.Str1 = null;
             this.pa_restqty.Str2 = null;
@@ -485,11 +457,10 @@
             this.barcode.AllPower = "ifall";
             this.barcode.BackColor = System.Drawing.Color.White;
             this.barcode.ID = null;
-            this.barcode.Location = new System.Drawing.Point(117, 715);
-            this.barcode.Margin = new System.Windows.Forms.Padding(4);
+            this.barcode.Location = new System.Drawing.Point(88, 572);
             this.barcode.Name = "barcode";
             this.barcode.Power = "ifwrite";
-            this.barcode.Size = new System.Drawing.Size(260, 25);
+            this.barcode.Size = new System.Drawing.Size(196, 21);
             this.barcode.Str = null;
             this.barcode.Str1 = null;
             this.barcode.Str2 = null;
@@ -509,12 +480,11 @@
             this.pd_innerqty,
             this.pa_indate,
             this.pd_id});
-            this.PackageDetail.Location = new System.Drawing.Point(21, 268);
-            this.PackageDetail.Margin = new System.Windows.Forms.Padding(4);
+            this.PackageDetail.Location = new System.Drawing.Point(16, 214);
             this.PackageDetail.Name = "PackageDetail";
             this.PackageDetail.ReadOnly = true;
             this.PackageDetail.RowTemplate.Height = 23;
-            this.PackageDetail.Size = new System.Drawing.Size(995, 430);
+            this.PackageDetail.Size = new System.Drawing.Size(746, 344);
             this.PackageDetail.TabIndex = 134;
             // 
             // pd_barcode
@@ -561,16 +531,16 @@
             // 
             // Make_PackageCollection
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(1359, 760);
+            this.ClientSize = new System.Drawing.Size(1019, 608);
+            this.Controls.Add(this.PrintNum);
             this.Controls.Add(this.pa_code);
             this.Controls.Add(this.label2);
             this.Controls.Add(this.pr_id);
             this.Controls.Add(this.label3);
             this.Controls.Add(this.PrintLabel);
             this.Controls.Add(this.PrintList);
-            this.Controls.Add(this.PrintNum);
             this.Controls.Add(this.OperateResult);
             this.Controls.Add(this.pa_id);
             this.Controls.Add(this.ma_code);
@@ -597,7 +567,6 @@
             this.Controls.Add(this.pr_detail_label);
             this.Controls.Add(this.ma_code_label);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
-            this.Margin = new System.Windows.Forms.Padding(4);
             this.Name = "Make_PackageCollection";
             this.Tag = "Make!PackageCollection";
             this.Text = "包装采集";
@@ -607,6 +576,7 @@
             this.SizeChanged += new System.EventHandler(this.包装采集_SizeChanged);
             this.panel2.ResumeLayout(false);
             this.panel2.PerformLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.PrintNum)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.PackageDetail)).EndInit();
             this.ResumeLayout(false);
             this.PerformLayout();
@@ -646,12 +616,12 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn pa_indate;
         private System.Windows.Forms.DataGridViewTextBoxColumn pd_id;
         private CustomControl.RichText.RichTextAutoBottom OperateResult;
-        private CustomControl.TextBoxWithIcon.NumOnlyTextBox PrintNum;
         private CustomControl.ComBoxWithFocus.PrinterCombox PrintList;
         private System.Windows.Forms.ComboBox PrintLabel;
         private System.Windows.Forms.Label label3;
         private System.Windows.Forms.Label pr_id;
         private System.Windows.Forms.Label label2;
         private CustomControl.TextBoxWithIcon.TextBoxGeneratePaCode pa_code;
+        private System.Windows.Forms.NumericUpDown PrintNum;
     }
 }

+ 7 - 3
UAS-MES/FunctionCode/Make/Make_PackageCollection.cs

@@ -43,8 +43,9 @@ namespace UAS_MES.Make
             ma_code.SetValueField = new string[] { "ma_code", "ma_prodcode", "ma_prodname", "pr_id" };
             ma_code.TableName = "Make left join product on  ma_prodcode=pr_code";
             ma_code.SelectField = "pr_id # 物料ID,ma_code # 工单号,ma_prodcode # 物料编号,ma_qty # 数量,ma_prodname # 物料名册,ma_wccode # 工作中心编号";
+            ma_code.Condition = "ma_statuscode='STARTED'";
             ma_code.DbChange += Ma_code_DbChange;
-            PrintNum.Text = "1";
+            PrintNum.Value = 1;
             asc.controllInitializeSize(this);
         }
 
@@ -168,7 +169,7 @@ namespace UAS_MES.Make
                                 sql.Append("select package_seq.nextval,'" + pa_code.Text + "',0," + pa_totalqty.Text + ",0,");
                                 sql.Append("sysdate,'" + ma_code.Text + "', ma_prodcode,ma_salecode,ma_custcode from make where ma_code = '" + ma_code.Text + "'");
                                 dh.ExecuteSql(sql.GetString(), "insert");
-                                OperateResult.AppendText("箱号" + pa_code.Text + "采集成功!\n", Color.Red);
+                                OperateResult.AppendText("箱号" + pa_code.Text + "采集成功!\n", Color.Green);
                                 //验证序列号插入明细表的数据
                                 InsertDetail();
                             }
@@ -285,9 +286,12 @@ namespace UAS_MES.Make
             //lbl.Quit();
         }
 
-        private void ma_code_TextKeyDown(object sender, KeyEventArgs e)
+        private void ma_code_UserControlTextChanged(object sender, EventArgs e)
         {
+            if (ma_code.Text.Length > 5)
+            {
 
+            }
         }
     }
 }

+ 15 - 0
UAS-MES/FunctionCode/Make/Make_PackageCollection.resx

@@ -395,4 +395,19 @@
   <metadata name="pd_id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
+  <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_outboxcode.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>
 </root>

+ 4 - 4
UAS-MES/Properties/Settings.Designer.cs

@@ -109,7 +109,7 @@ namespace UAS_MES.Properties {
         
         [global::System.Configuration.UserScopedSettingAttribute()]
         [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-        [global::System.Configuration.DefaultSettingValueAttribute("ftp://172.16.11.99/print/|uasmes|Administrator1@#")]
+        [global::System.Configuration.DefaultSettingValueAttribute("ftp://192.168.253.9/MESSetting/print/|mesconfig|Administrator1@#")]
         public string FTPAddress {
             get {
                 return ((string)(this["FTPAddress"]));
@@ -121,9 +121,9 @@ namespace UAS_MES.Properties {
         
         [global::System.Configuration.ApplicationScopedSettingAttribute()]
         [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-        [global::System.Configuration.DefaultSettingValueAttribute("Password=select!#%*(;User ID=MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_" +
-            "LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=117.25.180.218)(PORT=1521)))(CONNECT_DATA=(SER" +
-            "VER=DEDICATED)(SERVICE_NAME=orcl)));")]
+        [global::System.Configuration.DefaultSettingValueAttribute("Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=MES;Pooling=false" +
+            ";Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=117.25.180." +
+            "218)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));")]
         public string MES {
             get {
                 return ((string)(this["MES"]));

+ 2 - 2
UAS-MES/Properties/Settings.settings

@@ -24,10 +24,10 @@
       <Value Profile="(Default)" />
     </Setting>
     <Setting Name="FTPAddress" Type="System.String" Scope="User">
-      <Value Profile="(Default)">ftp://172.16.11.99/print/|uasmes|Administrator1@#</Value>
+      <Value Profile="(Default)">ftp://192.168.253.9/MESSetting/print/|mesconfig|Administrator1@#</Value>
     </Setting>
     <Setting Name="MES" Type="System.String" Scope="Application">
-      <Value Profile="(Default)">Password=select!#%*(;User ID=MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=117.25.180.218)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));</Value>
+      <Value Profile="(Default)">Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=117.25.180.218)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));</Value>
     </Setting>
   </Settings>
 </SettingsFile>

+ 92 - 0
UAS-MES/PublicMethod/AutoSizeControl.cs

@@ -0,0 +1,92 @@
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Windows.Forms;
+
+namespace UAS_MES.PublicMethod
+{
+    class AutoSizeControl
+    {
+        /// <summary>
+        /// 记录所有控件
+        /// </summary>
+        List<Control> ctl = new List<Control>();
+        /// <summary>
+        /// 记录控件的初始化位置
+        /// </summary>
+        Dictionary<string, Point> CtlPoint = new Dictionary<string, Point>();
+        /// <summary>
+        /// 记录控件的初始化大小
+        /// </summary>
+        Dictionary<string, Size> CtlSize = new Dictionary<string, Size>();
+        /// <summary>
+        /// 初始化的窗体宽度
+        /// </summary>
+        int InitFormWidth = 0;
+        /// <summary>
+        /// 初始化的窗体高度
+        /// </summary>
+        int InitFormHeight = 0;
+        /// <summary>
+        /// 窗体调整时的宽度
+        /// </summary>
+        int AutoSizeFormWidth = 0;
+        /// <summary>
+        /// 窗体调整时的高度
+        /// </summary>
+        int AutoSizeFormHeight = 0;
+        /// <summary>
+        /// 自适应宽度比例
+        /// </summary>
+        float AutoSizeWidthRate;
+        /// <summary>
+        /// 
+        /// </summary>
+        float AutoSizeHeigthRate;
+
+        public void InitControl(Control control)
+        {
+            InitFormWidth = control.Width;
+            InitFormHeight = control.Height;
+            foreach (Control item in control.Controls)
+            {
+                ctl.Add(item);
+                CtlPoint.Add(item.Name, item.Location);
+                CtlSize.Add(item.Name, item.Size);
+                if (item.Controls.Count > 0)
+                {
+                    AddControl(item);
+                }
+            }
+        }
+
+        public void AddControl(Control control)
+        {
+            foreach (Control item in control.Controls)
+            {
+                ctl.Add(item);
+                if (!CtlPoint.ContainsKey(item.Name))
+                    CtlPoint.Add(item.Name, item.Location);
+                if (!CtlSize.ContainsKey(item.Name))
+                    CtlSize.Add(item.Name, item.Size);
+                if (item.Controls.Count > 0)
+                {
+                    AddControl(item);
+                }
+            }
+        }
+
+        public void AutoSize(Control control)
+        {
+            AutoSizeFormHeight = control.Height;
+            AutoSizeFormWidth = control.Width;
+            AutoSizeWidthRate = (float)(AutoSizeFormWidth * 1.0 / InitFormWidth);
+            AutoSizeHeigthRate = (float)(AutoSizeFormHeight * 1.0 / InitFormHeight);
+            for (int i = 0; i < ctl.Count; i++)
+            {
+                ctl[i].Location = new Point((int)(CtlPoint[ctl[i].Name].X * AutoSizeWidthRate), (int)(CtlPoint[ctl[i].Name].Y * AutoSizeHeigthRate));
+                ctl[i].Size = new Size((int)(CtlSize[ctl[i].Name].Width * AutoSizeWidthRate), (int)(CtlSize[ctl[i].Name].Height * AutoSizeHeigthRate));
+            }
+        }
+    }
+}

+ 28 - 4
UAS-MES/PublicMethod/LogicHandler.cs

@@ -914,7 +914,33 @@ namespace UAS_MES.PublicMethod
                 return CS_SetFinish(iMakeCode, iSourceCode, iSN, iUserCode, out oErrorMessage);
             }
         }
+        public static bool SetStepResult(string iMakeCode, string iSourceCode, string iSN, string iMPKind, string iResult, string iUserCode, out string oErrorMessage)
+        {
+            oErrorMessage = "";
+            string StepCode = dh.getFieldDataByCondition("Makeserial", "ms_stepcode", "ms_sncode='" + iSN + "'").ToString();
+            string CurrentStep = GetStepCodeBySource(iSourceCode);
+            if (StepCode == CurrentStep)
+            {
+                InsertMakeProcess(iSN, iMakeCode, iSourceCode, iMPKind, iResult, iUserCode);
+                return true;
+            }
+            else
+            {
+                return CS_SetResult(iMakeCode, iSourceCode, iSN, iUserCode,iResult, out oErrorMessage);
+            }
+        }
 
+        public static bool CS_SetResult(string iMakeCode, string iSourceCode, string iSN, string iUserCode,string iResult, out string oErrorMessage)
+        {
+            oErrorMessage = "";
+            string[] param = new string[] { iMakeCode, iSourceCode, iSN, iUserCode,iResult, oErrorMessage };
+            dh.CallProcedure("CS_SETSTEPRESULT", ref param);
+            oErrorMessage = param[5];
+            if (oErrorMessage == "" || oErrorMessage == null || oErrorMessage == "null")
+                return true;
+            else
+                return false;
+        }
         /// <summary>
         /// 设置测试结果
         /// </summary>
@@ -1388,11 +1414,9 @@ namespace UAS_MES.PublicMethod
                         code.Append(lpad(int.Parse(dt.Rows[0]["bs_lennum"].ToString()), dt.Rows[0]["bs_maxnum"].ToString()));// 当前流水号
                         dh.UpdateByCondition("barcodeSet", "bs_maxnum=bs_maxnum+1", "bs_type='PACK' and  bs_id=" + dt.Rows[0]["bs_id"]);// 流水号增加1
                     }
-                    else
-                        BaseUtil.ShowError("未定义包装箱号产生规则或规则未审核");
+                    else BaseUtil.ShowError("未定义包装箱号产生规则或规则未审核");
                 }
-                else
-                    BaseUtil.ShowError("物料管控类型错误!该物料管控类型为不管控");
+                else BaseUtil.ShowError("物料管控类型错误!该物料管控类型为不管控");
             }
             return code.ToString();
         }

+ 5 - 3
UAS-MES/UAS-MES.csproj

@@ -22,7 +22,7 @@
     </SccAuxPath>
     <SccProvider>
     </SccProvider>
-    <PublishUrl>E:\s_user_site\</PublishUrl>
+    <PublishUrl>ftp://192.168.253.9/MESSetting/</PublishUrl>
     <Install>true</Install>
     <InstallFrom>Web</InstallFrom>
     <UpdateEnabled>true</UpdateEnabled>
@@ -32,7 +32,7 @@
     <UpdatePeriodically>false</UpdatePeriodically>
     <UpdateRequired>true</UpdateRequired>
     <MapFileExtensions>true</MapFileExtensions>
-    <InstallUrl>http://172.16.11.99/</InstallUrl>
+    <InstallUrl>http://218.17.158.219:8888/</InstallUrl>
     <UpdateUrl>http://172.16.11.99/</UpdateUrl>
     <TargetCulture>zh</TargetCulture>
     <ProductName>优软MES系统</ProductName>
@@ -42,7 +42,7 @@
     <CreateWebPageOnPublish>true</CreateWebPageOnPublish>
     <WebPage>publish.htm</WebPage>
     <OpenBrowserOnPublish>false</OpenBrowserOnPublish>
-    <ApplicationRevision>399</ApplicationRevision>
+    <ApplicationRevision>422</ApplicationRevision>
     <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
     <UseApplicationTrust>true</UseApplicationTrust>
     <CreateDesktopShortcut>true</CreateDesktopShortcut>
@@ -526,6 +526,7 @@
       <DependentUpon>SetLoadingWindow.cs</DependentUpon>
     </Compile>
     <Compile Include="PublicMethod\AssemblyHelper.cs" />
+    <Compile Include="PublicMethod\AutoSizeControl.cs" />
     <Compile Include="PublicMethod\AutoSizeFormClass.cs" />
     <Compile Include="PublicMethod\BaseUtil.cs" />
     <Compile Include="PublicMethod\DrawHelper.cs" />
@@ -1121,6 +1122,7 @@
     <None Include="Resources\0802192135.png" />
     <Content Include="Resources\Sound\3291.wav" />
     <Content Include="Resources\Sound\5185.wav" />
+    <Content Include="Resources\Sound\8378.wav" />
     <Content Include="U_Icon.ico" />
     <None Include="Resources\timg.jpg" />
     <None Include="Resources\matte_white_square_icon_business_tool_hammer_128px_571061_easyicon.net.ico" />

+ 3 - 3
UAS_KanBan/UAS_KanBan.csproj

@@ -14,7 +14,7 @@
     <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
     <TargetFrameworkProfile />
     <IsWebBootstrapper>true</IsWebBootstrapper>
-    <PublishUrl>E:\s_user_site\KanBan\</PublishUrl>
+    <PublishUrl>ftp://192.168.253.9/MESSetting/KanBan/</PublishUrl>
     <Install>true</Install>
     <InstallFrom>Web</InstallFrom>
     <UpdateEnabled>true</UpdateEnabled>
@@ -24,14 +24,14 @@
     <UpdatePeriodically>false</UpdatePeriodically>
     <UpdateRequired>true</UpdateRequired>
     <MapFileExtensions>true</MapFileExtensions>
-    <InstallUrl>http://172.16.11.99/KanBan/</InstallUrl>
+    <InstallUrl>http://218.17.158.219:8888/KanBan/</InstallUrl>
     <ProductName>UAS看板</ProductName>
     <PublisherName>深圳市优软科技有限公司</PublisherName>
     <SuiteName>UAS看板</SuiteName>
     <MinimumRequiredVersion>1.0.0.16</MinimumRequiredVersion>
     <CreateWebPageOnPublish>true</CreateWebPageOnPublish>
     <WebPage>publish.htm</WebPage>
-    <ApplicationRevision>17</ApplicationRevision>
+    <ApplicationRevision>19</ApplicationRevision>
     <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
     <UseApplicationTrust>false</UseApplicationTrust>
     <CreateDesktopShortcut>true</CreateDesktopShortcut>

+ 330 - 370
UAS_MesInterface/DataHelper.cs

@@ -16,7 +16,7 @@ namespace UAS_MesInterface
         //用户选择的数据库的连接字符串
         public static OracleConnection connection = null;
         //用户选择的数据库的连接字符串
-        OracleCommand command = null;
+        OracleCommand command = new OracleCommand();
         /// <summary>
         /// 执行构造函数的时候打开数据库的链接
         /// </summary>
@@ -24,21 +24,55 @@ namespace UAS_MesInterface
         {
             try
             {
-                if (Environment.ToUpper() == "FORMAl")
+                //如果选择的是默认数据则直接用配置文件的信息连接,否则选择数据库的账套信息
+                if (Environment.ToUpper() == "MES")
                 {
-                    ConnectionStrings = "Password=select!#%*(;User ID=MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=117.25.180.218)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+                    ConnectionStrings = "Password=select!#%*(;User ID=MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.230.200)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
                 }
-                else if (Environment.ToUpper() == "TEST")
+                else if (Environment.ToUpper() == "MES_TEST")
                 {
-                    ConnectionStrings = "Password=select!#%*(;User ID=MES_TEST;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=117.25.180.218)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+                    ConnectionStrings = "Password=select!#%*(;User ID=MES_TEST;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.230.200)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
                 }
-                connection = new OracleConnection(ConnectionStrings);
-                connection.Open();
+                command.Connection = connection;
+                command.Connection.Open();
+                command.CommandTimeout = 0;
             }
             catch (Exception)
             {
+                if (Environment.ToUpper() == "MES")
+                {
+                    ConnectionStrings = "Password=select!#%*(;User ID=MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.230.200)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+                }
+                else if (Environment.ToUpper() == "MES_TEST")
+                {
+                    ConnectionStrings = "Password=select!#%*(;User ID=MES_TEST;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.230.200)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+                }
+                try
+                {
+                    command.Connection = connection;
+                    command.Connection.Open();
+                }
+                catch (Exception)
+                {
+                    return;
+                }
+                command.CommandTimeout = 0;
             }
         }
+        /// <summary>
+        /// 根据表名获取该表字段数据类型
+        /// </summary>
+        public DataTable GetColumnDataType(string TableName)
+        {
+            DataTable dt = new DataTable();
+            command.CommandText = "select Column_Name,Data_Type from cols where TABLE_name=upper('" + TableName + "')";
+            command.CommandType = CommandType.Text;
+            Reconnect(command);
+            OracleDataAdapter ad = new OracleDataAdapter(command);
+            ad.Fill(dt);
+            ad.Dispose();
+            return dt;
+        }
 
         /// <summary>
         /// 获取第一行第一列的信息
@@ -47,13 +81,26 @@ namespace UAS_MesInterface
         {
             DataTable dt = new DataTable();
             string sql = "select " + Field + " from " + TableName + " where " + Condition;
-            command = new OracleCommand(sql, connection);
+            command.CommandText = sql;
+            command.CommandType = CommandType.Text;
             Reconnect(command);
             OracleDataAdapter ad = new OracleDataAdapter();
             ad.SelectCommand = command;
-            ad.Fill(dt);
+            try
+            {
+                ad.Fill(dt);
+            }
+            catch (Exception)
+            {
+                connection = new OracleConnection(ConnectionStrings);
+                connection.Open();
+                command.Connection = connection;
+                ad = new OracleDataAdapter();
+                ad.SelectCommand = command;
+                ad.Fill(dt);
+            }
             ad.Dispose();
-            command.Dispose();
+
             if (dt.Rows.Count > 0)
             {
                 return dt.Rows[0][0];
@@ -64,6 +111,41 @@ namespace UAS_MesInterface
             }
         }
 
+        /// <summary>
+        /// 执行打印的SQL
+        /// </summary>
+        /// <param name="SQL">SQL语句</param>
+        /// <param name="Parameters">动态添加的参数,主要根据条码枪扫描获取</param>
+        /// <returns></returns>
+        public object ExecutePrintSQL(string SQL, params string[] Parameters)
+        {
+            command.Parameters.Clear();
+            //按照?拆分数据,然后以:Param替换问号,同时添加参数
+            string[] Param = SQL.Split('?');
+            int ParamNum = Param.Length - 1;
+            //条码打印必然存在需要维护的参数
+            if (ParamNum > 0)
+            {
+                StringBuilder sb = new StringBuilder();
+                for (int i = 0; i < ParamNum; i++)
+                {
+                    sb.Append(Param[i] + ":Param" + i);
+                }
+                command.CommandText = sb.ToString();
+                command.CommandType = CommandType.Text;
+                for (int i = 0; i < ParamNum; i++)
+                {
+                    command.Parameters.Add("Param" + i, OracleDbType.Varchar2, Parameters[i], ParameterDirection.Input);
+                }
+                OracleDataAdapter ad = new OracleDataAdapter(command);
+                DataTable dt = new DataTable();
+                ad.Fill(dt);
+                ad.Dispose();
+                return dt;
+            }
+            return "参数错误,请检查SQL语句";
+        }
+
         /// <summary>
         /// 获取指定表的记录的条数 ,带条件
         /// </summary>
@@ -72,12 +154,12 @@ namespace UAS_MesInterface
         {
             DataTable dt = new DataTable();
             string sql = "select count(1) from " + TableName + " where " + Condition;
-            command = new OracleCommand(sql, connection);
+            command.CommandText = sql;
+            command.CommandType = CommandType.Text;
             Reconnect(command);
             OracleDataAdapter ad = new OracleDataAdapter(command);
             ad.Fill(dt);
             ad.Dispose();
-            command.Dispose();
             return int.Parse(dt.Rows[0][0].ToString());
         }
 
@@ -90,12 +172,12 @@ namespace UAS_MesInterface
         {
             DataTable dt = new DataTable();
             string sql = "select count(1) from " + TableName;
-            command = new OracleCommand(sql, connection);
+            command.CommandText = sql;
+            command.CommandType = CommandType.Text;
             Reconnect(command);
             OracleDataAdapter ad = new OracleDataAdapter(command);
             ad.Fill(dt);
             ad.Dispose();
-            command.Dispose();
             return int.Parse(dt.Rows[0][0].ToString());
         }
 
@@ -108,12 +190,25 @@ namespace UAS_MesInterface
             string sql = "select ";
             sql += AddField(Fields);
             sql += " from " + TableName + " where " + Condition + " and rownum=1";
-            command = new OracleCommand(sql, connection);
+            command.CommandText = sql;
+            command.CommandType = CommandType.Text;
             Reconnect(command);
             OracleDataAdapter ad = new OracleDataAdapter(command);
-            ad.Fill(dt);
+            try
+            {
+                ad.Fill(dt);
+            }
+            catch (Exception)
+            {
+                connection = new OracleConnection(ConnectionStrings);
+                connection.Open();
+                command.Connection = connection;
+                ad = new OracleDataAdapter();
+                ad.SelectCommand = command;
+                ad.Fill(dt);
+            }
             ad.Dispose();
-            command.Dispose();
+
             return dt;
         }
 
@@ -145,12 +240,13 @@ namespace UAS_MesInterface
                 else
                     sql.Append(" from " + TableName + ") A where ROWNUM <= " + CurrentPage * PageSize + ") where RN> " + (CurrentPage - 1) * PageSize);
             }
-            command = new OracleCommand(sql.ToString(), connection);
+            command.CommandText = sql.ToString();
+            command.CommandType = CommandType.Text;
             Reconnect(command);
             OracleDataAdapter ad = new OracleDataAdapter(command);
             ad.Fill(dt);
             ad.Dispose();
-            command.Dispose();
+
             dt.Columns.RemoveAt(0);
             foreach (DataColumn dc in dt.Columns)
             {
@@ -169,12 +265,25 @@ namespace UAS_MesInterface
             string sql = "select ";
             sql += AddField(Fields);
             sql += " from " + TableName + " where " + Condition;
-            command = new OracleCommand(sql, connection);
+            command.CommandText = sql;
+            command.CommandType = CommandType.Text;
             Reconnect(command);
             OracleDataAdapter ad = new OracleDataAdapter(command);
-            ad.Fill(dt);
+            try
+            {
+                ad.Fill(dt);
+            }
+            catch (Exception)
+            {
+                connection = new OracleConnection(ConnectionStrings);
+                connection.Open();
+                command.Connection = connection;
+                ad = new OracleDataAdapter();
+                ad.SelectCommand = command;
+                ad.Fill(dt);
+            }
             ad.Dispose();
-            command.Dispose();
+
             return dt;
         }
 
@@ -187,301 +296,26 @@ namespace UAS_MesInterface
             string sql = "select ";
             sql += Fields;
             sql += " from " + TableName;
-            command = new OracleCommand(sql, connection);
+            command.CommandText = sql;
+            command.CommandType = CommandType.Text;
             Reconnect(command);
             OracleDataAdapter ad = new OracleDataAdapter(command);
             ad.SelectCommand = command;
-            ad.Fill(dt);
-            foreach (DataColumn dc in dt.Columns)
-            {
-                dc.Caption = "测试测试";
-            }
-            ad.Dispose();
-            command.Dispose();
-            return dt;
-        }
-
-        /// <summary>
-        /// 根据DataTable和指定的表名更新数据,如果需要保存新增的数据则需要传递一条Insert的SQL
-        /// </summary>
-        /// <param name="DataTable"></param>
-        /// <param name="TableName"></param>
-        /// <param name="Condition"></param>
-        public void UpDateTableByCondition(DataTable DataTable, string TableName, string PrimaryKey, params string[] sql)
-        {
-            if (DataTable == null)
-            {
-                return;
-            }
-            StringBuilder sb = new StringBuilder();
-            //预防插入的DataTable中存在不属于该表的列,在进行下一步操作之前全部剔除
-            DataTable data = (DataTable)ExecuteSql("select Column_Name,Data_Type from cols where TABLE_name=upper('" + TableName + "')", "select");
-            //将所有的字段拼接起来
-            for (int i = 0; i < data.Rows.Count; i++)
-            {
-                sb.Append("#" + data.Rows[i]["Column_Name"].ToString());
-            }
-            //移除掉所有不属于该表的列
-            for (int i = DataTable.Columns.Count - 1; i >= 0; i--)
-            {
-                if (!sb.ToString().Contains(DataTable.Columns[i].ColumnName.ToUpper()))
-                {
-                    DataTable.Columns.RemoveAt(i);
-                }
-            }
-            sb.Clear();
-            //计算有多少个是新加的行,根据主键为空来进行判断
-            int NewRowCount = 0;
-            for (int i = 0; i < DataTable.Rows.Count; i++)
-            {
-                if (DataTable.Rows[i][PrimaryKey] == null || DataTable.Rows[i][PrimaryKey].ToString() == "")
-                {
-                    NewRowCount = NewRowCount + 1;
-                }
-            }
-            if (sql.Length > 0)
-            {
-                if (NewRowCount > 0)
-                {
-                    //获取参数的个数
-                    int paramsNum = sql[0].Split(':').Length - 1;
-                    //解析参数的数据
-                    string[] param = GetParamFromSQL(sql[0]);
-                    //新建一个二维数组去
-                    string[][] param_array = new string[paramsNum][];
-                    //实例化每个一维数组
-                    for (int i = 0; i < paramsNum; i++)
-                    {
-                        param_array[i] = new string[NewRowCount];
-                    }
-                    //设置每列参数的索引
-                    int num = 0;
-                    //变量所有的行,如果有主键为空的则移除,不为空的进行参数的拼接
-                    for (int i = DataTable.Rows.Count - 1; i >= 0; i--)
-                    {
-                        if (DataTable.Rows[i][PrimaryKey] == null || DataTable.Rows[i][PrimaryKey].ToString() == "")
-                        {
-                            //当为新添加行的时候才去设置参数,设置过后索引+1
-                            for (int j = 0; j < paramsNum; j++)
-                            {
-                                param_array[j][num] = DataTable.Rows[i][param[j]].ToString();
-                            }
-                            DataTable.Rows.RemoveAt(i);
-                            num++;
-                        }
-                    }
-                    BatchInsertDataTable(sql[0], param, param_array);
-                }
-            }
-            //不是新增行的启用更新的方法
-            sb.Append("update " + TableName + " set ");
-            //拼接语句,特殊处理日期
-
-            foreach (DataColumn dc in DataTable.Columns)
-            {
-                if (!dc.DataType.ToString().Equals("System.DateTime"))
-                {
-                    sb.Append(dc.Caption + "=:" + dc.Caption + ",");
-                }
-                else
-                {
-                    sb.Append(dc.Caption + "=:" + dc.Caption + ",");
-                }
-            }
-            sb.Remove(sb.Length - 1, 1);
-            sb.Append(" where " + PrimaryKey + "=:" + PrimaryKey);
-            command = new OracleCommand(sb.ToString(), connection);
-            OracleDataAdapter ad = new OracleDataAdapter(command);
-            // 参数的长度是DataTable的行数决定的
-            command.ArrayBindCount = DataTable.Rows.Count;
-            //默认全部是Varchar2类型的
-            OracleDbType ob = OracleDbType.Varchar2;
-            for (int i = 0; i < DataTable.Columns.Count; i++)
-            {
-                object[] param = new object[DataTable.Rows.Count];
-                for (int j = 0; j < DataTable.Rows.Count; j++)
-                {
-                    DateTime dt = DateTime.Now;
-                    if (DateTime.TryParse(DataTable.Rows[j][i].ToString(), out dt))
-                    {
-                        param[j] = dt;
-                        ob = OracleDbType.Date;
-                    }
-                    else
-                    {
-                        ob = OracleDbType.Varchar2;
-                        param[j] = DataTable.Rows[j][i];
-                    }
-                }
-                //添加批量更新的参数
-                command.Parameters.Add(new OracleParameter(DataTable.Columns[i].Caption, ob, param, ParameterDirection.Input));
-            }
-            ad.UpdateCommand = command;
-            ad.Update(DataTable);
-            ad.Dispose();
-            command.Dispose();
-        }
-
-        /// <summary>
-        /// 获取DbFind的数据的DataTable的结构
-        /// </summary>
-        /// <param name="field"></param>
-        /// <param name="caller"></param>
-        /// <returns></returns>
-        public DataTable GetDbFindDataTable(string field, string caller)
-        {
-            string sql = "select * from dbfindsetui where ds_caller='" + caller + "' and ds_whichui='" + field + "'";
-            DataTable dt = (DataTable)ExecuteSql(sql, "select");
-            if (dt.Rows.Count != 0)
-            {
-                //通过#号分割字段
-                string[] dbfield = dt.Rows[0]["ds_findtoui"].ToString().Split('#');
-                string[] cnfield = dt.Rows[0]["ds_dbcaption"].ToString().Split('#');
-                //获取查询要查询的Table
-                string dbtable = dt.Rows[0]["ds_tables"].ToString();
-                //拼接查询的字段
-                for (int i = 0; i < dbfield.Length; i++)
-                {
-                    dbfield[i] = dbfield[i].Split(',')[0];
-                }
-                //新建一个空的DataTable
-                DataTable dt1 = new DataTable();
-                //往空的DataTable添加结构,ColumnName是中文,Caption是实际的字段名称
-                for (int i = 0; i < cnfield.Length; i++)
-                {
-                    dt1.Columns.Add(cnfield[i]);
-                    dt1.Columns[i].Caption = dbfield[i];
-                }
-                //返回一个带有结构的空的DataTable
-                //DbFind.BindTable1 = dbtable;
-                return dt1;
-            }
-            else
-            {
-                return null;
-            }
-        }
-
-        /// <summary>
-        ///  获取配置列表中的数据,支持DaatList,Form,DetailGrid
-        /// </summary>
-        /// <param name="Caller"></param>
-        /// <param name="Type"></param>
-        /// <param name="condition"></param>
-        /// <returns></returns>
-        public DataTable GetConfigureData(string Caller, string Type, string condition)
-        {
-            DataTable dt = new DataTable();
-            //用于拼接SQL语句
-            StringBuilder Sql = new StringBuilder();
-            //用于设置不同Type时设置对应表的字段
-            string getField = "";
-            string getCaption = "";
-            string getTable = "";
-            switch (Type.ToUpper())
-            {
-                case "DATALIST":
-                    getField = "dld_field"; getCaption = "dld_caption"; getTable = "dld_table";
-                    Sql.Append("select * from datalistdetail where dld_caller='" + Caller + "'");
-                    break;
-                case "FORM":
-                    getField = "fd_field"; getCaption = "fd_caption"; getTable = "fd_table";
-                    Sql.Append("select * from formdetail where fd_foid=( select fo_id from form where fo_caller='" + Caller + "')");
-                    break;
-                case "DETAILGRID":
-                    getField = "dg_field"; getCaption = "dg_caption"; getTable = "dg_table";
-                    Sql.Append("select * from detailgrid  where dg_caller='" + Caller + "'");
-                    break;
-            }
-            command = new OracleCommand(Sql.ToString(), connection);
-            OracleDataAdapter ad = new OracleDataAdapter(command);
-            ad.Fill(dt);
-            //清除掉之前的内容重新拼接
-            Sql.Clear();
-            Sql.Append("select ");
-            string[] field = new string[dt.Rows.Count];
-            string[] caption = new string[dt.Rows.Count];
-            DataTable dt1 = new DataTable();
-            //记录描述和字段名称
-            foreach (DataRow dr in dt.Rows)
-            {
-                field[dt.Rows.IndexOf(dr)] = dr[getCaption].ToString();
-                caption[dt.Rows.IndexOf(dr)] = dr[getField].ToString();
-                Sql.Append(dr[getField] + ",");
-            }
-            //调用substring是为了去除之前拼接多出来的一个逗号
-            string sql = Sql.Remove(Sql.Length - 1, 1).ToString() + " from " + dt.Rows[0][getTable] + " where " + condition;
-            //调用一个新的构造DataTable用来存放返回的数据
-            dt1 = (DataTable)ExecuteSql(sql, "select");
-            //给DataTable加上列名和描述,列名是中文字段,描述是数据库实际的字段名称
-            for (int i = 0; i < field.Length; i++)
-            {
-                dt1.Columns[i].ColumnName = field[i];
-                dt1.Columns[i].Caption = caption[i];
-            }
-            //返回的第一条数据是SQL,后面的是实际的列名
-            ad.Dispose();
-            command.Dispose();
-            return dt1;
-        }
-
-        /// <summary>
-        /// 查询配置的字段,Type是查询DataList,Form还是DetailGrid
-        /// </summary>
-        /// <param name="Caller"></param>
-        /// <param name="Type"></param>
-        /// <returns></returns>
-        public DataTable GetConfigureData(string Caller, string Type)
-        {
-            DataTable dt = new DataTable();
-            //用于拼接SQL语句
-            StringBuilder Sql = new StringBuilder();
-            //用于设置不同Type时设置对应表的字段
-            string getField = "";
-            string getCaption = "";
-            string getTable = "";
-            switch (Type.ToUpper())
-            {
-                case "DATALIST":
-                    getField = "dld_field"; getCaption = "dld_caption"; getTable = "dld_table";
-                    Sql.Append("select * from datalistdetail where dld_caller='" + Caller + "'");
-                    break;
-                case "FORM":
-                    getField = "fd_field"; getCaption = "fd_caption"; getTable = "fd_table";
-                    Sql.Append("select * from formdetail where fd_foid=( select fo_id from form where fo_caller='" + Caller + "')");
-                    break;
-                case "DETAILGRID":
-                    getField = "dg_field"; getCaption = "dg_caption"; getTable = "dg_table";
-                    Sql.Append("select * from detailgrid  where dg_caller='" + Caller + "'");
-                    break;
-            }
-            command = new OracleCommand(Sql.ToString(), connection);
-            OracleDataAdapter ad = new OracleDataAdapter(command);
-            ad.Fill(dt);
-            //清除掉之前的内容重新拼接
-            Sql.Clear();
-            Sql.Append("select ");
-            //用于记录实际的列名,+1的目的是为了存放SQL
-            string[] field = new string[dt.Rows.Count];
-            string[] caption = new string[dt.Rows.Count];
-            DataTable dt1 = new DataTable();
-            foreach (DataRow dr in dt.Rows)
+            try
             {
-                field[dt.Rows.IndexOf(dr)] = dr[getCaption].ToString();
-                caption[dt.Rows.IndexOf(dr)] = dr[getField].ToString();
-                Sql.Append(dr[getField] + ",");
+                ad.Fill(dt);
             }
-            string sql = Sql.Remove(Sql.Length - 1, 1).ToString() + " from " + dt.Rows[0][getTable];
-            dt1 = (DataTable)ExecuteSql(sql, "select");
-            //设置DataTable的列名和描述
-            for (int i = 0; i < field.Length; i++)
+            catch (Exception)
             {
-                dt1.Columns[i].ColumnName = field[i];
-                dt1.Columns[i].Caption = caption[i];
+                connection = new OracleConnection(ConnectionStrings);
+                connection.Open();
+                command.Connection = connection;
+                ad = new OracleDataAdapter();
+                ad.SelectCommand = command;
+                ad.Fill(dt);
             }
             ad.Dispose();
-            command.Dispose();
-            return dt1;
+            return dt;
         }
 
         /// <summary>
@@ -493,13 +327,13 @@ namespace UAS_MesInterface
         public bool CheckExist(string TableName, string Condition)
         {
             string sql = "select count(1) from " + TableName + " where " + Condition;
-            command = new OracleCommand(sql, connection);
+            command.CommandText = sql;
+            command.CommandType = CommandType.Text;
             Reconnect(command);
             OracleDataAdapter ad = new OracleDataAdapter(command);
             DataTable dt = new DataTable();
             ad.Fill(dt);
             ad.Dispose();
-            command.Dispose();
             return int.Parse(dt.Rows[0][0].ToString()) > 0;
         }
 
@@ -511,8 +345,10 @@ namespace UAS_MesInterface
         /// <returns></returns>
         public object ExecuteSql(string SQL, string Type, params object[] names)
         {
+            command.Parameters.Clear();
             object result = null;
-            command = new OracleCommand(SQL, connection);
+            command.CommandText = SQL;
+            command.CommandType = CommandType.Text;
             Reconnect(command);
             //用来拼接参数的
             if (names.Length > 0)
@@ -543,22 +379,59 @@ namespace UAS_MesInterface
             switch (Type.ToUpper())
             {
                 case "SELECT":
-                    result = new DataTable();
                     OracleDataAdapter ad = new OracleDataAdapter(command);
-                    ad.Fill((DataTable)result);
-                    ad.Dispose();
+                    result = new DataTable();
+                    try
+                    {
+                        ad.Fill((DataTable)result);
+                    }
+                    catch (Exception)
+                    {
+                        connection = new OracleConnection(ConnectionStrings);
+                        connection.Open();
+                        command.Connection = connection;
+                        ad = new OracleDataAdapter();
+                        ad.SelectCommand = command;
+                        ad.Fill((DataTable)result);
+                    }
                     break;
                 case "DELETE":
-                    result = command.ExecuteNonQuery();
+                    try
+                    {
+                        result = command.ExecuteNonQuery();
+                    }
+                    catch (Exception)
+                    {
+                        command.Connection = new OracleConnection(ConnectionStrings);
+                        command.Connection.Open();
+                        result = command.ExecuteNonQuery();
+                    }
                     break;
                 case "UPDATE":
-                    result = command.ExecuteNonQuery();
+                    try
+                    {
+                        result = command.ExecuteNonQuery();
+                    }
+                    catch (Exception)
+                    {
+                        command.Connection = new OracleConnection(ConnectionStrings);
+                        command.Connection.Open();
+                        result = command.ExecuteNonQuery();
+                    }
                     break;
                 case "INSERT":
-                    result = command.ExecuteNonQuery();
+                    try
+                    {
+                        result = command.ExecuteNonQuery();
+                    }
+                    catch (Exception)
+                    {
+                        command.Connection = new OracleConnection(ConnectionStrings);
+                        command.Connection.Open();
+                        result = command.ExecuteNonQuery();
+                    }
                     break;
             }
-            command.Dispose();
             return result;
         }
 
@@ -569,21 +442,33 @@ namespace UAS_MesInterface
         public void CheckSQL(string SQL)
         {
             SQL = SQL.Replace("?", ":Param");
-            command = new OracleCommand(SQL, connection);
+            command.CommandText = SQL;
+            command.CommandType = CommandType.Text;
             command.ExecuteNonQuery();
-            command.Dispose();
         }
 
         public int GetDistinctRowCount(string TableName, string Field)
         {
             DataTable dt = new DataTable();
             string sql = "select distinct count('" + Field + "') from " + TableName;
-            command = new OracleCommand(sql, connection);
+            command.CommandText = sql;
+            command.CommandType = CommandType.Text;
             Reconnect(command);
             OracleDataAdapter ad = new OracleDataAdapter(command);
-            ad.Fill(dt);
+            try
+            {
+                ad.Fill(dt);
+            }
+            catch (Exception)
+            {
+                connection = new OracleConnection(ConnectionStrings);
+                connection.Open();
+                command.Connection = connection;
+                ad = new OracleDataAdapter();
+                ad.SelectCommand = command;
+                ad.Fill(dt);
+            }
             ad.Dispose();
-            command.Dispose();
             return int.Parse(dt.Rows[0][0].ToString());
         }
 
@@ -607,13 +492,25 @@ namespace UAS_MesInterface
         /// <param name="DeleteID">需要删除主键ID的数组</param>
         public void DeleteDataByID(string TableName, string ID, string[] DeleteID)
         {
+            command.Parameters.Clear();
             string sql = "delete from " + TableName + " where " + ID + " =:DeleteID";
-            command = new OracleCommand(sql, connection);
+            command.CommandText = sql;
+            command.CommandType = CommandType.Text;
             Reconnect(command);
             command.ArrayBindCount = DeleteID.Length;
             command.Parameters.Add(new OracleParameter("DeleteID", OracleDbType.Long, DeleteID, ParameterDirection.Input));
-            command.ExecuteNonQuery();
-            command.Dispose();
+            try
+            {
+                command.ExecuteNonQuery();
+                command.ArrayBindCount = 0;
+            }
+            catch (Exception)
+            {
+                command.Connection = new OracleConnection(ConnectionStrings);
+                command.Connection.Open();
+                command.ExecuteNonQuery();
+                command.ArrayBindCount = 0;
+            }
         }
 
         /// <summary>
@@ -628,6 +525,23 @@ namespace UAS_MesInterface
             return dt.Rows[0][0].ToString();
         }
 
+        /// <summary>
+        /// 通过序列的名称获取序列
+        /// </summary>
+        /// <param name="SeqName"></param>
+        /// <returns></returns>
+        public string[] GetSEQ(string SeqName, int Num)
+        {
+            DataTable dt = new DataTable();
+            dt = (DataTable)ExecuteSql("select " + SeqName + ".nextval from (select 1 from OQCITEMSAMPLES where rownum<" + (Num + 1) + ")", "select");
+            string[] SerialNum = new string[dt.Rows.Count];
+            for (int i = 0; i < dt.Rows.Count; i++)
+            {
+                SerialNum[i] = dt.Rows[i][0].ToString();
+            }
+            return SerialNum;
+        }
+
         public void SaveDataTable(DataTable dt, string TableName, string ID, params string[] sql)
         {
             if (dt == null)
@@ -734,7 +648,8 @@ namespace UAS_MesInterface
         /// <param name="names"></param>
         public void BatchInsert(string sql, params object[][] names)
         {
-            command = new OracleCommand(sql, connection);
+            command.Parameters.Clear();
+            command.CommandText = sql;
             Reconnect(command);
             command.ArrayBindCount = names[1].Length;
             //因为第一个数组保存的是参数的名称,所以循环从1而不是0开始
@@ -743,13 +658,24 @@ namespace UAS_MesInterface
             {
                 command.Parameters.Add(new OracleParameter(names[0][i - 1].ToString(), OracleDbType.Varchar2, names[i], ParameterDirection.Input));
             }
-            command.ExecuteNonQuery();
-            command.Dispose();
+            try
+            {
+                command.ExecuteNonQuery();
+                command.ArrayBindCount = 0;
+            }
+            catch (Exception)
+            {
+                command.Connection = new OracleConnection(ConnectionStrings);
+                command.Connection.Open();
+                command.ExecuteNonQuery();
+                command.ArrayBindCount = 0;
+            }
         }
 
         public void BatchInsertDataTable(string sql, string[] param, params object[][] param1)
         {
-            command = new OracleCommand(sql, connection);
+            command.Parameters.Clear();
+            command.CommandText = sql;
             Reconnect(command);
             command.ArrayBindCount = param1[0].Length;
             //因为第一个数组保存的是参数的名称,所以循环从1而不是0开始
@@ -758,28 +684,18 @@ namespace UAS_MesInterface
             {
                 command.Parameters.Add(new OracleParameter(param[i].ToString(), OracleDbType.Varchar2, param1[i], ParameterDirection.Input));
             }
-            command.ExecuteNonQuery();
-            command.Dispose();
-        }
-
-
-        /// <summary>
-        /// 查询DataList配置的字段
-        /// </summary>
-        /// <param name="TableName"></param>
-        /// <param name="Caller"></param>
-        /// <returns></returns>
-        public string GetDataList(string TableName, string Caller)
-        {
-            DataTable dt = new DataTable();
-            string SQL = " select listagg(dld_field,',') within group (order by dld_id)  from datalistdetail where dld_caller='" + Caller + "'";
-            command = new OracleCommand(SQL, connection);
-            Reconnect(command);
-            OracleDataAdapter ad = new OracleDataAdapter(command);
-            ad.Fill(dt);
-            ad.Dispose();
-            command.Dispose();
-            return dt.Rows[0][0].ToString();
+            try
+            {
+                command.ExecuteNonQuery();
+                command.ArrayBindCount = 0;
+            }
+            catch (Exception)
+            {
+                command.Connection = new OracleConnection(ConnectionStrings);
+                command.Connection.Open();
+                command.ExecuteNonQuery();
+                command.ArrayBindCount = 0;
+            }
         }
 
         /// <summary>
@@ -837,7 +753,6 @@ namespace UAS_MesInterface
             return dt1;
         }
 
-
         /// <summary>
         /// 通过条件更新
         /// </summary>
@@ -847,10 +762,19 @@ namespace UAS_MesInterface
         public string UpdateByCondition(string TableName, string update, string condition)
         {
             string sql = "update " + TableName + " set " + update + " where " + condition;
-            command = new OracleCommand(sql, connection);
+            command.CommandText = sql;
+            command.CommandType = CommandType.Text;
             Reconnect(command);
-            command.ExecuteNonQuery();
-            command.Dispose();
+            try
+            {
+                command.ExecuteNonQuery();
+            }
+            catch (Exception)
+            {
+                command.Connection = new OracleConnection(ConnectionStrings);
+                command.Connection.Open();
+                command.ExecuteNonQuery();
+            }
             return sql;
         }
 
@@ -861,17 +785,25 @@ namespace UAS_MesInterface
         /// <param name="param"></param>
         public void CallProcedure(string ProcedureName, ref string[] param)
         {
-            command = new OracleCommand(ProcedureName);
-            command.Connection = connection;
-            Reconnect(command);
+            command.Parameters.Clear();
             command.CommandText = ProcedureName;
             command.CommandType = CommandType.StoredProcedure;
+            command.ArrayBindCount = 0;
+            Reconnect(command);
             for (int i = 0; i < param.Length; i++)
                 command.Parameters.Add(new OracleParameter(param[i].ToString(), OracleDbType.Varchar2, 200, param[i], ParameterDirection.InputOutput));
-            command.ExecuteNonQuery();
+            try
+            {
+                command.ExecuteNonQuery();
+            }
+            catch (Exception)
+            {
+                command.Connection = new OracleConnection(ConnectionStrings);
+                command.Connection.Open();
+                command.ExecuteNonQuery();
+            }
             for (int i = 0; i < command.Parameters.Count; i++)
                 param[i] = command.Parameters[i].Value.ToString();
-            command.Dispose();
         }
 
         /// <summary>
@@ -881,8 +813,6 @@ namespace UAS_MesInterface
         public void ExecuteSQLTran(params string[] SQL)
         {
             OracleTransaction tx = connection.BeginTransaction();
-            command = new OracleCommand();
-            command.Connection = connection;
             command.Transaction = tx;
             try
             {
@@ -891,7 +821,17 @@ namespace UAS_MesInterface
                     if (!string.IsNullOrEmpty(sql))
                     {
                         command.CommandText = sql;
-                        command.ExecuteNonQuery();
+                        command.CommandType = CommandType.Text;
+                        try
+                        {
+                            command.ExecuteNonQuery();
+                        }
+                        catch (Exception)
+                        {
+                            command.Connection = new OracleConnection(ConnectionStrings);
+                            command.Connection.Open();
+                            command.ExecuteNonQuery();
+                        }
                     }
                 }
                 tx.Commit();
@@ -901,7 +841,6 @@ namespace UAS_MesInterface
                 tx.Rollback();
                 throw new Exception(E.Message);
             }
-            command.Dispose();
         }
 
         /// <summary>
@@ -951,20 +890,32 @@ namespace UAS_MesInterface
         public object GetLabelParam(string sql)
         {
             DataTable dt = new DataTable();
-            command = new OracleCommand(sql, connection);
+            command.CommandText = sql;
+            command.CommandType = CommandType.Text;
             Reconnect(command);
             OracleDataAdapter ad = new OracleDataAdapter();
             ad.SelectCommand = command;
-            ad.Fill(dt);
+            try
+            {
+                ad.Fill(dt);
+            }
+            catch (Exception)
+            {
+                connection = new OracleConnection(ConnectionStrings);
+                connection.Open();
+                command.Connection = connection;
+                ad = new OracleDataAdapter();
+                ad.SelectCommand = command;
+                ad.Fill(dt);
+            }
             if (dt.Rows.Count > 0)
             {
                 ad.Dispose();
-                command.Dispose();
+
                 return dt.Rows[0][0];
             }
             else
             {
-                command.Dispose();
                 return "";
             }
         }
@@ -980,6 +931,7 @@ namespace UAS_MesInterface
                 //新建一个char类型的数组用来存储每个字节的变量
                 char[] c = par[i + 1].ToCharArray();
                 addpar[i] = new StringBuilder();
+
                 for (int j = 0; j < c.Length; j++)
                 {
                     if (c[j] != ' ' && c[j] != ',' && c[j] != ')')
@@ -999,6 +951,14 @@ namespace UAS_MesInterface
             return param;
         }
 
+        public void Dispose()
+        {
+            if (command != null)
+                command.Dispose();
+            if (connection != null)
+                connection.Dispose();
+        }
+
         private void Reconnect(OracleCommand cmd)
         {
             if (cmd.Connection.State == ConnectionState.Closed)

+ 70 - 66
UAS_MesInterface/LogicHandler.cs

@@ -23,15 +23,14 @@ namespace UAS_MesInterface
         /// <summary>
         /// 检测当前的岗位资源对应的工序
         /// </summary>
-        /// <param name="iSnCode"></param>
-        /// <param name="iMakeCode"></param>
-        /// <param name="iSourceCode"></param>
+        /// <param name="iSN"></param>
+        /// <param name="iResCode"></param>
         /// <param name="oErrMessage"></param>
         /// <returns></returns>
-        public bool CheckRoutePassed(string iSnCode, string iSourceCode, out string oErrMessage)
+        public bool CheckRoutePassed(string iSN, string iResCode, out string oErrMessage)
         {
             oErrMessage = "";
-            string[] param = new string[] { "", iSourceCode, iSnCode, "", "", "", oErrMessage };
+            string[] param = new string[] { "", iResCode, iSN, "", "", "", oErrMessage };
             dh.CallProcedure("CS_CHECKSTEPSNANDMACODE", ref param);
             oErrMessage = param[6];
             if (oErrMessage == "" || oErrMessage == null || oErrMessage == "null")
@@ -65,12 +64,12 @@ namespace UAS_MesInterface
         /// 验证用户身份信息和岗位资源
         /// </summary>
         /// <param name="iUserCode"></param>
-        /// <param name="iPassWord"></param>
-        /// <param name="oErrorMessage"></param>
+        /// <param name="iResCode"></param>
+        /// <param name="oErrMessage"></param>
         /// <returns></returns>
-        public bool CheckUserAndResourcePassed(string iUserCode, string iSourceCode, out string oErrorMessage)
+        public bool CheckUserAndResourcePassed(string iUserCode, string iResCode, out string oErrMessage)
         {
-            oErrorMessage = "";
+            oErrMessage = "";
             string SQL = "select em_code,em_type,em_name from employee where em_code=:UserName ";
             DataTable dt;
             dt = (DataTable)dh.ExecuteSql(SQL, "select", iUserCode);
@@ -78,20 +77,20 @@ namespace UAS_MesInterface
             {
                 string em_name = dt.Rows[0]["em_name"].ToString();
                 string em_type = dt.Rows[0]["em_type"].ToString();
-                if (iSourceCode == "")
+                if (iResCode == "")
                 {
-                    oErrorMessage = "岗位资源不允许为空";
+                    oErrMessage = "岗位资源不允许为空";
                     return false;
                 }
                 if (em_type == "admin")
                 {
-                    if (dh.CheckExist("Source", "sc_code='" + iSourceCode + "' and sc_statuscode='AUDITED'"))
+                    if (dh.CheckExist("Source", "sc_code='" + iResCode + "' and sc_statuscode='AUDITED'"))
                     {
                         return true;
                     }
                     else
                     {
-                        oErrorMessage = "岗位资源编号错误或者未审核!";
+                        oErrMessage = "岗位资源编号错误或者未审核!";
                         return false;
                     }
                 }
@@ -104,51 +103,50 @@ namespace UAS_MesInterface
                         //判断如果多个岗位资源存在,用户输入的只要在其中就行
                         for (int i = 0; i < dt.Rows.Count; i++)
                         {
-                            if (dt.Rows[i]["ur_resourcecode"].ToString() == iSourceCode)
+                            if (dt.Rows[i]["ur_resourcecode"].ToString() == iResCode)
                                 return true;
                         }
-                        oErrorMessage = "用户不处于当前资源所属分组!";
+                        oErrMessage = "用户不处于当前资源所属分组!";
                     }
                     else
-                        oErrorMessage = "岗位资源编号错误或者未审核!";
+                        oErrMessage = "岗位资源编号错误或者未审核!";
                 }
             }
             else
-                oErrorMessage = "用户不存在!";
+                oErrMessage = "用户不存在!";
             return false;
         }
 
         /// <summary>
         /// 分配Mac地址和BT地址
         /// </summary>
-        /// <param name="iSnCode"></param>
-        /// <param name="iMakeCode"></param>
-        /// <param name="oMac"></param>
+        /// <param name="iSN"></param>
+        /// <param name="oWIFI"></param>
         /// <param name="oBT"></param>
         /// <param name="oCode1"></param>
         /// <param name="oCode2"></param>
         /// <param name="oCdoe3"></param>
-        /// <param name="oErrorMessage"></param>
+        /// <param name="oErrMessage"></param>
         /// <returns></returns>
-        public bool GetAddressRangeByMO(string iSnCode, out string oMac, out string oBT, out string oCode1, out string oCode2, out string oCdoe3, out string oErrorMessage)
+        public bool GetAddressRangeByMO(string iSN, out string oWIFI, out string oBT, out string oCode1, out string oCode2, out string oCdoe3, out string oErrMessage)
         {
-            oMac = "";
+            oWIFI = "";
             oBT = "";
             oCode1 = "";
             oCode2 = "";
             oCdoe3 = "";
-            oErrorMessage = "";
+            oErrMessage = "";
             string omakeCode = "";
-            GetRcardMOInfo(iSnCode,out omakeCode,out oErrorMessage);
-            string[] param = new string[] { iSnCode, omakeCode, oMac, oBT, oCode1, oCode2, oCdoe3, oErrorMessage };
+            GetRcardMOInfo(iSN,out omakeCode,out oErrMessage);
+            string[] param = new string[] { iSN, omakeCode, oWIFI, oBT, oCode1, oCode2, oCdoe3, oErrMessage };
             dh.CallProcedure("CS_GETADDRESSBYMAKECODE", ref param);
-            oMac = param[2];
+            oWIFI = param[2];
             oBT = param[3];
             oCode1 = param[4];
             oCode2 = param[5];
             oCdoe3 = param[6];
-            oErrorMessage = param[7];
-            if (oErrorMessage == "" || oErrorMessage == null || oErrorMessage == "null")
+            oErrMessage = param[7];
+            if (oErrMessage == "" || oErrMessage == null || oErrMessage == "null")
                 return true;
             else
                 return false;
@@ -158,8 +156,7 @@ namespace UAS_MesInterface
         /// 输入的 SN 号查找在制品是否有 IMEI 信息存在,如果存在则将 IMEI 信息传出,如果没有则在该工单下未使用的 IMEI 中随机分配一组
         /// 如果iIMEI1、iNetCode不为空,则分别作为获取的附件加条件。
         /// </summary>
-        /// <param name="iSN"></param>
-        /// <param name="iMO"></param>
+        /// <param name="iSnCode"></param>
         /// <param name="iIMEI1"></param>
         /// <param name="iNetCode"></param>
         /// <param name="oIMEI1"></param>
@@ -168,14 +165,12 @@ namespace UAS_MesInterface
         /// <param name="oMEID"></param>
         /// <param name="oNetCode"></param>
         /// <param name="oPSN"></param>
-        /// <param name="oMac"></param>
-        /// <param name="oBT"></param>
         /// <param name="oID1"></param>
         /// <param name="oID2"></param>
         /// <param name="oID3"></param>
-        /// <param name="oErrorMessage"></param>
+        /// <param name="oErrMessage"></param>
         /// <returns></returns>
-        public bool GetMEIOrNetCodeRange(string iSnCode, string iIMEI1, string iNetCode, out string oIMEI1, out string oIMEI2, out string oIMEI3, out string oMEID, out string oNetCode, out string oPSN, out string oID1, out string oID2, out string oID3, out string oErrorMessage)
+        public bool GetMEIOrNetCodeRange(string iSnCode, string iIMEI1, string iNetCode, out string oIMEI1, out string oIMEI2, out string oIMEI3, out string oMEID, out string oNetCode, out string oPSN, out string oID1, out string oID2, out string oID3, out string oErrMessage)
         {
             oIMEI1 = "";
             oIMEI2 = "";
@@ -186,8 +181,8 @@ namespace UAS_MesInterface
             oID1 = "";
             oID2 = "";
             oID3 = "";
-            oErrorMessage = "";
-            string[] param = new string[] { iSnCode, "", iIMEI1, iNetCode, oIMEI1, oIMEI2, oIMEI3, oMEID, oNetCode, oPSN, oID1, oID2, oID3, oErrorMessage };
+            oErrMessage = "";
+            string[] param = new string[] { iSnCode, "", iIMEI1, iNetCode, oIMEI1, oIMEI2, oIMEI3, oMEID, oNetCode, oPSN, oID1, oID2, oID3, oErrMessage };
             dh.CallProcedure("CS_GETIMEIORNETCODERANGE", ref param);
             oIMEI1 = param[4];
             oIMEI2 = param[5];
@@ -198,8 +193,8 @@ namespace UAS_MesInterface
             oID1 = param[10];
             oID2 = param[11];
             oID3 = param[12];
-            oErrorMessage = param[13];
-            if (oErrorMessage == "" || oErrorMessage == null || oErrorMessage == "null")
+            oErrMessage = param[13];
+            if (oErrMessage == "" || oErrMessage == null || oErrMessage == "null")
                 return true;
             else
                 return false;
@@ -208,22 +203,22 @@ namespace UAS_MesInterface
         /// <summary>
         /// 获取工单的最近一条执行记录
         /// </summary>
-        /// <param name="iSnCode"></param>
-        /// <param name="oMakeCode"></param>
-        /// <param name="oErrorMessage"></param>
+        /// <param name="iSN"></param>
+        /// <param name="oMoCode"></param>
+        /// <param name="oErrMessage"></param>
         /// <returns></returns>
-        public bool GetRcardMOInfo(string iSnCode, out string oMakeCode, out string oErrorMessage)
+        public bool GetRcardMOInfo(string iSN, out string oMoCode, out string oErrMessage)
         {
             //取MakeProcess表中的执行记录ID最大的一个工单的号码
-            oMakeCode = "";
-            oErrorMessage = "";
-            string ms_id = dh.getFieldDataByCondition("MakeSerial", "max(ms_id) ms_id", "ms_sncode='" + iSnCode + "' or ms_firstsn in (select firstsn from makesnrelation where sn='" + iSnCode + "')").ToString();
-            oMakeCode = dh.getFieldDataByCondition("MakeSerial", "ms_makecode", "ms_id='" + ms_id + "'").ToString();
-            if (oMakeCode != "")
+            oMoCode = "";
+            oErrMessage = "";
+            string ms_id = dh.getFieldDataByCondition("MakeSerial", "max(ms_id) ms_id", "ms_sncode='" + iSN + "' or ms_firstsn in (select firstsn from makesnrelation where sn='" + iSN + "')").ToString();
+            oMoCode = dh.getFieldDataByCondition("MakeSerial", "ms_makecode", "ms_id='" + ms_id + "'").ToString();
+            if (oMoCode != "")
                 return true;
             else
             {
-                oErrorMessage = "序列号:" + iSnCode + " 未归属工单";
+                oErrMessage = "序列号:" + iSN + " 未归属工单";
                 return false;
             }
         }
@@ -232,24 +227,29 @@ namespace UAS_MesInterface
         /// 获取序列号的所有串号信息
         /// </summary>
         /// <param name="iSnCode"></param>
+        /// <param name="oWIFI"></param>
+        /// <param name="oBT"></param>
+        /// <param name="oCode1"></param>
+        /// <param name="oCode2"></param>
+        /// <param name="oCode3"></param>
         /// <param name="oIMEI1"></param>
         /// <param name="oIMEI2"></param>
         /// <param name="oIMEI3"></param>
         /// <param name="oMEID"></param>
         /// <param name="oNetCode"></param>
         /// <param name="oPSN"></param>
-        /// <param name="oMac"></param>
-        /// <param name="oBT"></param>
-        /// <param name="oCode1"></param>
-        /// <param name="oCode2"></param>
-        /// <param name="oCode3"></param>
+        /// <param name="oID1"></param>
+        /// <param name="oID2"></param>
+        /// <param name="oID3"></param>
+        /// <param name="oID4"></param>
+        /// <param name="oID5"></param>
         /// <param name="oErrorMessage"></param>
         /// <returns></returns>
-        public bool GetMobileAllInfo(string iSnCode, out string oMac, out string oBT, out string oCode1, out string oCode2, out string oCode3, out string oIMEI1, out string oIMEI2, out string oIMEI3, out string oMEID, out string oNetCode, out string oPSN, out string oID1, out string oID2, out string oID3, out string oErrorMessage)
+        public bool GetMobileAllInfo(string iSnCode, out string oWIFI, out string oBT, out string oCode1, out string oCode2, out string oCode3, out string oIMEI1, out string oIMEI2, out string oIMEI3, out string oMEID, out string oNetCode, out string oPSN, out string oID1, out string oID2, out string oID3,out string oID4,out string oID5, out string oErrorMessage)
         {
             oBT = "";
             oMEID = "";
-            oMac = "";
+            oWIFI = "";
             oPSN = "";
             oNetCode = "";
             oIMEI1 = "";
@@ -261,6 +261,8 @@ namespace UAS_MesInterface
             oID1 = "";
             oID2 = "";
             oID3 = "";
+            oID4 = "";
+            oID5 = "";
             //通过序列号获取最近操作的工单号
             string ms_id = dh.getFieldDataByCondition("makeserial", "ms_id", "ms_sncode='" + iSnCode + "'").ToString();
             if (ms_id != "")
@@ -268,7 +270,7 @@ namespace UAS_MesInterface
                 DataTable dt = dh.getFieldsDataByCondition("MakeSerial", new string[] { "ms_id", "ms_mac", "ms_bt", "ms_meid", "ms_netcode", "ms_psn", "ms_imei1", "ms_imei2", "ms_imei3", "ms_othcode1", "ms_othcode2", "ms_othcode3", "ms_othid1", "ms_othid2", "ms_othid3" }, "ms_id='" + ms_id + "'");
                 if (dt.Rows.Count > 0)
                 {
-                    oMac = dt.Rows[0]["ms_mac"].ToString();
+                    oWIFI = dt.Rows[0]["ms_mac"].ToString();
                     oBT = dt.Rows[0]["ms_bt"].ToString();
                     oPSN = dt.Rows[0]["ms_psn"].ToString();
                     oNetCode = dt.Rows[0]["ms_netcode"].ToString();
@@ -326,17 +328,17 @@ namespace UAS_MesInterface
         /// 保存Mac地址和BT地址
         /// </summary>
         /// <param name="iSN"></param>
-        /// <param name="iMac"></param>
+        /// <param name="iWIFI"></param>
         /// <param name="iBT"></param>
         /// <param name="iCode1"></param>
         /// <param name="iCode2"></param>
         /// <param name="iCode3"></param>
         /// <param name="oErrorMessage"></param>
         /// <returns></returns>
-        public bool SetAddressInfo(string iSN, string iMac, string iBT, string iCode1, string iCode2, string iCode3, out string oErrorMessage)
+        public bool SetAddressInfo(string iSN, string iWIFI, string iBT, string iCode1, string iCode2, string iCode3, out string oErrorMessage)
         {
             oErrorMessage = "";
-            string[] param = new string[] { iSN, iMac, iBT, iCode1, iCode2, iCode3, oErrorMessage };
+            string[] param = new string[] { iSN, iWIFI, iBT, iCode1, iCode2, iCode3, oErrorMessage };
             dh.CallProcedure("CS_SETADDRESSINFO", ref param);
             oErrorMessage = param[6];
             if (oErrorMessage == "" || oErrorMessage == null || oErrorMessage == "null")
@@ -423,7 +425,7 @@ namespace UAS_MesInterface
         /// <summary>
         /// 方法说明:测试详细信息录入系统,针对一个SN多个测试项目结果可循环调用
         /// </summary>
-        /// <param name="iSnCode">序列号</param>
+        /// <param name="iSN">序列号</param>
         /// <param name="iClass"></param>
         /// <param name="iSubClass1"></param>
         /// <param name="iSubClass2"></param>
@@ -437,17 +439,19 @@ namespace UAS_MesInterface
         /// <param name="iTestResult"></param>
         /// <param name="oErrMessage"></param>                                                      
         /// <returns></returns>
-        public bool SetTestDetail(string iSnCode, string iMakeCode, string iClass, string iSubClass1, string iSubClass2, string iSubClass3, string iMaxValue, string iMinValue, string iActualValue, string iValue1, string iValue2, string iValue3, string iTestResult, string iSourceCode, out string oErrMessage)
+        public bool SetTestDetail(string iSN, string iClass, string iSubClass1, string iSubClass2, string iSubClass3, string iMaxValue, string iMinValue, string iActualValue, string iValue1, string iValue2, string iValue3, string iTestResult, out string oErrMessage)
         {
             oErrMessage = "";
             sql.Clear();
+            string omakeCode;
+            GetRcardMOInfo(iSN, out omakeCode, out oErrMessage);
             sql.Append("Insert into STEPTESTDETAIL (STD_ID,STD_SN,STD_MAKECODE,STD_CLASS,STD_SUBCLASS1,STD_SUBCLASS2,");
             sql.Append("STD_SUBCLASS3,STD_MAXVALUE,STD_MINVALUE,STD_ACTUALVALUE,STD_VALUE1,STD_VALUE2,STD_VALUE3,STD_TESTRESULT,");
-            sql.Append("STD_DATE,STD_RESCODE) values (STEPTESTDETAIL_SEQ.nextval,:std_sn,:std_makecode,");
+            sql.Append("STD_DATE) values (STEPTESTDETAIL_SEQ.nextval,:std_sn,:std_makecode,");
             sql.Append(":std_class,:std_subclass1,:std_subclass2,:std_subclass3,:std_maxvalue,:std_minvalue,:std_actualvalue,:std_value1,");
-            sql.Append(":std_value2,:std_value3,:std_testresult,sysdate,:std_record)");
-            dh.ExecuteSql(sql.ToString(), "select", iSnCode, iMakeCode, iClass, iSubClass1, iSubClass2, iSubClass3, iMaxValue, iMinValue, iActualValue, iValue1, iValue2, iValue3, iTestResult, iSourceCode);
-            return true;
+            sql.Append(":std_value2,:std_value3,:std_testresult,sysdate)");
+            dh.ExecuteSql(sql.ToString(), "select", iSN, omakeCode, iClass, iSubClass1, iSubClass2, iSubClass3, iMaxValue, iMinValue, iActualValue, iValue1, iValue2, iValue3, iTestResult);
+            return true;    
         }
 
         /// <summary>

+ 1 - 0
UAS_MesInterface/UAS_MesInterface.csproj

@@ -35,6 +35,7 @@
     </Reference>
     <Reference Include="System" />
     <Reference Include="System.Core" />
+    <Reference Include="System.Data.OracleClient" />
     <Reference Include="System.Xml.Linq" />
     <Reference Include="System.Data.DataSetExtensions" />
     <Reference Include="Microsoft.CSharp" />

TEMPAT SAMPAH
UAS_MesInterface/tool/Oracle.ManagedDataAccess.dll


TEMPAT SAMPAH
UAS_WinForm.zip


+ 1 - 1
UAS_XmlAnalysor/Form1.Designer.cs

@@ -235,7 +235,7 @@
             this.Controls.Add(this.StartWatch);
             this.Margin = new System.Windows.Forms.Padding(2);
             this.Name = "Form1";
-            this.Text = "测试数据监测";
+            this.Text = "UAS_XML解析器";
             this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing);
             this.Load += new System.EventHandler(this.Form1_Load);
             ((System.ComponentModel.ISupportInitialize)(this.XmlWatcher)).EndInit();

+ 7 - 4
UAS_XmlAnalysor/Form1.cs

@@ -30,7 +30,9 @@ namespace UAS_XmlAnalysor
         {
             CheckForIllegalCrossThreadCalls = false;
             InitDB = new Thread(ConnectDB);
-            SetLoadingWindow stw = new SetLoadingWindow(InitDB, "连接数据库");
+            //添加监控事件
+            XmlWatcher.Created += new FileSystemEventHandler(XmlWatcher_Created);
+            SetLoadingWindow stw = new SetLoadingWindow(InitDB, "正在启动程序");
             stw.StartPosition = FormStartPosition.CenterScreen;
             stw.ShowDialog();
             List<string> CacheInf = new List<string>();
@@ -90,7 +92,6 @@ namespace UAS_XmlAnalysor
             }
             XmlWatcher.Path = FolderPath.Text;
             XmlWatcher.Filter = "*.xml";
-            XmlWatcher.Created += new FileSystemEventHandler(XmlWatcher_Created);
             XmlWatcher.EnableRaisingEvents = true;
             string CacheString = FolderPath.Text + "|" + BackUpFolderPath.Text + "|" + Source.Text + "|" + Master.Text + "|" + AutoStart.Checked;
             //写入前先删除文件
@@ -161,9 +162,11 @@ namespace UAS_XmlAnalysor
                         if (stream != null)
                             break;
                     }
-                    System.Threading.Thread.Sleep(500);
                 }
-                catch (Exception) { }
+                catch (Exception ex)
+                {
+                    Console.WriteLine(ex.Message);
+                }
             }
             string testDate = "";
             string testTime = "";

+ 1 - 1
UAS_XmlAnalysor/UAS_XmlAnalysor.csproj

@@ -31,7 +31,7 @@
     <MinimumRequiredVersion>1.0.0.5</MinimumRequiredVersion>
     <CreateWebPageOnPublish>true</CreateWebPageOnPublish>
     <WebPage>publish.htm</WebPage>
-    <ApplicationRevision>21</ApplicationRevision>
+    <ApplicationRevision>22</ApplicationRevision>
     <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
     <UseApplicationTrust>false</UseApplicationTrust>
     <CreateDesktopShortcut>true</CreateDesktopShortcut>