chore: 初始化平芝126KV断路器线程序

This commit is contained in:
yexingqiang
2026-06-08 17:19:31 +08:00
commit e1eb90c6ed
318 changed files with 39531 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,253 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" 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>{DD9131C7-BF40-45B0-827A-C5E46FC8A89E}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>MisDataFun</RootNamespace>
<AssemblyName>MisDataFun</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\MisDataFun_Exe\</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>
<PropertyGroup>
<ApplicationIcon>Mes32X32.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
<ItemGroup>
<Compile Include="mes_signal_conf\MES_CONF.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="mes_signal_conf\MES_CONF.Designer.cs">
<DependentUpon>MES_CONF.cs</DependentUpon>
</Compile>
<Compile Include="mes_signal_conf\SqlOperation.cs" />
<Compile Include="MisDataFun.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="MisDataFun.Designer.cs">
<DependentUpon>MisDataFun.cs</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="webApi\Analysis_MOM_Msg.cs" />
<Compile Include="webApi\Controller\ipcControll.cs" />
<Compile Include="webApi\InitServer.cs" />
<Compile Include="webApi\msgResHeader.cs" />
<Compile Include="webApi\OnlineCheckData.cs" />
<EmbeddedResource Include="mes_signal_conf\MES_CONF.resx">
<DependentUpon>MES_CONF.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="MisDataFun.resx">
<DependentUpon>MisDataFun.cs</DependentUpon>
</EmbeddedResource>
<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>
<DesignTime>True</DesignTime>
</Compile>
<None Include="app.manifest" />
<None Include="jsconfig1.json" />
<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>
<ItemGroup>
<Reference Include="BasicData">
<HintPath>..\..\dll_common\BasicData.dll</HintPath>
</Reference>
<Reference Include="BouncyCastle.Crypto">
<HintPath>..\..\dll_common\BouncyCastle.Crypto.dll</HintPath>
</Reference>
<Reference Include="ConLink, Version=7.0.1.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\dll_common\ConLink.dll</HintPath>
</Reference>
<Reference Include="ConLink19">
<HintPath>..\..\dll_common\ConLink19.dll</HintPath>
</Reference>
<Reference Include="DataLinkMesWork">
<HintPath>..\..\dll_common\DataLinkMesWork.dll</HintPath>
</Reference>
<Reference Include="ICSharpCode.SharpZipLib, Version=1.2.0.7, Culture=neutral, PublicKeyToken=1b03e6acf1164f73, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\dll_common\ICSharpCode.SharpZipLib.dll</HintPath>
</Reference>
<Reference Include="MesControl">
<HintPath>..\..\dll_common\MesControl.dll</HintPath>
</Reference>
<Reference Include="MesWork.DeviceDriver">
<HintPath>..\..\dll_common\MesWork.DeviceDriver.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.Owin, Version=4.2.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Owin.4.2.2\lib\net45\Microsoft.Owin.dll</HintPath>
</Reference>
<Reference Include="Monitor.MesWork">
<HintPath>..\..\dll_common\Monitor.MesWork.dll</HintPath>
</Reference>
<Reference Include="MQTTnet">
<HintPath>..\..\dll_common\MQTTnet.dll</HintPath>
</Reference>
<Reference Include="MQTTnet.Extensions.ManagedClient">
<HintPath>..\..\dll_common\MQTTnet.Extensions.ManagedClient.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json">
<HintPath>..\..\dll_common\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="NPOI, Version=2.4.1.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\dll_common\NPOI.dll</HintPath>
</Reference>
<Reference Include="NPOI.OOXML, Version=2.4.1.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\dll_common\NPOI.OOXML.dll</HintPath>
</Reference>
<Reference Include="NPOI.OpenXml4Net, Version=2.4.1.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\dll_common\NPOI.OpenXml4Net.dll</HintPath>
</Reference>
<Reference Include="NPOI.OpenXmlFormats, Version=2.4.1.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\dll_common\NPOI.OpenXmlFormats.dll</HintPath>
</Reference>
<Reference Include="Opc.Ua.Client">
<HintPath>..\..\dll_common\Opc.Ua.Client.dll</HintPath>
</Reference>
<Reference Include="Opc.Ua.Configuration">
<HintPath>..\..\dll_common\Opc.Ua.Configuration.dll</HintPath>
</Reference>
<Reference Include="Opc.Ua.Core">
<HintPath>..\..\dll_common\Opc.Ua.Core.dll</HintPath>
</Reference>
<Reference Include="OpcUaHelper">
<HintPath>..\..\dll_common\OpcUaHelper.dll</HintPath>
</Reference>
<Reference Include="Owin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f0ebd12fd5e55cc5, processorArchitecture=MSIL">
<HintPath>..\packages\Owin.1.0\lib\net40\Owin.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Data" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Data.Linq" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Net.Http.Formatting, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\dll_common\System.Net.Http.Formatting.dll</HintPath>
</Reference>
<Reference Include="System.Net.Security, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\dll_fun\System.Net.Security.dll</HintPath>
</Reference>
<Reference Include="System.Net.WebSockets, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\dll_fun\System.Net.WebSockets.dll</HintPath>
</Reference>
<Reference Include="System.Net.WebSockets.Client, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\dll_fun\System.Net.WebSockets.Client.dll</HintPath>
</Reference>
<Reference Include="System.Security.Cryptography.Algorithms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\dll_fun\System.Security.Cryptography.Algorithms.dll</HintPath>
</Reference>
<Reference Include="System.Security.Cryptography.Encoding, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\dll_fun\System.Security.Cryptography.Encoding.dll</HintPath>
</Reference>
<Reference Include="System.Security.Cryptography.Primitives, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\dll_fun\System.Security.Cryptography.Primitives.dll</HintPath>
</Reference>
<Reference Include="System.Security.Cryptography.X509Certificates, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\dll_fun\System.Security.Cryptography.X509Certificates.dll</HintPath>
</Reference>
<Reference Include="System.Web.Cors">
<HintPath>..\..\dll_common\System.Web.Cors.dll</HintPath>
</Reference>
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Web.Http">
<HintPath>..\..\dll_common\System.Web.Http.dll</HintPath>
</Reference>
<Reference Include="System.Web.Http.Cors">
<HintPath>..\..\dll_common\System.Web.Http.Cors.dll</HintPath>
</Reference>
<Reference Include="System.Web.Http.SelfHost">
<HintPath>..\..\dll_common\System.Web.Http.SelfHost.dll</HintPath>
</Reference>
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Common\09MesDataFunction\MesDataFunction\01-MesDataFunction.csproj">
<Project>{90e76fb4-646d-45e2-95db-0b8ab4e465d6}</Project>
<Name>01-MesDataFunction</Name>
</ProjectReference>
<ProjectReference Include="..\..\Common\MyLog4Net\00_MyLog4Net.csproj">
<Project>{1dc48c83-1842-4de8-acaf-26e1e7f7c58f}</Project>
<Name>00_MyLog4Net</Name>
</ProjectReference>
<ProjectReference Include="..\..\MisDataFunction\Function1051\Function1051.csproj">
<Project>{b5a0baa3-c1a7-4aab-9486-2e650adaca7e}</Project>
<Name>Function1051</Name>
</ProjectReference>
<ProjectReference Include="..\..\MisDataFunction\Function1052\Function1052.csproj">
<Project>{5fee5c91-8419-49ff-b2c2-47476f0b8c68}</Project>
<Name>Function1052</Name>
</ProjectReference>
<ProjectReference Include="..\..\MisDataFunction\Function1053\Function1053.csproj">
<Project>{ca8a12c5-7bf0-4489-93fa-180b1c492bba}</Project>
<Name>Function1053</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="Mes32X32.ico" />
<None Include="Resources\连接状态.png" />
<None Include="Resources\断开状态.png" />
</ItemGroup>
<ItemGroup>
<WCFMetadata Include="Connected Services\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@@ -0,0 +1,230 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>22, 12</value>
</metadata>
<metadata name="选择.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="工位号.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="OpCode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="OpName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="MesDll.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="PLC.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="PLC代码.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="timer_Status.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>267, 7</value>
</metadata>
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>137, 15</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>36</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAICAAAAEAIACoEAAAFgAAACgAAAAgAAAAQAAAAAEAIAAAAAAAABAAABMLAAATCwAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMgChADIAoQIyAKEgMgChczIA
occyAKHqMgChmTIAoTwyAKEJMgChAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMgChADIAoQQyAKEvMgChdzIA
odYyAKH7MgCh/zIAof8yAKH/MgCh6jIAoacyAKFJMgChEjIAoQAyAKEAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAyAKEAMgChADIAoQoyAKE+MgChkTIA
oeoyAKH+MgCh+TIAoe0yAKH+MgCh/zIAofwyAKH3MgCh/jIAofgyAKHBMgChZDIAoR4yAKEBMgChAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAyAKEAMgChATIAoRUyAKFcMgChujIA
ofEyAKH/MgCh9DIAobcyAKFPMgChfjIAof8yAKH/MgCh5TIAoVUyAKGLMgCh4jIAofwyAKH9MgCh2TIA
oYcyAKEoMgChBTIAoQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAyAKEAMgChAjIAoSYyAKF2MgCh0DIA
ofcyAKH+MgCh8zIAof8yAKGjMgChDTIAoQAyAKFpMgCh/zIAof8yAKHhMgChHjIAoQIyAKEiMg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AAAAMgChADIAoQIyAKElMgChXTIAobgyAKHbMgChxTIA
oYUyAKFbMgChqzIAodEyAKHLMgChhDIAoTsyAKELMgChAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAyAKEAMgChCzIA
oTcyAKGTMgCh0zIAofAyAKG2MgChWjIAoRcyAKEBMgChAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAA/+Af//+AB//8AAD/8AAAP8AIAA8AGDABARg+AQEYD4ERGAPxMZgAcTOY
ADEzmDAxM5g8MTKIPzEgCDDxIAgwMSB4MAEgeDgBJHg+ATxAD8E8AAHxOAAAMQAAAAEAAwABABwgAQBE
BAEBwAABAEAAA+AAAA/4AAB//wAD///gD/8=
</value>
</data>
</root>

View File

@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("MisDataSaveDate")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("大连迈思信息技术有限公司")]
[assembly: AssemblyProduct("MisDataSaveDate")]
[assembly: AssemblyCopyright("Copyright © 大连迈思信息技术有限公司 2022")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("9aede061-8490-436a-b38b-9495dc908f19")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -0,0 +1,83 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace MisDataFun.Properties {
using System;
/// <summary>
/// 一个强类型的资源类,用于查找本地化的字符串等。
/// </summary>
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.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 (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MisDataFun.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;
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap {
get {
object obj = ResourceManager.GetObject("断开状态", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap {
get {
object obj = ResourceManager.GetObject("连接状态", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
}
}

View File

@@ -0,0 +1,127 @@
<?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.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="断开状态" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\断开状态.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="连接状态" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\连接状态.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

View File

@@ -0,0 +1,26 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace MesServerMisDataFun.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.0.3.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;
}
}
}
}

View File

@@ -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>

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -0,0 +1,79 @@
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<!-- UAC 清单选项
如果想要更改 Windows 用户帐户控制级别,请使用
以下节点之一替换 requestedExecutionLevel 节点。
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
指定 requestedExecutionLevel 元素将禁用文件和注册表虚拟化。
如果你的应用程序需要此虚拟化来实现向后兼容性,则移除此
元素。
-->
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- 设计此应用程序与其一起工作且已针对此应用程序进行测试的
Windows 版本的列表。取消评论适当的元素,
Windows 将自动选择最兼容的环境。 -->
<!-- Windows Vista -->
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />-->
<!-- Windows 7 -->
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />-->
<!-- Windows 8 -->
<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />-->
<!-- Windows 8.1 -->
<!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />-->
<!-- Windows 10 -->
<!--<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />-->
</application>
</compatibility>
<!-- 指示该应用程序可感知 DPI 且 Windows 在 DPI 较高时将不会对其进行
自动缩放。Windows Presentation Foundation (WPF)应用程序自动感知 DPI无需
选择加入。选择加入此设置的 Windows 窗体应用程序(面向 .NET Framework 4.6)还应
在其 app.config 中将 "EnableWindowsFormsHighDpiAutoResizing" 设置设置为 "true"。
将应用程序设为感知长路径。请参阅 https://docs.microsoft.com/windows/win32/fileio/maximum-file-path-limitation -->
<!--
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
<longPathAware xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">true</longPathAware>
</windowsSettings>
</application>
-->
<!-- 启用 Windows 公共控件和对话框的主题(Windows XP 和更高版本) -->
<!--
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
-->
</assembly>

View File

@@ -0,0 +1,10 @@
{
"exclude": [
"**/bin",
"**/bower_components",
"**/jspm_packages",
"**/node_modules",
"**/obj",
"**/platforms"
]
}

View File

@@ -0,0 +1,113 @@
namespace MES_SIGNAL_CONF
{
partial class MES_CONF
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.btn_ConfigToSql = new System.Windows.Forms.Button();
this.label_ReadExcel = new System.Windows.Forms.Label();
this.label_WriteSql = new System.Windows.Forms.Label();
this.txt_Msg = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// btn_ConfigToSql
//
this.btn_ConfigToSql.Location = new System.Drawing.Point(487, 74);
this.btn_ConfigToSql.Name = "btn_ConfigToSql";
this.btn_ConfigToSql.Size = new System.Drawing.Size(161, 36);
this.btn_ConfigToSql.TabIndex = 0;
this.btn_ConfigToSql.Text = "重新将配置写入数据库";
this.btn_ConfigToSql.UseVisualStyleBackColor = true;
this.btn_ConfigToSql.Click += new System.EventHandler(this.btn_ConfigToSql_Click);
//
// label_ReadExcel
//
this.label_ReadExcel.AutoSize = true;
this.label_ReadExcel.Location = new System.Drawing.Point(12, 16);
this.label_ReadExcel.Name = "label_ReadExcel";
this.label_ReadExcel.Size = new System.Drawing.Size(95, 12);
this.label_ReadExcel.TabIndex = 1;
this.label_ReadExcel.Text = "label_ReadExcel";
//
// label_WriteSql
//
this.label_WriteSql.AutoSize = true;
this.label_WriteSql.Location = new System.Drawing.Point(12, 42);
this.label_WriteSql.Name = "label_WriteSql";
this.label_WriteSql.Size = new System.Drawing.Size(89, 12);
this.label_WriteSql.TabIndex = 1;
this.label_WriteSql.Text = "label_WriteSql";
//
// txt_Msg
//
this.txt_Msg.Location = new System.Drawing.Point(14, 116);
this.txt_Msg.Multiline = true;
this.txt_Msg.Name = "txt_Msg";
this.txt_Msg.Size = new System.Drawing.Size(634, 316);
this.txt_Msg.TabIndex = 2;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(12, 70);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(335, 36);
this.label1.TabIndex = 3;
this.label1.Text = "使用到数据库的表:\r\n读取MES_计划BOM_工位与名称[是否启用MES] = 1\r\n写入MES_基本变量_原始数据、MES_基本变量设备类型对应表";
this.label1.Click += new System.EventHandler(this.label1_Click);
//
// MES_CONF
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(660, 437);
this.Controls.Add(this.label1);
this.Controls.Add(this.txt_Msg);
this.Controls.Add(this.label_WriteSql);
this.Controls.Add(this.label_ReadExcel);
this.Controls.Add(this.btn_ConfigToSql);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Name = "MES_CONF";
this.ShowIcon = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "MES监控系统信号配置";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button btn_ConfigToSql;
private System.Windows.Forms.Label label_ReadExcel;
private System.Windows.Forms.Label label_WriteSql;
private System.Windows.Forms.TextBox txt_Msg;
private System.Windows.Forms.Label label1;
}
}

View File

@@ -0,0 +1,421 @@
using SlMesDbIterface;
using System;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Windows.Forms;
using static System.Configuration.ConfigurationManager;
namespace MES_SIGNAL_CONF
{
public partial class MES_CONF : Form
{
#region
public MES_CONF()
{
InitializeComponent();
InitializeLabels();
}
/// <summary>
/// 初始化界面标签
/// </summary>
private void InitializeLabels()
{
label_ReadExcel.Text = $"读取位置:{MisDataSaveDate.MesServerMisDataFun.BasicDataTableFile}";
label_WriteSql.Text = $"写入位置:{MisDataSaveDate.MesServerMisDataFun.ConnectionString_MES}";
}
#endregion
#region
/// <summary>
/// 配置导入到SQL按钮点击事件
/// </summary>
private void btn_ConfigToSql_Click(object sender, EventArgs e)
{
try
{
WriteLog("========== 开始导入配置 ==========");
LoadOpcData();
WriteLog("========== 导入配置完成 ==========");
}
catch (Exception ex)
{
WriteLog($"✗ 导入失败:{ex.Message}");
MessageBox.Show($"配置导入失败!\n{ex.Message}", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void label1_Click(object sender, EventArgs e)
{
// 预留事件
}
#endregion
#region
/// <summary>
/// 加载OPC数据并导入数据库
/// </summary>
private void LoadOpcData()
{
// 1. 加载基础数据
WriteLog("正在加载Excel数据...");
var excelData = LoadExcelData();
// 2. 生成标签数据
WriteLog("正在生成标签数据...");
DataTable dtTag = GenerateTagData(excelData);
excelData.DeviceTable.TableName = "MES_基本变量设备类型对应表";
// 3. 保存到数据库
WriteLog("正在保存到数据库...");
SaveToDatabase(dtTag, excelData.DeviceTable);
}
/// <summary>
/// 从Excel加载所有基础数据
/// </summary>
private ExcelDataModel LoadExcelData()
{
string excelFile = MisDataSaveDate.MesServerMisDataFun.BasicDataTableFile;
return new ExcelDataModel
{
StationTable = GetStationData(),
TagMesTable = LoadEnabledData(excelFile, "MES_基本变量原始数据"),
TagModelTable = LoadEnabledData(excelFile, "MES_信号表模板"),
//TagModelKwTable = LoadEnabledData(excelFile, "MES_信号表模板(库位)"),
DeviceTable = LoadEnabledData(excelFile, "设备类型对应表")
};
}
/// <summary>
/// 加载Excel启用数据
/// </summary>
private DataTable LoadEnabledData(string excelFile, string sheetName)
{
var rawData = NPOITest.ExeclHelper.ExcelToDataTable(excelFile, sheetName, true);
var enabledRows = rawData.Select($"是否启用='1'");
return enabledRows.Length > 0 ? enabledRows.CopyToDataTable() : rawData.Clone();
}
/// <summary>
/// 生成标签数据
/// </summary>
private DataTable GenerateTagData(ExcelDataModel excelData)
{
DataTable dtTag = excelData.TagModelTable.Clone();
// 分离库位工位和普通工位
var stationData = SplitStationByType(excelData.StationTable, "1");
//var stationKw = SplitStationByType(excelData.StationTable, "2");
// 处理普通工位
WriteLog($"处理普通工位数据,共 {stationData.Rows.Count} 个工位");
ProcessStations(stationData, excelData.TagModelTable, dtTag);
//// 处理库位工位
//WriteLog($"处理库位工位数据,共 {stationKw.Rows.Count} 个工位");
//ProcessStations(stationKw, excelData.TagModelKwTable, dtTag);
// 合并报警数据
MergeAlarmData(dtTag);
// 合并MES基本变量数据
dtTag.Merge(excelData.TagMesTable);
dtTag.TableName = "MES_基本变量_原始数据";
WriteLog($"标签数据生成完成,共 {dtTag.Rows.Count} 条记录");
return dtTag;
}
/// <summary>
/// 按线体类型分离工位数据
/// </summary>
private DataTable SplitStationByType(DataTable stationTable, string lineType)
{
string filter = $"线体类型 = '{lineType}'";
var rows = stationTable.Select(filter);
return rows.Length > 0 ? rows.CopyToDataTable() : stationTable.Clone();
}
/// <summary>
/// 处理工位数据
/// </summary>
private void ProcessStations(DataTable stations, DataTable tagModel, DataTable targetTag)
{
foreach (DataRow stationRow in stations.Rows)
{
var stationInfo = new StationInfo
{
= stationRow["工位代码"].ToString(),
= stationRow["工位号"].ToString(),
= stationRow["工位名称"].ToString(),
PLC = stationRow["PLC"].ToString(),
PLC代码 = stationRow["PLC代码"].ToString()
};
DataTable tagCopy = tagModel.Copy();
UpdateTagTableByStation(tagCopy, stationInfo);
targetTag.Merge(tagCopy);
}
}
/// <summary>
/// 根据工位信息更新标签表
/// </summary>
private void UpdateTagTableByStation(DataTable tagTable, StationInfo stationInfo)
{
foreach (DataRow row in tagTable.Rows)
{
// 更新TagID将****替换为工位代码补齐4位
string tagId = row["TagID"].ToString();
row["TagID"] = tagId.Replace("****", stationInfo..PadLeft(4, '0'));
// 更新工位相关信息
row["工位号"] = stationInfo.;
row["数据来源"] = stationInfo.;
row["IP"] = stationInfo.PLC;
row["DbName"] = stationInfo.PLC代码;
// 更新监控组
row["监控组"] = $"{row[""]}_{stationInfo.工位号}";
}
}
/// <summary>
/// 合并报警数据
/// </summary>
private void MergeAlarmData(DataTable targetTable)
{
try
{
GetAlarmTableData(out DataTable alarmTable);
if (alarmTable != null && alarmTable.Rows.Count > 0)
{
targetTable.Merge(alarmTable, false, MissingSchemaAction.Ignore);
WriteLog($"合并报警数据成功,共 {alarmTable.Rows.Count} 条记录");
}
}
catch (DataException ex)
{
WriteLog($"⚠ 合并报警数据失败:{ex.Message}");
throw;
}
}
#endregion
#region
/// <summary>
/// 使用事务安全保存数据到数据库
/// </summary>
private void SaveToDatabase(DataTable tagTable, DataTable deviceTable)
{
using (SqlConnection conn = new SqlConnection(MisDataSaveDate.MesServerMisDataFun.ConnectionString_MES))
{
conn.Open();
SqlTransaction transaction = conn.BeginTransaction();
try
{
// 1. 创建备份
var backupTables = CreateBackupTables(conn, transaction, tagTable.TableName, deviceTable.TableName);
// 2. 清空原表
ClearTables(conn, transaction, tagTable.TableName, deviceTable.TableName);
// 3. 批量插入新数据
BulkInsertData(conn, transaction, tagTable);
BulkInsertData(conn, transaction, deviceTable);
// 4. 提交事务
transaction.Commit();
WriteLog("✓ 所有操作成功完成,事务已提交");
// 5. 清理备份表
CleanupBackupTables(conn, backupTables);
}
catch (Exception ex)
{
transaction.Rollback();
WriteLog($"✗ 操作失败,事务已回滚:{ex.Message}");
throw;
}
}
}
/// <summary>
/// 创建备份表
/// </summary>
private string[] CreateBackupTables(SqlConnection conn, SqlTransaction transaction, params string[] tableNames)
{
string[] backupTables = new string[tableNames.Length];
for (int i = 0; i < tableNames.Length; i++)
{
backupTables[i] = $"{tableNames[i]}_Backup_{DateTime.Now:yyyyMMddHHmmss}";
ExecuteNonQuery(conn, transaction, $"SELECT * INTO [{backupTables[i]}] FROM [{tableNames[i]}]");
WriteLog($"已创建备份表:{backupTables[i]}");
}
return backupTables;
}
/// <summary>
/// 清空表数据
/// </summary>
private void ClearTables(SqlConnection conn, SqlTransaction transaction, params string[] tableNames)
{
foreach (var tableName in tableNames)
{
ExecuteNonQuery(conn, transaction, $"DELETE FROM [{tableName}]");
WriteLog($"清空数据库表:{tableName}");
}
}
/// <summary>
/// 批量插入数据
/// </summary>
private void BulkInsertData(SqlConnection conn, SqlTransaction transaction, DataTable dataTable)
{
using (SqlBulkCopy bulkCopy = new SqlBulkCopy(conn, SqlBulkCopyOptions.Default, transaction))
{
bulkCopy.DestinationTableName = dataTable.TableName;
bulkCopy.BatchSize = 1000;
bulkCopy.BulkCopyTimeout = 300;
bulkCopy.WriteToServer(dataTable);
WriteLog($"写入数据库表:{dataTable.TableName},共 {dataTable.Rows.Count} 条记录");
}
}
/// <summary>
/// 清理备份表
/// </summary>
private void CleanupBackupTables(SqlConnection conn, string[] backupTables)
{
try
{
foreach (var backupTable in backupTables)
{
ExecuteNonQuery(conn, null, $"DROP TABLE [{backupTable}]");
}
WriteLog("已清理备份表");
}
catch (Exception ex)
{
WriteLog($"⚠ 清理备份表时出错(不影响主流程):{ex.Message}");
}
}
/// <summary>
/// 执行SQL命令
/// </summary>
private void ExecuteNonQuery(SqlConnection conn, SqlTransaction transaction, string sql)
{
using (SqlCommand cmd = new SqlCommand(sql, conn, transaction))
{
cmd.ExecuteNonQuery();
}
}
#endregion
#region
/// <summary>
/// 获取工位数据
/// </summary>
private DataTable GetStationData()
{
string sql = @"
SELECT *
FROM [MES_计划BOM_工位与名称]
WHERE [是否启用MES] = 1
ORDER BY [工位号]";
SqlOperation.ExecuteSql(sql, out DataTable dt, out string error);
if (!string.IsNullOrEmpty(error))
{
WriteLog($"⚠ 查询工位数据出错:{error}");
}
return dt ?? new DataTable();
}
/// <summary>
/// 获取报警表数据
/// </summary>
private void GetAlarmTableData(out DataTable dt)
{
string sql = @"
SELECT *
FROM [MES_基本变量_原始数据]
WHERE [type] = 9
ORDER BY [TagID]";
SqlOperation.ExecuteSql(sql, out dt, out string error);
if (!string.IsNullOrEmpty(error))
{
WriteLog($"⚠ 查询报警数据出错:{error}");
}
}
#endregion
#region
/// <summary>
/// 写入日志
/// </summary>
public void WriteLog(string msg)
{
string timestamp = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
txt_Msg.Text += $"[{timestamp}] {msg}\r\n";
txt_Msg.SelectionStart = txt_Msg.Text.Length;
txt_Msg.ScrollToCaret();
}
#endregion
#region
/// <summary>
/// Excel数据模型
/// </summary>
private class ExcelDataModel
{
public DataTable StationTable { get; set; }
public DataTable TagMesTable { get; set; }
public DataTable TagModelTable { get; set; }
public DataTable TagModelKwTable { get; set; }
public DataTable DeviceTable { get; set; }
}
/// <summary>
/// 工位信息模型
/// </summary>
private class StationInfo
{
public string { get; set; }
public string { get; set; }
public string { get; set; }
public string PLC { get; set; }
public string PLC代码 { get; set; }
}
#endregion
}
}

View File

@@ -0,0 +1,120 @@
<?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>
</root>

View File

@@ -0,0 +1,68 @@
using System;
using System.Data;
using System.Data.SqlClient;
namespace SlMesDbIterface
{
public class SqlOperation
{
public static bool ExecuteStoredProcedure(string name, SqlParameter[] sqlParameters, out string errorMessage)
{
return DataLinkMesWork.SQLCommon.ExecuteStoredProcedure(name, MisDataSaveDate.MesServerMisDataFun.ConnectionString_MES, ref sqlParameters, out errorMessage);
}
public static bool ExecuteStoredProcedure(string name, SqlParameter[] sqlParameters, out DataTable dt, out string errorMessage)
{
return DataLinkMesWork.SQLCommon.ExecuteStoredProcedure(name, MisDataSaveDate.MesServerMisDataFun.ConnectionString_MES, ref sqlParameters, out dt, out errorMessage);
}
public static bool ExecuteStoredProcedure(string name, SqlParameter[] sqlParameters, out DataSet ds, out string errorMessage)
{
return DataLinkMesWork.SQLCommon.ExecuteStoredProcedure(name, MisDataSaveDate.MesServerMisDataFun.ConnectionString_MES, ref sqlParameters, out ds, out errorMessage);
}
public static bool ExecuteSql(string sql, out DataTable dt, out string errorMessage)
{
return DataLinkMesWork.SQLCommon.ExecuteSql(sql, MisDataSaveDate.MesServerMisDataFun.ConnectionString_MES, out dt, out errorMessage);
}
public static bool ExecuteSql(string sql, out DataSet ds, out string errorMessage)
{
return DataLinkMesWork.SQLCommon.ExecuteDataset(sql, MisDataSaveDate.MesServerMisDataFun.ConnectionString_MES, out ds, out errorMessage);
}
public static bool ExecuteSql(string sql, out string errorMessage)
{
return DataLinkMesWork.SQLCommon.ExecuteSql(sql, MisDataSaveDate.MesServerMisDataFun.ConnectionString_MES, out errorMessage);
}
/// <summary>
/// 通过SqlBulkCopy复制table数据到数据库
/// </summary>
/// <param name="dataset"></param>
public static bool SqlbulkcopyInsert(DataTable dt,out string ErrMsg)
{
bool success = false;
ErrMsg = "";
try
{
// SqlBulkCopy sqlbulkcopy = new SqlBulkCopy(connectString, SqlBulkCopyOptions.KeepIdentity);//删除自增ID插入原始数据
SqlBulkCopy sqlbulkcopy = new SqlBulkCopy(MisDataSaveDate.MesServerMisDataFun.ConnectionString_MES, SqlBulkCopyOptions.UseInternalTransaction);//批量事务处理
sqlbulkcopy.DestinationTableName = dt.TableName;//数据库中的表名
for (int i = 0; i < dt.Columns.Count; i++)
{
var columnName = dt.Columns[i].ColumnName.ToString();
sqlbulkcopy.ColumnMappings.Add(columnName, columnName);
}
sqlbulkcopy.WriteToServer(dt);
success = true;
}
catch (Exception err)
{
ErrMsg=err.Message;
}
return success;
}
}
}

View File

@@ -0,0 +1,386 @@
using DataLinkMesWork1;
using MesServerWork;
using MisDataFunDll;
using MyLog4Net;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Net.Sockets;
using System.Reflection.Emit;
using System.Web.Http;
namespace MisDataSaveDate
{
public class Analysis_MOM_Msg
{
/// <summary>
/// UUID生成
/// </summary>
/// <returns></returns>
public static string UuidUtil()
{
string result = Guid.NewGuid().ToString();
return result;
}
/// <summary>
/// 获取时间戳
/// </summary>
/// <returns></returns>
public static Int64 GetTimeStamp()
{
TimeSpan ts = DateTime.Now - new DateTime(1970, 1, 1, 0, 0, 0, 0);
return Convert.ToInt64(ts.TotalSeconds);
}
/// <summary>
/// 接收检测数据
/// </summary>
/// <param name="str"></param>
/// <returns></returns>
public static string OnlineCheckData(string url, [FromBody] JObject jobj)
{
var result = new msgResHeader();
result.MsgId = "";
result.Message = "";
result.Code = "200";
result.Data = "";
string errorMessage = "";
string parentID = "";
int AID = -1;
if (jobj == null)
{
result.Code = "500";
result.Message = "参数格式不正确!";
string retString1 = JsonConvert.SerializeObject(result);
MyLogHelper.Info("接收检测数据_res", retString1);
return retString1;
}
int isError = 0;
string str = jobj.ToString();
try
{
//存储日志
var CreateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
//Event_MOM_Log_Insert,@创建时间,@内容
var param = new SqlParameter[] {
new SqlParameter("@接口地址",url),
new SqlParameter("@接口类型",2), // 1. 主动调用接口 2. 被调用接口
new SqlParameter("@请求内容",str),
new SqlParameter("@请求时间",CreateTime)
};
DataLinkMesWork1.DataAccess.ExecuteStoredProcedure("接口_IOT接口交互日志_请求记录", ref param, out DataTable dt, out errorMessage);
// 解析订单内容,存储数据库,根据实际业务来写
OnlineCheckData onlineCheckData = JsonConvert.DeserializeObject<OnlineCheckData>(str);
if (onlineCheckData.MsgId == "")
{
throw new Exception("参数MsgId为空");
}
result.MsgId = onlineCheckData.MsgId;
if (onlineCheckData.OpCode == "")
{
throw new Exception("参数OpCode为空");
}
if (onlineCheckData.ProductionCode == "")
{
throw new Exception("参数ProductionCode为空");
}
string OpName = onlineCheckData.OpCode;
int Id_tagCF = 0;
SqlParameter[] param1 = new SqlParameter[6];
param1[0] = new SqlParameter("@EngineID", onlineCheckData.ProductionCode);
param1[1] = new SqlParameter("@工位号", OpName);
param1[2] = new SqlParameter("@操作者工号", onlineCheckData.CheckPerson);
param1[3] = new SqlParameter("@扫码时间", onlineCheckData.ScanTime);
param1[4] = new SqlParameter("@合格标志", onlineCheckData.QualityMark);
param1[5] = new SqlParameter("@Id_tagCF", Id_tagCF);
param1[5].Direction = ParameterDirection.Output;
DataAccess.ExecuteStoredProcedure("测量数据合格索引_增加_测试设备", ref param1, out errorMessage);
if (errorMessage != "")
{
throw new Exception(errorMessage);
}
Id_tagCF = Convert.ToInt32(param1[5].Value.ToString());
List<OnlineCheckData_CheckData> onlineCheckData_CheckDataList = onlineCheckData.CheckData;
for (int i = 0; i < onlineCheckData_CheckDataList.Count; i++)
{
OnlineCheckData_CheckData onlineCheckData_CheckData = onlineCheckData_CheckDataList[i];
var param2 = new SqlParameter[] {
new SqlParameter("@Id_tagCF", Id_tagCF),
new SqlParameter("@EngineID", onlineCheckData.ProductionCode),
new SqlParameter("@TagID",onlineCheckData_CheckData.CheckCode),
new SqlParameter("@TagValue",onlineCheckData_CheckData.CheckValue),
new SqlParameter("@IsGoodBad",onlineCheckData_CheckData.QualityMark),
new SqlParameter("@工位号",OpName),
new SqlParameter("@理论值",onlineCheckData_CheckData.StandardValue),
new SqlParameter("@上限值",onlineCheckData_CheckData.MaxValue),
new SqlParameter("@下限值",onlineCheckData_CheckData.MinValue),
new SqlParameter("@测量项目",onlineCheckData_CheckData.CheckName),
new SqlParameter("@测量单位",onlineCheckData_CheckData.Unit),
};
DataAccess.ExecuteStoredProcedure("测量数据合格_增加_测试设备", ref param2, out errorMessage);
if (errorMessage != "")
{
throw new Exception(errorMessage);
}
}
// 查询PLC是否传递机型保证工位有件可以写保存完成和工作完成
MIS_BASE.Read_EngineGetOver_PLC(OpName, out bool tagValue);
if (tagValue)
{
// 电芯段OP040流程比较特殊无PLC保存数据的流程可以直接写完成。
if (OpName == "OP040")
{
//通知PLCMES保存完成
MIS_BASE.Write_MesReadOver(OpName, true);
//通知PLCMES工作完成
MIS_BASE.Write_MesWorkFinish(OpName, true);
MisDataFunDll.MisDataFun.LogRecording_OP(OpName, "INFO", "MIS", "MES保存数据完成");
MisDataFunDll.MisDataFun.LogRecording_OP(OpName, "INFO", "MIS", "MES工作完成");
}
else
{
// 查看PLC是否完成流程如果完成的话流程结束否则的话要等PLC完成流程即允许保存
DataTable dt2 = MisDataFunDll.MisDataFun.CheckAllFinish(OpName, onlineCheckData.ProductionCode, 2);
string msg1 = "查询PLC流程出错";
if (dt2 != null && dt2.Rows.Count > 0)
{
string result1 = dt2.Rows[0]["result"].ToString();
msg1 = dt2.Rows[0]["msg"].ToString();
if (result1 == "1") //已完成
{
//通知PLCMES保存完成
MIS_BASE.Write_MesReadOver(OpName, true);
//通知PLCMES工作完成
MIS_BASE.Write_MesWorkFinish(OpName, true);
MisDataFunDll. MisDataFun.LogRecording_OP(OpName, "INFO", "MIS", msg1);
MisDataFunDll. MisDataFun.LogRecording_OP(OpName, "INFO", "MIS", "MES保存数据完成");
MisDataFunDll.MisDataFun.LogRecording_OP(OpName, "INFO", "MIS", "MES工作完成");
}
else
{
MisDataFunDll.MisDataFun.LogRecording_OP(OpName, "INFO", "MIS", msg1);
}
}
else
{
MisDataFunDll.MisDataFun.LogRecording_OP(OpName, "INFO", "MIS", msg1);
}
}
}
}
catch (Exception err)
{
result.Code = "500";
result.Message = err.Message;
MisDataFunDll.MisDataFun.LogRecording_OP("All", "ERROR", "MIS", err.Message);
}
string retString = JsonConvert.SerializeObject(result);
MyLogHelper.Info("接收检测数据_res", retString);
return retString;
}
/// <summary>
/// 接收查询检测次数
/// </summary>
/// <param name="str"></param>
/// <returns></returns>
public static string OnlineCheckDataCount(string url, [FromBody] JObject jobj)
{
var result = new msgResHeader2();
result.MsgId = "";
result.Message = "";
result.Code = "200";
result.Data = new checkCountData();
result.Data.CheckCountOk = 0;
result.Data.CheckCountNg = 0;
string errorMessage = "";
string parentID = "";
int AID = -1;
if (jobj == null)
{
result.Code = "500";
result.Message = "参数格式不正确!";
string retString1 = JsonConvert.SerializeObject(result);
MyLogHelper.Info("接收查询检测次数_res", retString1);
return retString1;
}
int isError = 0;
string str = jobj.ToString();
try
{
//存储日志
var CreateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
//Event_MOM_Log_Insert,@创建时间,@内容
var param = new SqlParameter[] {
new SqlParameter("@接口地址",url),
new SqlParameter("@接口类型",2), // 1. 主动调用接口 2. 被调用接口
new SqlParameter("@请求内容",str),
new SqlParameter("@请求时间",CreateTime)
};
DataLinkMesWork1.DataAccess.ExecuteStoredProcedure("接口_IOT接口交互日志_请求记录", ref param, out DataTable dt, out errorMessage);
// 解析订单内容,存储数据库,根据实际业务来写
OnlineCheckData onlineCheckData = JsonConvert.DeserializeObject<OnlineCheckData>(str);
if (onlineCheckData.MsgId == "")
{
throw new Exception("参数MsgId为空");
}
result.MsgId = onlineCheckData.MsgId;
if (onlineCheckData.OpCode == "")
{
throw new Exception("参数OpCode为空");
}
if (onlineCheckData.ProductionCode == "")
{
throw new Exception("参数ProductionCode为空");
}
SqlParameter[] param1 = new SqlParameter[2];
param1[0] = new SqlParameter("@EngineID", onlineCheckData.ProductionCode);
param1[1] = new SqlParameter("@工位号", onlineCheckData.OpCode);
DataLinkMesWork1.DataAccess.ExecuteStoredProcedure("CATL_测量数据合格_查询测试次数_测试设备", ref param1, out DataTable dt1, out errorMessage);
if (errorMessage != "")
{
throw new Exception(errorMessage);
}
if (dt1 != null && dt1.Rows.Count > 0)
{
result.Data.CheckCountOk = Convert.ToInt32(dt1.Rows[0]["OK"]);
result.Data.CheckCountNg = Convert.ToInt32(dt1.Rows[0]["NG"]);
}
}
catch (Exception err)
{
result.Code = "500";
result.Message = err.Message;
}
string retString = JsonConvert.SerializeObject(result);
MyLogHelper.Info("接收查询检测次数_res", retString);
return retString;
}
/// <summary>
/// 接收打印任务
/// </summary>
/// <param name="str"></param>
/// <returns></returns>
public static string ReceivePrintTask(string url, [FromBody] JObject jobj)
{
var result = new msgResHeader();
result.MsgId = "";
result.Message = "";
result.Code = "200";
result.Data = "";
string errorMessage = "";
string parentID = "";
int AID = -1;
if (jobj == null)
{
result.Code = "500";
result.Message = "参数格式不正确!";
string retString1 = JsonConvert.SerializeObject(result);
MyLogHelper.Info("接收打印任务_res", retString1);
return retString1;
}
string str = jobj.ToString();
try
{
//存储日志
var CreateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
//Event_MOM_Log_Insert,@创建时间,@内容
var param = new SqlParameter[] {
new SqlParameter("@接口地址",url),
new SqlParameter("@接口类型",2), // 1. 主动调用接口 2. 被调用接口
new SqlParameter("@请求内容",str),
new SqlParameter("@请求时间",CreateTime)
};
DataLinkMesWork1.DataAccess.ExecuteStoredProcedure("接口_IOT接口交互日志_请求记录", ref param, out DataTable dt, out errorMessage);
// 解析订单内容,存储数据库,根据实际业务来写
PrintTaskData printTaskData = JsonConvert.DeserializeObject<PrintTaskData>(str);
if (printTaskData.printTemplete == "")
{
throw new Exception("参数printTemplete为空");
}
if (printTaskData.productCode == "")
{
throw new Exception("参数productCode为空");
}
if (printTaskData.printDate == "")
{
throw new Exception("参数printDate为空");
}
string msg = $"MARK|{printTaskData.printTemplete}|{printTaskData.productCode},{printTaskData.printDate}";
// 连接打印机
Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
try
{
//socket.Connect(MesWorkForm.MarkingMachine_Ip, int.Parse(MesWorkForm.MarkingMachine_Port));
}
catch (Exception err)
{
throw new Exception("连接打印机失败:" + err.Message);
}
// 发送数据
try
{
if (socket.Connected)
{
byte[] decBytes = System.Text.Encoding.UTF8.GetBytes(msg);
//socket.Send(decBytes);
socket.Send(decBytes, 0, decBytes.Length, SocketFlags.None);
}
else
{
throw new Exception("连接打印机失败");
}
}
catch (Exception err)
{
throw new Exception("发送打印数据失败:" + err.Message);
}
// 关闭
try
{
if (socket.Connected)
{
socket.Shutdown(SocketShutdown.Both);
socket.Close(100);
}
}
catch (Exception ex)
{
}
}
catch (Exception err)
{
result.Code = "500";
result.Message = err.Message;
}
string retString = JsonConvert.SerializeObject(result);
MyLogHelper.Info("接收打印任务_res", retString);
return retString;
}
}
}

View File

@@ -0,0 +1,54 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Web;
using System.Web.Http;
using System.Collections.Concurrent;
using Newtonsoft.Json.Linq;
using System.Runtime.Remoting.Messaging;
namespace MisDataSaveDate
{
public class IpcController : ApiController
{
readonly string headUrl = "Project/";
[HttpPost]
[Route("OnlineCheckData")]
public HttpResponseMessage ReceiveMomPlanData([FromBody] JObject jobj)
{
return new HttpResponseMessage
{
Content = new StringContent(Analysis_MOM_Msg.OnlineCheckData(headUrl + System.Reflection.MethodBase.GetCurrentMethod().Name, jobj), Encoding.GetEncoding("UTF-8"), "application/json")
};
}
[HttpPost]
[Route("OnlineCheckDataCount")]
public HttpResponseMessage OnlineCheckDataCount([FromBody] JObject jobj)
{
return new HttpResponseMessage
{
Content = new StringContent(Analysis_MOM_Msg.OnlineCheckDataCount(headUrl + System.Reflection.MethodBase.GetCurrentMethod().Name, jobj), Encoding.GetEncoding("UTF-8"), "application/json")
};
}
[HttpPost]
[Route("ReceivePrintTask")]
public HttpResponseMessage ReceivePrintTask([FromBody] JObject jobj)
{
return new HttpResponseMessage
{
Content = new StringContent(Analysis_MOM_Msg.ReceivePrintTask(headUrl + System.Reflection.MethodBase.GetCurrentMethod().Name, jobj), Encoding.GetEncoding("UTF-8"), "application/json")
};
}
}
}

View File

@@ -0,0 +1,66 @@
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Formatting;
using System.Net.Http.Headers;
using System.Web.Http;
using System.Web.Http.Cors;
using System.Web.Http.SelfHost;
namespace MisDataSaveDate
{
public class InitServer
{
HttpSelfHostConfiguration config = null;
HttpSelfHostServer server = null;
public InitServer(string Url_WebApi)
{
// var Url_WebApi = System.Configuration.ConfigurationManager.AppSettings["Url_WebApi"];
Init(Url_WebApi);
}
public void Init(string url)
{
config = new HttpSelfHostConfiguration(url);
// 启用跨域
config.EnableCors(new EnableCorsAttribute("*", "*", "*"));
// 启用特性路由
config.MapHttpAttributeRoutes();
//config.Routes.MapHttpRoute(
// name: "DefaultApi",
// routeTemplate: "api/{controller}/{id}",
// defaults: new { id = RouteParameter.Optional }
//);
// 自定义路由匹配到action
config.Routes.MapHttpRoute(
name: "API Default",
routeTemplate: "api/{controller}/{action}/{id}",
defaults: new { id = RouteParameter.Optional }
);
server = new HttpSelfHostServer(config);
server.OpenAsync().Wait();
}
public class JsonContentNegotiator : IContentNegotiator
{
private readonly JsonMediaTypeFormatter _jsonFormatter;
public JsonContentNegotiator(JsonMediaTypeFormatter formatter)
{
_jsonFormatter = formatter;
}
public ContentNegotiationResult Negotiate(Type type, HttpRequestMessage request, IEnumerable<MediaTypeFormatter> formatters)
{
var result = new ContentNegotiationResult(_jsonFormatter, new MediaTypeHeaderValue("application/json"));
return result;
}
}
}
}

View File

@@ -0,0 +1,98 @@
using System.Collections.Generic;
namespace MisDataSaveDate
{
/// <summary>
/// OnlineCheckData
/// </summary>
public class OnlineCheckData
{
/// <summary>
/// MsgId
/// </summary>
public string MsgId { get; set; } = "";
/// <summary>
/// OpCode
/// </summary>
public string OpCode { get; set; } = "";
/// <summary>
/// ProductionCode
/// </summary>
public string ProductionCode { get; set; } = "";
/// <summary>
/// CheckTime
/// </summary>
public string ScanTime { get; set; } = "";
/// <summary>
/// CheckPerson
/// </summary>
public string CheckPerson { get; set; } = "";
/// <summary>
/// QualityMark
/// </summary>
public int QualityMark { get; set; } = 1;
public List<OnlineCheckData_CheckData> CheckData { get; set; } = new List<OnlineCheckData_CheckData>();
}
public class OnlineCheckData_CheckData
{
/// <summary>
/// CheckCode
/// </summary>
public string CheckCode { get; set; } = "";
/// <summary>
/// CheckName
/// </summary>
public string CheckName { get; set; } = "";
/// <summary>
/// ProductionCode
/// </summary>
public string Unit { get; set; }
/// <summary>
/// StandardValue
/// </summary>
public string StandardValue { get; set; } = "";
/// <summary>
/// MinValue
/// </summary>
public string MinValue { get; set; } = "";
/// <summary>
/// MaxValue
/// </summary>
public string MaxValue { get; set; } = "";
/// <summary>
/// CheckValue
/// </summary>
public string CheckValue { get; set; } = "";
/// <summary>
/// QualityMark
/// </summary>
public int QualityMark { get; set; } = 1;
}
public class PrintTaskData
{
/// string msg = $"MARK|{printTemplete}|{productCode},{printDate}";
/// <summary>
/// printTemplete
/// </summary>
public string printTemplete { get; set; } = "";
/// <summary>
/// productCode
/// </summary>
public string productCode { get; set; } = "";
/// <summary>
/// printDate
/// </summary>
public string printDate { get; set; } = "";
}
}

View File

@@ -0,0 +1,100 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MisDataSaveDate
{
public class msgResHeader
{
/// <summary>
/// 任务ID
/// </summary>
public string MsgId
{
get;
set;
}
/// <summary>
/// 返回结果
/// </summary>
public string Code
{
get;
set;
}
/// <summary>
/// 返回消息
/// </summary>
public string Message
{
get;
set;
}
/// <summary>
/// 返回数据
/// </summary>
public string Data
{
get;
set;
}
}
public class msgResHeader2
{
/// <summary>
/// 任务ID
/// </summary>
public string MsgId
{
get;
set;
}
/// <summary>
/// 返回结果
/// </summary>
public string Code
{
get;
set;
}
/// <summary>
/// 返回消息
/// </summary>
public string Message
{
get;
set;
}
/// <summary>
/// 返回数据
/// </summary>
public checkCountData Data
{
get;
set;
}
}
public class checkCountData
{
/// <summary>
/// 检测次数
/// </summary>
public int CheckCountOk
{
get;
set;
}
/// <summary>
/// 检测次数
/// </summary>
public int CheckCountNg
{
get;
set;
}
}
}