Update to new HIS-Nord Transmitter Tool (still experimental), upgraded log4net refs etc.
This commit is contained in:
parent
7967b4336d
commit
259fe00f43
@ -274,14 +274,15 @@ namespace SendNSWMessageService
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// external processing for HIS-Nord
|
// HIS-Nord --------------------------------------------------
|
||||||
if (bsmd.hisnord.transmitter.Transmit())
|
|
||||||
|
if (bsmd.hisnord.transmitter.Transmit()) // run process (transmit+receive)
|
||||||
{
|
{
|
||||||
bsmd.hisnord.Request.ReadResponseFiles();
|
|
||||||
bsmd.hisnord.Response.ReadAnswers();
|
bsmd.hisnord.Response.ReadAnswers();
|
||||||
}
|
}
|
||||||
|
|
||||||
// external processing for dbh
|
// dbh -------------------------------------------------------
|
||||||
|
|
||||||
bsmd.dbh.MessageController.SendAndReceive();
|
bsmd.dbh.MessageController.SendAndReceive();
|
||||||
|
|
||||||
foreach (MessageCore core in DBManager.Instance.GetMessageCoresWithNSWStatusFlag())
|
foreach (MessageCore core in DBManager.Instance.GetMessageCoresWithNSWStatusFlag())
|
||||||
|
|||||||
@ -40,8 +40,8 @@
|
|||||||
<AssemblyOriginatorKeyFile>..\bsmdKey.snk</AssemblyOriginatorKeyFile>
|
<AssemblyOriginatorKeyFile>..\bsmdKey.snk</AssemblyOriginatorKeyFile>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="log4net, Version=2.0.16.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
|
<Reference Include="log4net, Version=2.0.17.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\log4net.2.0.16\lib\net45\log4net.dll</HintPath>
|
<HintPath>..\packages\log4net.2.0.17\lib\net45\log4net.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Configuration" />
|
<Reference Include="System.Configuration" />
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
<package id="log4net" version="2.0.16" targetFramework="net48" />
|
<package id="log4net" version="2.0.17" targetFramework="net48" />
|
||||||
</packages>
|
</packages>
|
||||||
@ -40,8 +40,8 @@
|
|||||||
<AssemblyOriginatorKeyFile>..\bsmdKey.snk</AssemblyOriginatorKeyFile>
|
<AssemblyOriginatorKeyFile>..\bsmdKey.snk</AssemblyOriginatorKeyFile>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="log4net, Version=2.0.16.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
|
<Reference Include="log4net, Version=2.0.17.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\log4net.2.0.16\lib\net45\log4net.dll</HintPath>
|
<HintPath>..\packages\log4net.2.0.17\lib\net45\log4net.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Configuration" />
|
<Reference Include="System.Configuration" />
|
||||||
@ -52,8 +52,8 @@
|
|||||||
<Reference Include="Microsoft.CSharp" />
|
<Reference Include="Microsoft.CSharp" />
|
||||||
<Reference Include="System.Data" />
|
<Reference Include="System.Data" />
|
||||||
<Reference Include="System.Xml" />
|
<Reference Include="System.Xml" />
|
||||||
<Reference Include="WinSCPnet, Version=1.15.0.14890, Culture=neutral, PublicKeyToken=2271ec4a3c56d0bf, processorArchitecture=MSIL">
|
<Reference Include="WinSCPnet, Version=1.15.0.14955, Culture=neutral, PublicKeyToken=2271ec4a3c56d0bf, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\WinSCP.6.3.2\lib\net40\WinSCPnet.dll</HintPath>
|
<HintPath>..\packages\WinSCP.6.3.4\lib\net40\WinSCPnet.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
@ -93,12 +93,12 @@
|
|||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<Import Project="..\packages\WinSCP.6.3.2\build\WinSCP.targets" Condition="Exists('..\packages\WinSCP.6.3.2\build\WinSCP.targets')" />
|
<Import Project="..\packages\WinSCP.6.3.4\build\WinSCP.targets" Condition="Exists('..\packages\WinSCP.6.3.4\build\WinSCP.targets')" />
|
||||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Error Condition="!Exists('..\packages\WinSCP.6.3.2\build\WinSCP.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\WinSCP.6.3.2\build\WinSCP.targets'))" />
|
<Error Condition="!Exists('..\packages\WinSCP.6.3.4\build\WinSCP.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\WinSCP.6.3.4\build\WinSCP.targets'))" />
|
||||||
</Target>
|
</Target>
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
<!-- 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.
|
Other similar extension points exist, see Microsoft.Common.targets.
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
<package id="log4net" version="2.0.16" targetFramework="net48" />
|
<package id="log4net" version="2.0.17" targetFramework="net48" />
|
||||||
<package id="WinSCP" version="6.3.2" targetFramework="net48" />
|
<package id="WinSCP" version="6.3.4" targetFramework="net48" />
|
||||||
</packages>
|
</packages>
|
||||||
@ -25,6 +25,7 @@
|
|||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||||
<CodeAnalysisRuleSet>..\code.ruleset</CodeAnalysisRuleSet>
|
<CodeAnalysisRuleSet>..\code.ruleset</CodeAnalysisRuleSet>
|
||||||
|
<UseWinFormsOutOfProcDesigner>False</UseWinFormsOutOfProcDesigner>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
<DebugType>pdbonly</DebugType>
|
<DebugType>pdbonly</DebugType>
|
||||||
@ -33,6 +34,7 @@
|
|||||||
<DefineConstants>TRACE</DefineConstants>
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
|
<UseWinFormsOutOfProcDesigner>False</UseWinFormsOutOfProcDesigner>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<SignAssembly>true</SignAssembly>
|
<SignAssembly>true</SignAssembly>
|
||||||
@ -50,6 +52,7 @@
|
|||||||
<LangVersion>7.3</LangVersion>
|
<LangVersion>7.3</LangVersion>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<CodeAnalysisRuleSet>..\code.ruleset</CodeAnalysisRuleSet>
|
<CodeAnalysisRuleSet>..\code.ruleset</CodeAnalysisRuleSet>
|
||||||
|
<UseWinFormsOutOfProcDesigner>False</UseWinFormsOutOfProcDesigner>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||||
<DebugSymbols>true</DebugSymbols>
|
<DebugSymbols>true</DebugSymbols>
|
||||||
@ -61,6 +64,7 @@
|
|||||||
<LangVersion>7.3</LangVersion>
|
<LangVersion>7.3</LangVersion>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<CodeAnalysisRuleSet>..\code.ruleset</CodeAnalysisRuleSet>
|
<CodeAnalysisRuleSet>..\code.ruleset</CodeAnalysisRuleSet>
|
||||||
|
<UseWinFormsOutOfProcDesigner>False</UseWinFormsOutOfProcDesigner>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||||
<OutputPath>bin\x64\Release\</OutputPath>
|
<OutputPath>bin\x64\Release\</OutputPath>
|
||||||
@ -70,6 +74,7 @@
|
|||||||
<PlatformTarget>x64</PlatformTarget>
|
<PlatformTarget>x64</PlatformTarget>
|
||||||
<LangVersion>7.3</LangVersion>
|
<LangVersion>7.3</LangVersion>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<UseWinFormsOutOfProcDesigner>False</UseWinFormsOutOfProcDesigner>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug 64|x64'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug 64|x64'">
|
||||||
<DebugSymbols>true</DebugSymbols>
|
<DebugSymbols>true</DebugSymbols>
|
||||||
@ -81,10 +86,11 @@
|
|||||||
<LangVersion>7.3</LangVersion>
|
<LangVersion>7.3</LangVersion>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<CodeAnalysisRuleSet>..\code.ruleset</CodeAnalysisRuleSet>
|
<CodeAnalysisRuleSet>..\code.ruleset</CodeAnalysisRuleSet>
|
||||||
|
<UseWinFormsOutOfProcDesigner>False</UseWinFormsOutOfProcDesigner>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="log4net, Version=2.0.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
|
<Reference Include="log4net, Version=2.0.17.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
|
||||||
<HintPath>..\ENI2\packages\log4net.2.0.15\lib\net45\log4net.dll</HintPath>
|
<HintPath>..\packages\log4net.2.0.17\lib\net45\log4net.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||||
<HintPath>..\ENI2\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
<HintPath>..\ENI2\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
<package id="log4net" version="2.0.15" targetFramework="net48" />
|
<package id="log4net" version="2.0.17" targetFramework="net48" />
|
||||||
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net48" />
|
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net48" />
|
||||||
</packages>
|
</packages>
|
||||||
@ -38,8 +38,8 @@
|
|||||||
<AssemblyOriginatorKeyFile>..\bsmdKey.snk</AssemblyOriginatorKeyFile>
|
<AssemblyOriginatorKeyFile>..\bsmdKey.snk</AssemblyOriginatorKeyFile>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="log4net, Version=2.0.16.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
|
<Reference Include="log4net, Version=2.0.17.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\log4net.2.0.16\lib\net45\log4net.dll</HintPath>
|
<HintPath>..\packages\log4net.2.0.17\lib\net45\log4net.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Configuration" />
|
<Reference Include="System.Configuration" />
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
<package id="log4net" version="2.0.16" targetFramework="net48" />
|
<package id="log4net" version="2.0.17" targetFramework="net48" />
|
||||||
</packages>
|
</packages>
|
||||||
20
bsmd.hisnord/Properties/Settings.Designer.cs
generated
20
bsmd.hisnord/Properties/Settings.Designer.cs
generated
@ -12,7 +12,7 @@ namespace bsmd.hisnord.Properties {
|
|||||||
|
|
||||||
|
|
||||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.10.0.0")]
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.10.0.0")]
|
||||||
public sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
public sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||||
|
|
||||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||||
@ -50,15 +50,6 @@ namespace bsmd.hisnord.Properties {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[global::System.Configuration.ApplicationScopedSettingAttribute()]
|
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("Transmitter-Tool\\RESULTS")]
|
|
||||||
public string ResultDir {
|
|
||||||
get {
|
|
||||||
return ((string)(this["ResultDir"]));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[global::System.Configuration.ApplicationScopedSettingAttribute()]
|
[global::System.Configuration.ApplicationScopedSettingAttribute()]
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("Transmitter-Tool\\ANSWERS")]
|
[global::System.Configuration.DefaultSettingValueAttribute("Transmitter-Tool\\ANSWERS")]
|
||||||
@ -94,5 +85,14 @@ namespace bsmd.hisnord.Properties {
|
|||||||
return ((string)(this["TransmitterRoot"]));
|
return ((string)(this["TransmitterRoot"]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[global::System.Configuration.ApplicationScopedSettingAttribute()]
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.Configuration.DefaultSettingValueAttribute("Transmitter-Tool\\archive")]
|
||||||
|
public string OutputArchiveDir {
|
||||||
|
get {
|
||||||
|
return ((string)(this["OutputArchiveDir"]));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,9 +11,6 @@
|
|||||||
<Setting Name="Transmitter" Type="System.String" Scope="Application">
|
<Setting Name="Transmitter" Type="System.String" Scope="Application">
|
||||||
<Value Profile="(Default)">Transmitter-Tool\client.bat</Value>
|
<Value Profile="(Default)">Transmitter-Tool\client.bat</Value>
|
||||||
</Setting>
|
</Setting>
|
||||||
<Setting Name="ResultDir" Type="System.String" Scope="Application">
|
|
||||||
<Value Profile="(Default)">Transmitter-Tool\RESULTS</Value>
|
|
||||||
</Setting>
|
|
||||||
<Setting Name="AnswerDir" Type="System.String" Scope="Application">
|
<Setting Name="AnswerDir" Type="System.String" Scope="Application">
|
||||||
<Value Profile="(Default)">Transmitter-Tool\ANSWERS</Value>
|
<Value Profile="(Default)">Transmitter-Tool\ANSWERS</Value>
|
||||||
</Setting>
|
</Setting>
|
||||||
@ -26,5 +23,8 @@
|
|||||||
<Setting Name="TransmitterRoot" Type="System.String" Scope="Application">
|
<Setting Name="TransmitterRoot" Type="System.String" Scope="Application">
|
||||||
<Value Profile="(Default)">E:\svnlager\BSMD\nsw\HIS-NORD\</Value>
|
<Value Profile="(Default)">E:\svnlager\BSMD\nsw\HIS-NORD\</Value>
|
||||||
</Setting>
|
</Setting>
|
||||||
|
<Setting Name="OutputArchiveDir" Type="System.String" Scope="Application">
|
||||||
|
<Value Profile="(Default)">Transmitter-Tool\archive</Value>
|
||||||
|
</Setting>
|
||||||
</Settings>
|
</Settings>
|
||||||
</SettingsFile>
|
</SettingsFile>
|
||||||
@ -10,7 +10,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Xml;
|
|
||||||
using System.Xml.Serialization;
|
using System.Xml.Serialization;
|
||||||
using log4net;
|
using log4net;
|
||||||
using bsmd.database;
|
using bsmd.database;
|
||||||
@ -21,7 +20,7 @@ namespace bsmd.hisnord
|
|||||||
{
|
{
|
||||||
private static readonly ILog _log = LogManager.GetLogger(typeof(Request));
|
private static readonly ILog _log = LogManager.GetLogger(typeof(Request));
|
||||||
private static Dictionary<Guid, ReportingParty> _reportingPartyDict = null;
|
private static Dictionary<Guid, ReportingParty> _reportingPartyDict = null;
|
||||||
private static readonly Dictionary<MessageCore, Dictionary<Message, string>> coreFilenameDict = new Dictionary<MessageCore, Dictionary<Message,string>>();
|
// private static readonly Dictionary<MessageCore, Dictionary<Message, string>> coreFilenameDict = new Dictionary<MessageCore, Dictionary<Message,string>>();
|
||||||
|
|
||||||
internal static Dictionary<Guid, ReportingParty> ReportingPartyDict
|
internal static Dictionary<Guid, ReportingParty> ReportingPartyDict
|
||||||
{
|
{
|
||||||
@ -31,6 +30,8 @@ namespace bsmd.hisnord
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
public static void ReadResponseFiles()
|
public static void ReadResponseFiles()
|
||||||
{
|
{
|
||||||
foreach (MessageCore core in coreFilenameDict.Keys)
|
foreach (MessageCore core in coreFilenameDict.Keys)
|
||||||
@ -72,10 +73,11 @@ namespace bsmd.hisnord
|
|||||||
{
|
{
|
||||||
coreFilenameDict[core].Remove(removeMessage);
|
coreFilenameDict[core].Remove(removeMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
#region Create message file to send
|
#region Create message file to send
|
||||||
|
|
||||||
public static bool? CreateSendFile(MessageCore core, Message message)
|
public static bool? CreateSendFile(MessageCore core, Message message)
|
||||||
@ -1813,12 +1815,7 @@ namespace bsmd.hisnord
|
|||||||
using (TextWriter tw = new StreamWriter(filePath))
|
using (TextWriter tw = new StreamWriter(filePath))
|
||||||
{
|
{
|
||||||
serializer.Serialize(tw, _nsw);
|
serializer.Serialize(tw, _nsw);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!coreFilenameDict.ContainsKey(core))
|
|
||||||
coreFilenameDict[core] = new Dictionary<Message, string>();
|
|
||||||
if(message != null)
|
|
||||||
coreFilenameDict[core][message] = filename;
|
|
||||||
|
|
||||||
retval = true;
|
retval = true;
|
||||||
|
|
||||||
|
|||||||
@ -16,9 +16,6 @@
|
|||||||
<setting name="Transmitter" serializeAs="String">
|
<setting name="Transmitter" serializeAs="String">
|
||||||
<value>Transmitter-Tool\client.bat</value>
|
<value>Transmitter-Tool\client.bat</value>
|
||||||
</setting>
|
</setting>
|
||||||
<setting name="ResultDir" serializeAs="String">
|
|
||||||
<value>Transmitter-Tool\RESULTS</value>
|
|
||||||
</setting>
|
|
||||||
<setting name="AnswerDir" serializeAs="String">
|
<setting name="AnswerDir" serializeAs="String">
|
||||||
<value>Transmitter-Tool\ANSWERS</value>
|
<value>Transmitter-Tool\ANSWERS</value>
|
||||||
</setting>
|
</setting>
|
||||||
@ -31,6 +28,9 @@
|
|||||||
<setting name="TransmitterRoot" serializeAs="String">
|
<setting name="TransmitterRoot" serializeAs="String">
|
||||||
<value>E:\svnlager\BSMD\nsw\HIS-NORD\</value>
|
<value>E:\svnlager\BSMD\nsw\HIS-NORD\</value>
|
||||||
</setting>
|
</setting>
|
||||||
|
<setting name="OutputArchiveDir" serializeAs="String">
|
||||||
|
<value>Transmitter-Tool\archive</value>
|
||||||
|
</setting>
|
||||||
</bsmd.hisnord.Properties.Settings>
|
</bsmd.hisnord.Properties.Settings>
|
||||||
</applicationSettings>
|
</applicationSettings>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
|||||||
@ -38,8 +38,8 @@
|
|||||||
<AssemblyOriginatorKeyFile>..\bsmdKey.snk</AssemblyOriginatorKeyFile>
|
<AssemblyOriginatorKeyFile>..\bsmdKey.snk</AssemblyOriginatorKeyFile>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="log4net, Version=2.0.16.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
|
<Reference Include="log4net, Version=2.0.17.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\log4net.2.0.16\lib\net45\log4net.dll</HintPath>
|
<HintPath>..\packages\log4net.2.0.17\lib\net45\log4net.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Configuration" />
|
<Reference Include="System.Configuration" />
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
<package id="log4net" version="2.0.16" targetFramework="net48" />
|
<package id="log4net" version="2.0.17" targetFramework="net48" />
|
||||||
</packages>
|
</packages>
|
||||||
@ -10,8 +10,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Xml.Serialization;
|
|
||||||
using bsmd.database;
|
using bsmd.database;
|
||||||
using log4net;
|
using log4net;
|
||||||
|
|
||||||
@ -32,53 +30,59 @@ namespace bsmd.hisnord
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
ProcessStartInfo startInfo = new ProcessStartInfo(Path.Combine(rootDir, Properties.Settings.Default.Transmitter));
|
try
|
||||||
startInfo.WorkingDirectory = rootDir;
|
{
|
||||||
startInfo.RedirectStandardError = true;
|
|
||||||
startInfo.RedirectStandardOutput = true;
|
|
||||||
startInfo.RedirectStandardInput = false;
|
|
||||||
startInfo.UseShellExecute = false;
|
|
||||||
// der Transmitter schickt alles was im Ausgabe-Verzeichnis ist
|
|
||||||
// damit das gut geht schicken wir die Nachrichten einzeln und arbeiten jeweils das
|
|
||||||
// Ergebnis ab
|
|
||||||
|
|
||||||
using (Process transmitterProcess = new Process())
|
ProcessStartInfo startInfo = new ProcessStartInfo(Path.Combine(rootDir, Properties.Settings.Default.Transmitter));
|
||||||
{
|
startInfo.WorkingDirectory = rootDir;
|
||||||
transmitterProcess.Exited += TransmitterProcess_Exited;
|
startInfo.RedirectStandardError = true;
|
||||||
|
startInfo.RedirectStandardOutput = true;
|
||||||
|
startInfo.RedirectStandardInput = false;
|
||||||
|
startInfo.UseShellExecute = false;
|
||||||
|
|
||||||
transmitterProcess.ErrorDataReceived += TransmitterProcess_ErrorDataReceived;
|
using (Process transmitterProcess = new Process())
|
||||||
transmitterProcess.OutputDataReceived += TransmitterProcess_OutputDataReceived;
|
|
||||||
|
|
||||||
transmitterProcess.StartInfo = startInfo;
|
|
||||||
transmitterProcess.EnableRaisingEvents = true;
|
|
||||||
transmitterProcess.Start();
|
|
||||||
|
|
||||||
transmitterProcess.BeginErrorReadLine();
|
|
||||||
transmitterProcess.BeginOutputReadLine();
|
|
||||||
|
|
||||||
processId = transmitterProcess.Id;
|
|
||||||
|
|
||||||
// _log.DebugFormat("started {0}", transmitterProcess.ProcessName);
|
|
||||||
int timeout = Properties.Settings.Default.BatchTimeoutMins * 1000 * 60; // convert to ms
|
|
||||||
|
|
||||||
_log.DebugFormat($"starting transmitter, process ID: {processId}, timeout {timeout} ms.");
|
|
||||||
|
|
||||||
if (!transmitterProcess.WaitForExit((timeout == 0) ? int.MaxValue : timeout))
|
|
||||||
{
|
{
|
||||||
_log.Warn($"Transmitter {processId} not exited within {timeout} ms");
|
transmitterProcess.Exited += TransmitterProcess_Exited;
|
||||||
try
|
|
||||||
|
transmitterProcess.ErrorDataReceived += TransmitterProcess_ErrorDataReceived;
|
||||||
|
transmitterProcess.OutputDataReceived += TransmitterProcess_OutputDataReceived;
|
||||||
|
|
||||||
|
transmitterProcess.StartInfo = startInfo;
|
||||||
|
transmitterProcess.EnableRaisingEvents = true;
|
||||||
|
transmitterProcess.Start();
|
||||||
|
|
||||||
|
transmitterProcess.BeginErrorReadLine();
|
||||||
|
transmitterProcess.BeginOutputReadLine();
|
||||||
|
|
||||||
|
processId = transmitterProcess.Id;
|
||||||
|
|
||||||
|
// _log.DebugFormat("started {0}", transmitterProcess.ProcessName);
|
||||||
|
int timeout = Properties.Settings.Default.BatchTimeoutMins * 1000 * 60; // convert to ms
|
||||||
|
|
||||||
|
_log.DebugFormat($"starting transmitter, process ID: {processId}, timeout {timeout} ms.");
|
||||||
|
|
||||||
|
if (!transmitterProcess.WaitForExit((timeout == 0) ? int.MaxValue : timeout))
|
||||||
{
|
{
|
||||||
transmitterProcess.Kill();
|
_log.Warn($"Transmitter {processId} not exited within {timeout} ms");
|
||||||
_log.Warn($"Transmitter {processId} killed");
|
try
|
||||||
processId = null;
|
{
|
||||||
}
|
transmitterProcess.Kill();
|
||||||
catch (Exception e)
|
_log.Warn($"Transmitter {processId} killed");
|
||||||
{
|
processId = null;
|
||||||
_log.Warn($"Killing Transmitter {processId} failed: {e.Message}");
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
_log.Warn($"Killing Transmitter {processId} failed: {e.Message}");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
_log.Error($"Transmitter failed: {ex.Message}");
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void TransmitterProcess_OutputDataReceived(object sender, DataReceivedEventArgs e)
|
private static void TransmitterProcess_OutputDataReceived(object sender, DataReceivedEventArgs e)
|
||||||
@ -89,8 +93,9 @@ namespace bsmd.hisnord
|
|||||||
|
|
||||||
private static void TransmitterProcess_ErrorDataReceived(object sender, DataReceivedEventArgs e)
|
private static void TransmitterProcess_ErrorDataReceived(object sender, DataReceivedEventArgs e)
|
||||||
{
|
{
|
||||||
|
// Output of STDERR. HIS-Nord seems to be using this for logging, so we do not flag as error.
|
||||||
if(!e.Data.IsNullOrEmpty())
|
if(!e.Data.IsNullOrEmpty())
|
||||||
_log.Error(e.Data);
|
_log.Debug(e.Data);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void TransmitterProcess_Exited(object sender, EventArgs e)
|
private static void TransmitterProcess_Exited(object sender, EventArgs e)
|
||||||
@ -99,20 +104,11 @@ namespace bsmd.hisnord
|
|||||||
processId = null;
|
processId = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static result GetResult(string filenameFullPath)
|
|
||||||
{
|
|
||||||
// now we should read the response message...
|
|
||||||
string resultFilename = string.Format("{0}.result.xml", Path.GetFileName(filenameFullPath));
|
|
||||||
string resultDir = Path.Combine(Properties.Settings.Default.TransmitterRoot, Properties.Settings.Default.ResultDir);
|
|
||||||
string resultFullPath = Path.Combine(resultDir, resultFilename);
|
|
||||||
return result.ReadResult(resultFullPath);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void PurgeOldFiles(int maxAgeDays)
|
public static void PurgeOldFiles(int maxAgeDays)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// "ANSWERS_DONE"
|
// "import_done" (= successfully received)
|
||||||
DirectoryInfo info = new DirectoryInfo(Path.Combine(Properties.Settings.Default.TransmitterRoot, Properties.Settings.Default.AnswerArchiveDir));
|
DirectoryInfo info = new DirectoryInfo(Path.Combine(Properties.Settings.Default.TransmitterRoot, Properties.Settings.Default.AnswerArchiveDir));
|
||||||
FileInfo[] files = info.GetFiles();
|
FileInfo[] files = info.GetFiles();
|
||||||
int cnt = 0;
|
int cnt = 0;
|
||||||
@ -127,9 +123,9 @@ namespace bsmd.hisnord
|
|||||||
}
|
}
|
||||||
_log.Info($"deleted {cnt} files from {Properties.Settings.Default.AnswerArchiveDir}");
|
_log.Info($"deleted {cnt} files from {Properties.Settings.Default.AnswerArchiveDir}");
|
||||||
|
|
||||||
// "RESULTS"
|
// "archive" (= successfully sent)
|
||||||
cnt = 0;
|
cnt = 0;
|
||||||
info = new DirectoryInfo(Path.Combine(Properties.Settings.Default.TransmitterRoot, Properties.Settings.Default.ResultDir));
|
info = new DirectoryInfo(Path.Combine(Properties.Settings.Default.TransmitterRoot, Properties.Settings.Default.OutputArchiveDir));
|
||||||
files = info.GetFiles();
|
files = info.GetFiles();
|
||||||
foreach (FileInfo file in files)
|
foreach (FileInfo file in files)
|
||||||
{
|
{
|
||||||
@ -140,67 +136,13 @@ namespace bsmd.hisnord
|
|||||||
cnt++;
|
cnt++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_log.Info($"deleted {cnt} files from {Properties.Settings.Default.ResultDir}");
|
_log.Info($"deleted {cnt} files from {Properties.Settings.Default.OutputArchiveDir}");
|
||||||
|
|
||||||
// "READY"
|
|
||||||
cnt = 0;
|
|
||||||
info = new DirectoryInfo(Path.Combine(Properties.Settings.Default.TransmitterRoot, "READY"));
|
|
||||||
files = info.GetFiles();
|
|
||||||
foreach (FileInfo file in files)
|
|
||||||
{
|
|
||||||
if (file.CreationTime < DateTime.Now.AddDays(-maxAgeDays))
|
|
||||||
{
|
|
||||||
_log.Debug($"deleting {file.Name}");
|
|
||||||
file.Delete();
|
|
||||||
cnt++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
_log.Info($"deleted {cnt} files from READY");
|
|
||||||
}
|
}
|
||||||
catch(Exception ex)
|
catch(Exception ex)
|
||||||
{
|
{
|
||||||
_log.ErrorFormat("Error trying to delete old files: {0}", ex.Message);
|
_log.ErrorFormat("Error trying to delete old files: {0}", ex.Message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// class to read transmitter result xml files
|
|
||||||
/// </summary>
|
|
||||||
[Serializable]
|
|
||||||
public class result
|
|
||||||
{
|
|
||||||
public result() { }
|
|
||||||
public int code { get; set; }
|
|
||||||
public string message { get; set; }
|
|
||||||
public string detail { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// create result items from file
|
|
||||||
/// </summary>
|
|
||||||
public static result ReadResult(string filename)
|
|
||||||
{
|
|
||||||
result aResult = null;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
XmlSerializer serializer = new XmlSerializer(typeof(result));
|
|
||||||
if (!File.Exists(filename))
|
|
||||||
{
|
|
||||||
_log.WarnFormat("Expected file {0} does not exist!", filename);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
using (FileStream fs = new FileStream(filename, FileMode.Open))
|
|
||||||
{
|
|
||||||
aResult = (result)serializer.Deserialize(fs);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
_log.ErrorFormat("Exception deserializing transmitter result: {0}", ex.Message);
|
|
||||||
}
|
|
||||||
return aResult;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -38,8 +38,8 @@
|
|||||||
<AssemblyOriginatorKeyFile>..\bsmdKey.snk</AssemblyOriginatorKeyFile>
|
<AssemblyOriginatorKeyFile>..\bsmdKey.snk</AssemblyOriginatorKeyFile>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="log4net, Version=2.0.16.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
|
<Reference Include="log4net, Version=2.0.17.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\log4net.2.0.16\lib\net45\log4net.dll</HintPath>
|
<HintPath>..\packages\log4net.2.0.17\lib\net45\log4net.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Configuration" />
|
<Reference Include="System.Configuration" />
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
<package id="log4net" version="2.0.16" targetFramework="net48" />
|
<package id="log4net" version="2.0.17" targetFramework="net48" />
|
||||||
</packages>
|
</packages>
|
||||||
Loading…
Reference in New Issue
Block a user