Korrektren für Maersk Dateiname, WAS Reihenfolge und Verbesseung der SFT Logausgaben
This commit is contained in:
parent
3dac392452
commit
8cca412079
@ -9,6 +9,7 @@
|
||||
|
||||
using log4net;
|
||||
using System.Diagnostics;
|
||||
using bsmd.database;
|
||||
|
||||
namespace bsmd.dakosy
|
||||
{
|
||||
@ -55,7 +56,8 @@ namespace bsmd.dakosy
|
||||
string output = winscp.StandardOutput.ReadToEnd();
|
||||
_log.Debug(output);
|
||||
output = winscp.StandardError.ReadToEnd();
|
||||
_log.Warn(output);
|
||||
if (!output.Trim().IsNullOrEmpty())
|
||||
_log.Warn(output);
|
||||
|
||||
// Wait until WinSCP finishes
|
||||
winscp.WaitForExit();
|
||||
@ -128,7 +130,8 @@ namespace bsmd.dakosy
|
||||
string output = winscp.StandardOutput.ReadToEnd();
|
||||
_log.Debug(output);
|
||||
output = winscp.StandardError.ReadToEnd();
|
||||
_log.Warn(output);
|
||||
if(!output.Trim().IsNullOrEmpty())
|
||||
_log.Warn(output);
|
||||
|
||||
// Wait until WinSCP finishes
|
||||
winscp.WaitForExit();
|
||||
@ -167,7 +170,8 @@ namespace bsmd.dakosy
|
||||
string output = winscp.StandardOutput.ReadToEnd();
|
||||
_log.Debug(output);
|
||||
output = winscp.StandardError.ReadToEnd();
|
||||
_log.Warn(output);
|
||||
if (!output.Trim().IsNullOrEmpty())
|
||||
_log.Warn(output);
|
||||
|
||||
// Wait until WinSCP finishes
|
||||
winscp.WaitForExit();
|
||||
|
||||
@ -301,12 +301,12 @@ namespace bsmd.dbh
|
||||
rootSEC.KielCanalPassage.KielCanalPassagePlanned = "Y";
|
||||
if (sec.KielCanalPassagePlannedIncomming.HasValue)
|
||||
{
|
||||
rootSEC.KielCanalPassage.KielCanalPassagePlannedIncoming = sec.KielCanalPassagePlannedIncomming.Value;
|
||||
rootSEC.KielCanalPassage.KielCanalPassagePlannedIncoming = sec.KielCanalPassagePlannedIncomming.Value.ToUTCSerializableDateTime();
|
||||
rootSEC.KielCanalPassage.KielCanalPassagePlannedIncomingSpecified = true;
|
||||
}
|
||||
if (sec.KielCanalPassagePlannedOutgoing.HasValue)
|
||||
{
|
||||
rootSEC.KielCanalPassage.KielCanalPassagePlannedOutgoing = sec.KielCanalPassagePlannedOutgoing.Value;
|
||||
rootSEC.KielCanalPassage.KielCanalPassagePlannedOutgoing = sec.KielCanalPassagePlannedOutgoing.Value.ToUTCSerializableDateTime();
|
||||
rootSEC.KielCanalPassage.KielCanalPassagePlannedOutgoingSpecified = true;
|
||||
}
|
||||
}
|
||||
@ -966,8 +966,8 @@ namespace bsmd.dbh
|
||||
List<ItemsChoiceType3> choiceType3s = new List<ItemsChoiceType3>();
|
||||
List<object> wasteItems = new List<object>();
|
||||
|
||||
choiceType3s.Add(ItemsChoiceType3.ConfirmationOfCorrectnessAndSufficiency);
|
||||
wasteItems.Add(was.ConfirmationOfCorrectness ?? false ? "Y" : "N");
|
||||
choiceType3s.Add(ItemsChoiceType3.LastWasteDisposalPort);
|
||||
wasteItems.Add(was.LastWasteDisposalPort);
|
||||
|
||||
if (was.LastWasteDisposalDate.HasValue)
|
||||
{
|
||||
@ -975,12 +975,6 @@ namespace bsmd.dbh
|
||||
wasteItems.Add(was.LastWasteDisposalDate);
|
||||
}
|
||||
|
||||
choiceType3s.Add(ItemsChoiceType3.LastWasteDisposalPort);
|
||||
wasteItems.Add(was.LastWasteDisposalPort);
|
||||
|
||||
choiceType3s.Add(ItemsChoiceType3.NextWasteDisposalPort);
|
||||
wasteItems.Add(was.NextWasteDisposalPort);
|
||||
|
||||
for (int i = 0; i < was.WasteDisposalServiceProvider.Count; i++)
|
||||
{
|
||||
if ((was.WasteDisposalServiceProvider[i]).WasteDisposalServiceProviderName.Trim().IsNullOrEmpty()) continue;
|
||||
@ -988,6 +982,9 @@ namespace bsmd.dbh
|
||||
wasteItems.Add((was.WasteDisposalServiceProvider[i]).WasteDisposalServiceProviderName);
|
||||
}
|
||||
|
||||
choiceType3s.Add(ItemsChoiceType3.NextWasteDisposalPort);
|
||||
wasteItems.Add(was.NextWasteDisposalPort);
|
||||
|
||||
for (int j = 0; j < was.Waste.Count; j++)
|
||||
{
|
||||
choiceType3s.Add(ItemsChoiceType3.WasteItem);
|
||||
@ -1007,6 +1004,9 @@ namespace bsmd.dbh
|
||||
wasteItems.Add(rww);
|
||||
}
|
||||
|
||||
choiceType3s.Add(ItemsChoiceType3.ConfirmationOfCorrectnessAndSufficiency);
|
||||
wasteItems.Add(was.ConfirmationOfCorrectness ?? false ? "Y" : "N");
|
||||
|
||||
rootWAS.ItemsElementName = choiceType3s.ToArray();
|
||||
rootWAS.Items = wasteItems.ToArray();
|
||||
}
|
||||
@ -1689,7 +1689,7 @@ namespace bsmd.dbh
|
||||
// serialize output structure to file
|
||||
|
||||
string filename = string.Format("NSW.DBH.BSMD.{0}.xml", message.FileSequenceNumber);
|
||||
_log.InfoFormat("saving {0} to output directory", filename);
|
||||
_log.InfoFormat("{0}: saving {1} to output directory", message.MessageNotificationClassDisplay, filename);
|
||||
|
||||
string filePath = Path.Combine(Path.GetTempPath(), filename);
|
||||
XmlSerializer serializer = new XmlSerializer(typeof(Root));
|
||||
|
||||
@ -17,7 +17,7 @@ namespace bsmd.dbh
|
||||
internal static class ResponseUtil
|
||||
{
|
||||
private static readonly ILog _log = LogManager.GetLogger(typeof(ResponseUtil));
|
||||
private static readonly Regex _regexFilename = new Regex(@".*NSW\.DBH\.BSMD\.(.*)\.xml");
|
||||
private static readonly Regex _regexFilename = new Regex(@".*NSW\.DBH\.BSMD(MAERSK)?\.(.*)\.xml");
|
||||
|
||||
internal static bool Read(string inputFile)
|
||||
{
|
||||
@ -30,7 +30,7 @@ namespace bsmd.dbh
|
||||
|
||||
Match m = _regexFilename.Match(inputFile);
|
||||
if(!m.Success) {
|
||||
_log.WarnFormat("returned file doesn't follow naming convention NSW.DBH.BSMD.*:{0}", inputFile);
|
||||
_log.WarnFormat("returned file doesn't follow naming convention NSW.DBH.BSMD(MAERSK)?.*:{0}", inputFile);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user