This commit is contained in:
Daniel Schick 2015-08-12 06:14:59 +00:00
parent d6662eb43a
commit 8204f19121
19 changed files with 1266 additions and 835 deletions

Binary file not shown.

View File

@ -0,0 +1 @@
"C:\Program Files\Java\jre1.8.0_51\bin\java" -jar DD-ImportClient.jar -log=client.log -cfg=client.conf

View File

@ -21,3 +21,4 @@ CORDIR = CORRUPT
VERSION = NSW_V1-0 VERSION = NSW_V1-0
MODE = ONCE MODE = ONCE
XMLRESULTDIR = RESULTS\ XMLRESULTDIR = RESULTS\
ANSWERDIR = ANSWERS\

View File

@ -0,0 +1,55 @@
-----------------------------
25.07.2015 12:26:38 Client started
-----------------------------
25.07.2015 12:26:38 No files to send
-----------------------------
25.07.2015 02:59:17 Client started
-----------------------------
25.07.2015 02:59:18 FileName: IMP\20150725145813-df8bb348-81ee-4803-85af-fff6641a810c.xml
25.07.2015 02:59:18 FileSize: 11525
-----------------------------
25.07.2015 02:59:21 20150725145813-df8bb348-81ee-4803-85af-fff6641a810c.xml(11,25 kB) - XML file doesnt fit Schema
25.07.2015 02:59:21 XML Document has Error:truecvc-type.3.1.3: The value '0' of element 'TowageBeam_MTR' is not valid.
-----------------------------
25.07.2015 03:12:21 Client started
-----------------------------
25.07.2015 03:12:22 FileName: IMP\20150725151154-df8bb348-81ee-4803-85af-fff6641a810c.xml
25.07.2015 03:12:22 FileSize: 12369
-----------------------------
25.07.2015 03:12:23 20150725151154-df8bb348-81ee-4803-85af-fff6641a810c.xml(12,08 kB) - XML file doesnt fit Schema
25.07.2015 03:12:23 XML Document has Error:truecvc-complex-type.2.4.a: Invalid content was found starting with element 'PortOfItineryETA'. One of '{PortOfItineryName}' is expected.
-----------------------------
25.07.2015 03:15:22 Client started
-----------------------------
25.07.2015 03:15:24 FileName: IMP\20150725151517-df8bb348-81ee-4803-85af-fff6641a810c.xml
25.07.2015 03:15:24 FileSize: 12428
-----------------------------
25.07.2015 03:15:24 20150725151517-df8bb348-81ee-4803-85af-fff6641a810c.xml(12,14 kB) - XML file doesnt fit Schema
25.07.2015 03:15:24 XML Document has Error:truecvc-complex-type.4: Attribute 'Index' must appear on element 'PortOfItinery'.
-----------------------------
25.07.2015 03:29:38 Client started
-----------------------------
25.07.2015 03:29:40 FileName: IMP\20150725152924-df8bb348-81ee-4803-85af-fff6641a810c.xml
25.07.2015 03:29:40 FileSize: 12438
-----------------------------
25.07.2015 03:29:40 20150725152924-df8bb348-81ee-4803-85af-fff6641a810c.xml(12,15 kB) - XML file doesnt fit Schema
25.07.2015 03:29:40 XML Document has Error:truecvc-complex-type.2.4.a: Invalid content was found starting with element 'ConfirmationOfCorrectness'. One of '{Wastes}' is expected.
-----------------------------
29.07.2015 21:50:35 Client started
-----------------------------
29.07.2015 21:50:37 FileName: IMP\20150729214822-df8bb348-81ee-4803-85af-fff6641a810c.xml
29.07.2015 21:50:37 FileSize: 12538(12,24 kB)
-----------------------------
29.07.2015 21:50:39 Getting Answers
29.07.2015 21:50:39 20150729214822-df8bb348-81ee-4803-85af-fff6641a810c.xml(12538) - XML file doesnt fit Schema
29.07.2015 21:50:39 XML Document has Error:truecvc-complex-type.2.4.a: Invalid content was found starting with element 'ConfirmationOfCorrectness'. One of '{Wastes}' is expected.
29.07.2015 21:50:39 Filename: DEWVN-2015-ZGGPEQ_VISIT.xml
29.07.2015 21:50:39 Filesize: 149(149 B)
29.07.2015 21:50:39 PACKETSIZE: 500
29.07.2015 21:50:39 Tiles: 1
29.07.2015 21:50:39 Getting Answers
29.07.2015 21:50:40 Filename: DEWVN-2015-XTGWNE_VISIT.xml
29.07.2015 21:50:40 Filesize: 148(148 B)
29.07.2015 21:50:40 PACKETSIZE: 500
29.07.2015 21:50:40 Tiles: 1
29.07.2015 21:50:40 No more Answers

View File

@ -60,6 +60,8 @@ namespace SendNSWMessageService
else this.processRunning = true; else this.processRunning = true;
} }
bool sendSucceeded;
if (DBManager.Instance.Connect(Properties.Settings.Default.ConnectionString)) if (DBManager.Instance.Connect(Properties.Settings.Default.ConnectionString))
{ {
@ -69,9 +71,21 @@ namespace SendNSWMessageService
foreach (MessageCore core in coresMarkedForSending) foreach (MessageCore core in coresMarkedForSending)
{ {
List<Message> messages = DBManager.Instance.GetMessagesForCore(core); List<Message> messages = DBManager.Instance.GetMessagesForCore(core);
if (core.InitialHIS == Message.NSWProvider.DUDR)
{
// Rostocker: wir senden alle Nachrichten auf einmal
sendSucceeded = bsmd.hisnord.Request.Send(messages);
if (!sendSucceeded) core.BSMDStatusInternal = MessageCore.BSMDStatus.FAILURE;
else core.BSMDStatusInternal = MessageCore.BSMDStatus.SENT;
DBManager.Instance.Save(core);
}
else
{
List<Message> toSendMessageList = new List<Message>(); List<Message> toSendMessageList = new List<Message>();
if ((core.IsTransit && core.TransitId.IsNullOrEmpty()) || if ((core.IsTransit && core.TransitId.IsNullOrEmpty()) ||
@ -79,10 +93,10 @@ namespace SendNSWMessageService
{ {
foreach (Message message in messages) foreach (Message message in messages)
{ {
if((message.MessageNotificationClass == Message.NotificationClass.VISIT) || if ((message.MessageNotificationClass == Message.NotificationClass.VISIT) ||
(message.MessageNotificationClass == Message.NotificationClass.TRANSIT)) (message.MessageNotificationClass == Message.NotificationClass.TRANSIT))
{ {
if((message.InternalStatus == Message.BSMDStatus.UNDEFINED) || if ((message.InternalStatus == Message.BSMDStatus.UNDEFINED) ||
(message.InternalStatus == Message.BSMDStatus.PREPARE) || (message.InternalStatus == Message.BSMDStatus.PREPARE) ||
(message.InternalStatus == Message.BSMDStatus.TOSEND)) (message.InternalStatus == Message.BSMDStatus.TOSEND))
{ {
@ -119,8 +133,7 @@ namespace SendNSWMessageService
_log.InfoFormat("Sending {0} message to {1}", _log.InfoFormat("Sending {0} message to {1}",
message.MessageNotificationClass.ToString(), message.HIS.ToString()); message.MessageNotificationClass.ToString(), message.HIS.ToString());
bool sendSucceeded = false; sendSucceeded = false;
// switch über passendes HIS / Schnittstelle // switch über passendes HIS / Schnittstelle
switch (message.HIS) switch (message.HIS)
@ -136,11 +149,6 @@ namespace SendNSWMessageService
if (!sendSucceeded) message.InternalStatus = Message.BSMDStatus.SEND_FAILED; if (!sendSucceeded) message.InternalStatus = Message.BSMDStatus.SEND_FAILED;
break; break;
case Message.NSWProvider.DUDR:
sendSucceeded = bsmd.hisnord.Request.Send(message);
if (!sendSucceeded) message.InternalStatus = Message.BSMDStatus.SEND_FAILED;
break;
default: default:
_log.WarnFormat("Initial HIS not specified for message {0}", message.Id); _log.WarnFormat("Initial HIS not specified for message {0}", message.Id);
break; break;
@ -170,6 +178,7 @@ namespace SendNSWMessageService
} }
} }
} }
}
DBManager.Instance.Disconnect(); DBManager.Instance.Disconnect();

View File

@ -27,7 +27,7 @@ namespace bsmd.ReportGenerator
#region create document #region create document
public static Document CreateDocument(string title, string subject, string author, public static Document CreateDocument(string title, string subject, string author,
Dictionary<string, string> coverInfos) Dictionary<string, string> coverInfos, bool isUpdate)
{ {
// Create a new MigraDoc document // Create a new MigraDoc document
Document document = new Document(); Document document = new Document();
@ -37,7 +37,7 @@ namespace bsmd.ReportGenerator
BSMDDocument.DefineStyles(document); BSMDDocument.DefineStyles(document);
BSMDDocument.DefineCover(document, coverInfos); BSMDDocument.DefineCover(document, coverInfos, isUpdate);
BSMDDocument.DefineContentSection(document, Orientation.Portrait, true); BSMDDocument.DefineContentSection(document, Orientation.Portrait, true);
//TableOfContents.DefineTableOfContents(document); //TableOfContents.DefineTableOfContents(document);
@ -137,7 +137,7 @@ namespace bsmd.ReportGenerator
/// <summary> /// <summary>
/// Defines the cover page. /// Defines the cover page.
/// </summary> /// </summary>
public static void DefineCover(Document document, Dictionary<string, string> coverInfos) public static void DefineCover(Document document, Dictionary<string, string> coverInfos, bool isUpdate)
{ {
Section section = document.AddSection(); Section section = document.AddSection();
@ -147,7 +147,11 @@ namespace bsmd.ReportGenerator
Image image = section.AddImage(Properties.Settings.Default.LogoPath); Image image = section.AddImage(Properties.Settings.Default.LogoPath);
image.Width = "3cm"; image.Width = "3cm";
if (isUpdate)
section.AddParagraph("EU-NOAD data UPDATE");
else
paragraph = section.AddParagraph("EU-NOAD incoming data receipt"); paragraph = section.AddParagraph("EU-NOAD incoming data receipt");
paragraph.Format.Font.Size = 16; paragraph.Format.Font.Size = 16;
paragraph.Format.Font.Color = Colors.DarkRed; paragraph.Format.Font.Color = Colors.DarkRed;
paragraph.Format.SpaceBefore = Unit.FromCentimeter(4); paragraph.Format.SpaceBefore = Unit.FromCentimeter(4);

View File

@ -60,12 +60,53 @@ namespace bsmd.ReportGenerator
{ {
// load all messages with report flag set // load all messages with report flag set
List<MessageCore> reportCores = DBManager.Instance.GetMessageCoresByReportStatus(MessageCore.ReportStatusEnum.COMPLETE); List<MessageCore> reportCores = DBManager.Instance.GetMessageCoresByReportStatus(MessageCore.ReportStatusEnum.COMPLETE);
reportCores.AddRange(DBManager.Instance.GetMessageCoresByReportStatus(MessageCore.ReportStatusEnum.HE_REPORTTYPE));
reportCores.AddRange(DBManager.Instance.GetMessageCoresByReportStatus(MessageCore.ReportStatusEnum.HE_REVISION));
// create report documents for each of the messages // create report documents for each of the messages
foreach (MessageCore reportCore in reportCores) foreach (MessageCore reportCore in reportCores)
{
this.CreateReport(reportCore);
}
DBManager.Instance.Disconnect();
}
catch (Exception ex)
{
_log.ErrorFormat("Exception occurred: {0}", ex.ToString());
}
}
else
{
this.EventLog.WriteEntry("ReportService stopped: DB connection failed", EventLogEntryType.Error);
this.Stop();
}
lock (this._timerlock)
{
this.processRunning = false;
}
}
protected override void OnStop()
{
_log.Info("Report Service stopping.");
}
internal void DoOnce()
{
this._timer_Elapsed(null, null);
}
#region create and send report
private void CreateReport(MessageCore reportCore)
{ {
List<Message> messages = DBManager.Instance.GetMessagesForCore(reportCore); List<Message> messages = DBManager.Instance.GetMessagesForCore(reportCore);
Dictionary<string, string> coverInfos = new Dictionary<string, string>(); Dictionary<string, string> coverInfos = new Dictionary<string, string>();
bool isReportUpdate = reportCore.ReportStatus != MessageCore.ReportStatusEnum.COMPLETE;
coverInfos.Add("Type", reportCore.HerbergReportType);
// Schiffsname aus der STAT meldung fischen // Schiffsname aus der STAT meldung fischen
foreach (Message msg in messages) foreach (Message msg in messages)
{ {
@ -100,12 +141,13 @@ namespace bsmd.ReportGenerator
coverInfos.Add("E-Mail", reportCore.Customer.Email); coverInfos.Add("E-Mail", reportCore.Customer.Email);
} }
// create document and print header area (with message core data)
Document migraDocument = BSMDDocument.CreateDocument( Document migraDocument = BSMDDocument.CreateDocument(
string.Format("NSW Eingangsdatenübersicht für IMO {0}, ETA {1}", reportCore.IMO, reportCore.ETA), string.Format("NSW Eingangsdatenübersicht für IMO {0}, ETA {1}", reportCore.IMO, reportCore.ETA),
"NSW Meldung", "NSW Meldung",
Properties.Settings.Default.ReportAuthor, coverInfos); Properties.Settings.Default.ReportAuthor,
coverInfos,
// print header area (with message core data) isReportUpdate);
// print messages in subsequent tables // print messages in subsequent tables
foreach (Message message in messages) foreach (Message message in messages)
@ -118,7 +160,9 @@ namespace bsmd.ReportGenerator
reportCore.Id); reportCore.Id);
BSMDDocument.RenderDocument(migraDocument, fullPath); BSMDDocument.RenderDocument(migraDocument, fullPath);
_log.InfoFormat("Document created for MessageCoreId {0}, IMO {1}", reportCore.Id, reportCore.IMO); _log.InfoFormat("Document created for MessageCoreId {0}, IMO {1}", reportCore.Id, reportCore.IMO);
string subject = string.Format("NSW message report for {0}", reportCore.IMO); string subject = string.Format("NEW EU-NOAD message IMO {0}", reportCore.IMO);
if(isReportUpdate)
subject = string.Format("UPDATE EU-NOAD message IMO {0}", reportCore.IMO);
List<string> attachments = new List<string>(); List<string> attachments = new List<string>();
attachments.Add(fullPath); attachments.Add(fullPath);
@ -149,34 +193,7 @@ namespace bsmd.ReportGenerator
if (crewCSV != null) File.Delete(crewCSV); if (crewCSV != null) File.Delete(crewCSV);
} }
DBManager.Instance.Disconnect(); #endregion
} }
catch (Exception ex)
{
_log.ErrorFormat("Exception occurred: {0}", ex.ToString());
}
}
else
{
this.EventLog.WriteEntry("ReportService stopped: DB connection failed", EventLogEntryType.Error);
this.Stop();
}
lock (this._timerlock)
{
this.processRunning = false;
}
}
protected override void OnStop()
{
_log.Info("Report Service stopping.");
}
internal void DoOnce()
{
this._timer_Elapsed(null, null);
}
}
} }

View File

@ -18,11 +18,16 @@ namespace bsmd.database
{ {
public class DBManager public class DBManager
{ {
#region Fields
private SqlConnection _con; private SqlConnection _con;
private static DBManager _instance; private static DBManager _instance;
private static ILog _log = LogManager.GetLogger(typeof(DBManager)); private static ILog _log = LogManager.GetLogger(typeof(DBManager));
private static Dictionary<Guid, ReportingParty> allReportingParties; private static Dictionary<Guid, ReportingParty> allReportingParties;
#endregion
#region Properties #region Properties
public static DBManager Instance public static DBManager Instance
@ -66,6 +71,7 @@ namespace bsmd.database
#region public helper funcs #region public helper funcs
/*
public Dictionary<Guid, MessageCore> GetToSendMessageCoreList() public Dictionary<Guid, MessageCore> GetToSendMessageCoreList()
{ {
List<MessageCore> toSendList = this.GetMessageCoresByStatus(MessageCore.BSMDStatus.TOSEND); List<MessageCore> toSendList = this.GetMessageCoresByStatus(MessageCore.BSMDStatus.TOSEND);
@ -75,6 +81,8 @@ namespace bsmd.database
return result; return result;
} }
*/
public List<MessageCore> GetMessageCoresByStatus(MessageCore.BSMDStatus status) public List<MessageCore> GetMessageCoresByStatus(MessageCore.BSMDStatus status)
{ {
MessageCore aMessageCore = new MessageCore(); MessageCore aMessageCore = new MessageCore();
@ -85,7 +93,10 @@ namespace bsmd.database
List<DatabaseEntity> cores = aMessageCore.LoadList(reader); List<DatabaseEntity> cores = aMessageCore.LoadList(reader);
List<MessageCore> result = new List<MessageCore>(); List<MessageCore> result = new List<MessageCore>();
foreach (MessageCore core in cores) foreach (MessageCore core in cores)
{
this.LoadCustomer(core);
result.Add(core); result.Add(core);
}
return result; return result;
} }
@ -100,19 +111,8 @@ namespace bsmd.database
List<MessageCore> result = new List<MessageCore>(); List<MessageCore> result = new List<MessageCore>();
foreach (MessageCore core in cores) foreach (MessageCore core in cores)
{ {
this.LoadCustomer(core);
result.Add(core); result.Add(core);
if (core.CustomerId.HasValue)
{
Customer c = new Customer();
SqlCommand cCmd = new SqlCommand();
c.PrepareLoadCommand(cCmd, Message.LoadFilter.BY_ID, core.CustomerId.Value);
reader = this.PerformCommand(cCmd);
List<DatabaseEntity> customers = c.LoadList(reader);
if (customers.Count > 0)
core.Customer = customers[0] as Customer;
}
} }
return result; return result;
} }
@ -124,6 +124,7 @@ namespace bsmd.database
/// <returns></returns> /// <returns></returns>
public MessageCore GetHerbergFormMessage(Guid herbergFormGuid) public MessageCore GetHerbergFormMessage(Guid herbergFormGuid)
{ {
MessageCore result = null;
MessageCore aMessageCore = new MessageCore(); MessageCore aMessageCore = new MessageCore();
SqlCommand cmd = new SqlCommand(); SqlCommand cmd = new SqlCommand();
aMessageCore.PrepareLoadCommand(cmd, Message.LoadFilter.HERBERG_FORMGUID, herbergFormGuid); aMessageCore.PrepareLoadCommand(cmd, Message.LoadFilter.HERBERG_FORMGUID, herbergFormGuid);
@ -132,9 +133,12 @@ namespace bsmd.database
List<DatabaseEntity> cores = aMessageCore.LoadList(reader); List<DatabaseEntity> cores = aMessageCore.LoadList(reader);
if (cores.Count > 1) _log.WarnFormat("Herberg form message: {0} cores found for guid {1}", if (cores.Count > 1) _log.WarnFormat("Herberg form message: {0} cores found for guid {1}",
cores.Count, herbergFormGuid); cores.Count, herbergFormGuid);
if(cores.Count > 0) if (cores.Count > 0)
return (MessageCore) cores[0]; {
return null; result = (MessageCore)cores[0];
this.LoadCustomer(result);
}
return result;
} }
public List<Message> GetMessagesForCore(MessageCore core) public List<Message> GetMessagesForCore(MessageCore core)
@ -638,6 +642,20 @@ namespace bsmd.database
message.ViolationList.Add(violation); message.ViolationList.Add(violation);
} }
internal void LoadCustomer(MessageCore core)
{
if (core.CustomerId.HasValue)
{
Customer c = new Customer();
SqlCommand cCmd = new SqlCommand();
c.PrepareLoadCommand(cCmd, Message.LoadFilter.BY_ID, core.CustomerId.Value);
SqlDataReader reader = this.PerformCommand(cCmd);
List<DatabaseEntity> customers = c.LoadList(reader);
if (customers.Count > 0)
core.Customer = customers[0] as Customer;
}
}
#region DB access methods #region DB access methods
internal SqlDataReader PerformCommand(SqlCommand cmd) internal SqlDataReader PerformCommand(SqlCommand cmd)
@ -645,7 +663,11 @@ namespace bsmd.database
try try
{ {
cmd.Connection = this._con; cmd.Connection = this._con;
Stopwatch sw = new Stopwatch();
sw.Start();
SqlDataReader reader = cmd.ExecuteReader(); SqlDataReader reader = cmd.ExecuteReader();
sw.Stop();
_log.DebugFormat("{1}ms: {0}", cmd.CommandText, sw.ElapsedMilliseconds);
return reader; return reader;
} }
catch (SqlException ex) catch (SqlException ex)

View File

@ -13,6 +13,9 @@ namespace bsmd.database
/// </summary> /// </summary>
public class Message : DatabaseEntity, ISublistContainer public class Message : DatabaseEntity, ISublistContainer
{ {
#region Fields
private Guid? messageCoreId; private Guid? messageCoreId;
private Guid? reportingPartyId; private Guid? reportingPartyId;
private ReportingParty reportingParty; private ReportingParty reportingParty;
@ -21,6 +24,8 @@ namespace bsmd.database
private List<MessageViolation> violationList = new List<MessageViolation>(); private List<MessageViolation> violationList = new List<MessageViolation>();
private List<DatabaseEntity> elements = new List<DatabaseEntity>(); private List<DatabaseEntity> elements = new List<DatabaseEntity>();
#endregion
#region Enumerations #region Enumerations
/// <summary> /// <summary>
@ -90,11 +95,15 @@ namespace bsmd.database
#endregion #endregion
#region Construction
public Message() public Message()
{ {
this.tablename = "[dbo].[MessageHeader]"; this.tablename = "[dbo].[MessageHeader]";
} }
#endregion
#region Properties #region Properties
/// <summary> /// <summary>

View File

@ -141,6 +141,7 @@ namespace bsmd.database
scmd.Parameters.AddWithNullableValue("@P21", this.HerbergRevDate); scmd.Parameters.AddWithNullableValue("@P21", this.HerbergRevDate);
scmd.Parameters.AddWithValue("@P22", this.ReportStatus); scmd.Parameters.AddWithValue("@P22", this.ReportStatus);
scmd.Parameters.AddWithNullableValue("@P23", this.SietasSheetVersion); scmd.Parameters.AddWithNullableValue("@P23", this.SietasSheetVersion);
scmd.Parameters.AddWithValue("@P24", this.Incoming ? 1 : 0);
if (this.IsNew) if (this.IsNew)
{ {
@ -149,9 +150,9 @@ namespace bsmd.database
string query = string.Format("INSERT INTO {0} (Id, VisitId, TransitId, IMO, ENI, PoC, Portname, ETA, CustomerId, " + string query = string.Format("INSERT INTO {0} (Id, VisitId, TransitId, IMO, ENI, PoC, Portname, ETA, CustomerId, " +
"Previous, Next, IsTransit, Wetris_zz_56_datensatz_id, BSMDStatus, InitialHIS, HerbergFormGuid, " + "Previous, Next, IsTransit, Wetris_zz_56_datensatz_id, BSMDStatus, InitialHIS, HerbergFormGuid, " +
"HerbergFormTemplateGuid, HerbergReportType, HerbergEmailcontactReportingVessel, HerbergEmail24HrsContact, " + "HerbergFormTemplateGuid, HerbergReportType, HerbergEmailcontactReportingVessel, HerbergEmail24HrsContact, " +
"ETAKielCanal, HerbergRevDate, ReportStatus, SietasSheetVersion) VALUES " + "ETAKielCanal, HerbergRevDate, ReportStatus, SietasSheetVersion, Incoming) VALUES " +
"(@ID, @P1, @P2, @P3, @P4, @P5, @P6, @P7, @P8, @P9, @P10, @P11, @P12, @P13, @P14, @P15, @P16, @P17, " + "(@ID, @P1, @P2, @P3, @P4, @P5, @P6, @P7, @P8, @P9, @P10, @P11, @P12, @P13, @P14, @P15, @P16, @P17, " +
"@P18, @P19, @P20, @P21, @P22, @P23)", "@P18, @P19, @P20, @P21, @P22, @P23, @P24)",
this.Tablename); this.Tablename);
scmd.CommandText = query; scmd.CommandText = query;
} }
@ -163,7 +164,7 @@ namespace bsmd.database
"Wetris_zz_56_datensatz_id = @P12, BSMDStatus = @P13, InitialHIS = @P14, HerbergFormGuid = @P15, " + "Wetris_zz_56_datensatz_id = @P12, BSMDStatus = @P13, InitialHIS = @P14, HerbergFormGuid = @P15, " +
"HerbergFormTemplateGuid = @P16, HerbergReportType = @P17, HerbergEmailContactReportingVessel = @P18, " + "HerbergFormTemplateGuid = @P16, HerbergReportType = @P17, HerbergEmailContactReportingVessel = @P18, " +
"HerbergEmail24HrsContact = @P19, ETAKielCanal = @P20, HerbergRevDate = @P21, ReportStatus = @P22, " + "HerbergEmail24HrsContact = @P19, ETAKielCanal = @P20, HerbergRevDate = @P21, ReportStatus = @P22, " +
"SietasSheetVersion = @P23 WHERE Id = @ID", this.Tablename); "SietasSheetVersion = @P23, Incoming = @P24 WHERE Id = @ID", this.Tablename);
scmd.CommandText = query; scmd.CommandText = query;
} }
} }
@ -173,7 +174,7 @@ namespace bsmd.database
string query = string.Format("SELECT Id, VisitId, TransitId, IMO, ENI, PoC, Portname, " + string query = string.Format("SELECT Id, VisitId, TransitId, IMO, ENI, PoC, Portname, " +
"ETA, CustomerId, Previous, Next, IsTransit, Wetris_zz_56_datensatz_id, BSMDStatus, InitialHIS, " + "ETA, CustomerId, Previous, Next, IsTransit, Wetris_zz_56_datensatz_id, BSMDStatus, InitialHIS, " +
"HerbergFormGuid, HerbergFormTemplateGuid, HerbergReportType, HerbergEmailContactReportingVessel, " + "HerbergFormGuid, HerbergFormTemplateGuid, HerbergReportType, HerbergEmailContactReportingVessel, " +
"HerbergEmail24HrsContact, ETAKielCanal, HerbergRevDate, ReportStatus, SietasSheetVersion FROM {0} ", "HerbergEmail24HrsContact, ETAKielCanal, HerbergRevDate, ReportStatus, SietasSheetVersion, Incoming FROM {0} ",
this.Tablename); this.Tablename);
switch (filter) switch (filter)
@ -254,6 +255,7 @@ namespace bsmd.database
if (!reader.IsDBNull(21)) core.HerbergRevDate = reader.GetDateTime(21); if (!reader.IsDBNull(21)) core.HerbergRevDate = reader.GetDateTime(21);
if (!reader.IsDBNull(22)) core.ReportStatus = (ReportStatusEnum) Enum.ToObject(typeof(ReportStatusEnum), reader.GetByte(22)); if (!reader.IsDBNull(22)) core.ReportStatus = (ReportStatusEnum) Enum.ToObject(typeof(ReportStatusEnum), reader.GetByte(22));
if (!reader.IsDBNull(23)) core.SietasSheetVersion = reader.GetString(23); if (!reader.IsDBNull(23)) core.SietasSheetVersion = reader.GetString(23);
if (!reader.IsDBNull(24)) core.Incoming = reader.GetBoolean(24);
result.Add(core); result.Add(core);
} }

View File

@ -2,6 +2,6 @@
[assembly: AssemblyCompany("Informatikbüro Daniel Schick")] [assembly: AssemblyCompany("Informatikbüro Daniel Schick")]
[assembly: AssemblyProduct("BSMD NSW interface")] [assembly: AssemblyProduct("BSMD NSW interface")]
[assembly: AssemblyInformationalVersion("2.0.0")] [assembly: AssemblyInformationalVersion("2.1.0")]
[assembly: AssemblyCopyright("Copyright © 2014-2015 Informatikbüro Daniel Schick. All rights reserved.")] [assembly: AssemblyCopyright("Copyright © 2014-2015 Informatikbüro Daniel Schick. All rights reserved.")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]

View File

@ -4,6 +4,6 @@
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.0.*")] [assembly: AssemblyVersion("2.1.0.*")]
// wenn das nicht auskommentiert wird erhalten wir eine Warnung // wenn das nicht auskommentiert wird erhalten wir eine Warnung
// [assembly: AssemblyFileVersion("1.0.0.*")] // [assembly: AssemblyFileVersion("1.0.0.*")]

View File

@ -74,7 +74,7 @@ namespace bsmd.herberg.FormService
if ((aMessageCore.HerbergReportType != formData.value) && if ((aMessageCore.HerbergReportType != formData.value) &&
(aMessageCore.ReportStatus != MessageCore.ReportStatusEnum.COMPLETE)) (aMessageCore.ReportStatus != MessageCore.ReportStatusEnum.COMPLETE))
aMessageCore.ReportStatus = MessageCore.ReportStatusEnum.HE_REPORTTYPE; aMessageCore.ReportStatus = MessageCore.ReportStatusEnum.HE_REPORTTYPE; // neuer Report-Type!
aMessageCore.HerbergReportType = formData.value; aMessageCore.HerbergReportType = formData.value;
if (aMessageCore.HerbergReportType.Equals("Pre-Departure Notification Update") || if (aMessageCore.HerbergReportType.Equals("Pre-Departure Notification Update") ||

View File

@ -9,6 +9,9 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO;
using System.Xml;
using System.Xml.Serialization;
using log4net; using log4net;
using bsmd.database; using bsmd.database;
@ -18,7 +21,7 @@ namespace bsmd.hisnord
{ {
private static ILog _log = LogManager.GetLogger(typeof(Request)); private static ILog _log = LogManager.GetLogger(typeof(Request));
public static bool Send(Message message) public static bool Send(List<Message> messages)
{ {
bool retval = true; bool retval = true;
@ -42,25 +45,47 @@ namespace bsmd.hisnord
_nsw.conveyance.owner_sender.contact.phone = "0171 641 6421"; _nsw.conveyance.owner_sender.contact.phone = "0171 641 6421";
_nsw.conveyance.owner_sender.contact.fax = "+49 (0)421 38 08 887"; _nsw.conveyance.owner_sender.contact.fax = "+49 (0)421 38 08 887";
_nsw.conveyance.owner_sender.name_short = message.MessageCore.Customer.Name; if (messages[0].MessageCore.Customer != null)
_nsw.conveyance.owner_sender.name_long = message.MessageCore.Customer.Name; {
_nsw.conveyance.owner_sender.name_short = messages[0].MessageCore.Customer.Name;
_nsw.conveyance.owner_sender.name_long = messages[0].MessageCore.Customer.Name;
_nsw.conveyance.owner_sender.address = new addresstype(); _nsw.conveyance.owner_sender.address = new addresstype();
_nsw.conveyance.owner_sender.address.StreetNumber = message.MessageCore.Customer.StreetAndNumber; _nsw.conveyance.owner_sender.address.StreetNumber = messages[0].MessageCore.Customer.StreetAndNumber;
_nsw.conveyance.owner_sender.address.PostCode = message.MessageCore.Customer.PostalCode; _nsw.conveyance.owner_sender.address.PostCode = messages[0].MessageCore.Customer.PostalCode;
_nsw.conveyance.owner_sender.address.Place = message.MessageCore.Customer.City; _nsw.conveyance.owner_sender.address.Place = messages[0].MessageCore.Customer.City;
}
_nsw.conveyance.vessel = new vesseltype(); _nsw.conveyance.vessel = new vesseltype();
_nsw.conveyance.vessel.ENINumber = message.MessageCore.ENI; _nsw.conveyance.vessel.ENINumber = messages[0].MessageCore.ENI;
_nsw.conveyance.vessel.IMONumber = message.MessageCore.IMO; _nsw.conveyance.vessel.IMONumber = messages[0].MessageCore.IMO;
_nsw.document_reference = messages[0].MessageCore.Id.Value.ToString();
_nsw.conveyance.Items = new string[1];
_nsw.conveyance.ItemsElementName = new ItemsChoiceType[1];
if (!messages[0].MessageCore.VisitId.IsNullOrEmpty())
{
_nsw.conveyance.Items[0] = messages[0].MessageCore.VisitId;
_nsw.conveyance.ItemsElementName[0] = ItemsChoiceType.VisitId;
}
else if (!messages[0].MessageCore.TransitId.IsNullOrEmpty())
{
_nsw.conveyance.Items[0] = messages[0].MessageCore.TransitId;
_nsw.conveyance.ItemsElementName[0] = ItemsChoiceType.TransitId;
}
else // liegt noch nix vor
{
_nsw.conveyance.Items[0] = messages[0].MessageCore.Id.ToString();
_nsw.conveyance.ItemsElementName[0] = ItemsChoiceType.code;
}
#endregion #endregion
#region NSW message area #region NSW message area
foreach (Message message in messages)
{
switch (message.MessageNotificationClass) switch (message.MessageNotificationClass)
{ {
@ -107,7 +132,7 @@ namespace bsmd.hisnord
} }
break; break;
case Message.NotificationClass.ATD: case Message.NotificationClass.ATD:
if(!message.MessageCore.Incoming) if (!message.MessageCore.Incoming)
{ {
export _export = null; export _export = null;
portofcallhazmat _poc = null; portofcallhazmat _poc = null;
@ -149,7 +174,8 @@ namespace bsmd.hisnord
if (message.Elements.Count > 0) if (message.Elements.Count > 0)
{ {
_nsw.conveyance.BunkerFuelList = new bunkerfuel[message.Elements.Count]; _nsw.conveyance.BunkerFuelList = new bunkerfuel[message.Elements.Count];
for (int i = 0; i < message.Elements.Count; i++) { for (int i = 0; i < message.Elements.Count; i++)
{
BRKA brka = message.Elements[i] as BRKA; BRKA brka = message.Elements[i] as BRKA;
_nsw.conveyance.BunkerFuelList[i] = new bunkerfuel(); _nsw.conveyance.BunkerFuelList[i] = new bunkerfuel();
_nsw.conveyance.BunkerFuelList[i].Name = brka.BunkerFuelType; _nsw.conveyance.BunkerFuelList[i].Name = brka.BunkerFuelType;
@ -160,7 +186,7 @@ namespace bsmd.hisnord
} }
break; break;
case Message.NotificationClass.BKRD: case Message.NotificationClass.BKRD:
if(!message.MessageCore.Incoming) if (!message.MessageCore.Incoming)
{ {
if (message.Elements.Count > 0) if (message.Elements.Count > 0)
{ {
@ -185,7 +211,7 @@ namespace bsmd.hisnord
BPOL bpol = message.Elements[0] as BPOL; BPOL bpol = message.Elements[0] as BPOL;
_nsw.conveyance.BPOL = new bpol(); _nsw.conveyance.BPOL = new bpol();
_nsw.conveyance.BPOL.StowawayOnBoard = (bpol.StowawaysOnBoard ?? false) ? yorntype.Y : yorntype.N; _nsw.conveyance.BPOL.StowawayOnBoard = (bpol.StowawaysOnBoard ?? false) ? yorntype.Y : yorntype.N;
if(!bpol.PortOfItineraries.IsNullOrEmpty()) if (!bpol.PortOfItineraries.IsNullOrEmpty())
{ {
_nsw.conveyance.BPOL.PortsOfItinery = new portofitinery[bpol.PortOfItineraries.Count]; _nsw.conveyance.BPOL.PortsOfItinery = new portofitinery[bpol.PortOfItineraries.Count];
for (int i = 0; i < bpol.PortOfItineraries.Count; i++) for (int i = 0; i < bpol.PortOfItineraries.Count; i++)
@ -194,6 +220,7 @@ namespace bsmd.hisnord
_nsw.conveyance.BPOL.PortsOfItinery[i].PortOfItineryName = bpol.PortOfItineraries[i].PortOfItineraryName; _nsw.conveyance.BPOL.PortsOfItinery[i].PortOfItineryName = bpol.PortOfItineraries[i].PortOfItineraryName;
if (bpol.PortOfItineraries[i].PortOfItineraryETA.HasValue) if (bpol.PortOfItineraries[i].PortOfItineraryETA.HasValue)
_nsw.conveyance.BPOL.PortsOfItinery[i].PortOfItineryETA = bpol.PortOfItineraries[i].PortOfItineraryETA.Value; _nsw.conveyance.BPOL.PortsOfItinery[i].PortOfItineryETA = bpol.PortOfItineraries[i].PortOfItineraryETA.Value;
_nsw.conveyance.BPOL.PortsOfItinery[i].Index = (i+1).ToString();
} }
} }
} }
@ -206,7 +233,7 @@ namespace bsmd.hisnord
{ {
_nsw.conveyance.CREW = new crew(); _nsw.conveyance.CREW = new crew();
_nsw.conveyance.CREW.CrewMembers = new crewmember[message.Elements.Count]; _nsw.conveyance.CREW.CrewMembers = new crewmember[message.Elements.Count];
for(int i=0;i<message.Elements.Count;i++) for (int i = 0; i < message.Elements.Count; i++)
{ {
CREW crew = message.Elements[i] as CREW; CREW crew = message.Elements[i] as CREW;
_nsw.conveyance.CREW.CrewMembers[i] = new crewmember(); _nsw.conveyance.CREW.CrewMembers[i] = new crewmember();
@ -214,11 +241,11 @@ namespace bsmd.hisnord
_nsw.conveyance.CREW.CrewMembers[i].CrewMemberDateOfBirth = crew.CrewMemberDateOfBirth.Value; _nsw.conveyance.CREW.CrewMembers[i].CrewMemberDateOfBirth = crew.CrewMemberDateOfBirth.Value;
_nsw.conveyance.CREW.CrewMembers[i].CrewMemberDuty = crew.CrewMemberDuty; _nsw.conveyance.CREW.CrewMembers[i].CrewMemberDuty = crew.CrewMemberDuty;
_nsw.conveyance.CREW.CrewMembers[i].CrewMemberFirstName = crew.CrewMemberFirstName; _nsw.conveyance.CREW.CrewMembers[i].CrewMemberFirstName = crew.CrewMemberFirstName;
if(crew.CrewMemberGender.HasValue) if (crew.CrewMemberGender.HasValue)
_nsw.conveyance.CREW.CrewMembers[i].CrewMemberGender = (gendertype)crew.CrewMemberGender.Value; _nsw.conveyance.CREW.CrewMembers[i].CrewMemberGender = (gendertype)crew.CrewMemberGender.Value;
_nsw.conveyance.CREW.CrewMembers[i].CrewMemberGenderSpecified = crew.CrewMemberGender.HasValue; _nsw.conveyance.CREW.CrewMembers[i].CrewMemberGenderSpecified = crew.CrewMemberGender.HasValue;
_nsw.conveyance.CREW.CrewMembers[i].CrewMemberIdentityDocumentId = crew.CrewMemberIdentityDocumentId; _nsw.conveyance.CREW.CrewMembers[i].CrewMemberIdentityDocumentId = crew.CrewMemberIdentityDocumentId;
if(crew.CrewMemberIdentityDocumentType.HasValue) if (crew.CrewMemberIdentityDocumentType.HasValue)
_nsw.conveyance.CREW.CrewMembers[i].CrewMemberIdentityDocumentType = (documenttype)crew.CrewMemberIdentityDocumentType.Value; _nsw.conveyance.CREW.CrewMembers[i].CrewMemberIdentityDocumentType = (documenttype)crew.CrewMemberIdentityDocumentType.Value;
_nsw.conveyance.CREW.CrewMembers[i].CrewMemberLastName = crew.CrewMemberLastName; _nsw.conveyance.CREW.CrewMembers[i].CrewMemberLastName = crew.CrewMemberLastName;
_nsw.conveyance.CREW.CrewMembers[i].CrewMemberNationality = crew.CrewMemberNationality; _nsw.conveyance.CREW.CrewMembers[i].CrewMemberNationality = crew.CrewMemberNationality;
@ -241,13 +268,13 @@ namespace bsmd.hisnord
INFO info = message.Elements[0] as INFO; INFO info = message.Elements[0] as INFO;
_nsw.conveyance.Info = new info(); _nsw.conveyance.Info = new info();
_nsw.conveyance.Info.ConstructionCharacteristicsOfShip = info.ConstructionCharacteristicsOfShip; _nsw.conveyance.Info.ConstructionCharacteristicsOfShip = info.ConstructionCharacteristicsOfShip;
if(info.DeplacementSummerDraught_TNE.HasValue) if (info.DeplacementSummerDraught_TNE.HasValue)
_nsw.conveyance.Info.DeadWeightSummer_TNE = (float) info.DeplacementSummerDraught_TNE.Value; _nsw.conveyance.Info.DeadWeightSummer_TNE = (float)info.DeplacementSummerDraught_TNE.Value;
_nsw.conveyance.Info.DeadWeightSummer_TNESpecified = info.DeplacementSummerDraught_TNE.HasValue; _nsw.conveyance.Info.DeadWeightSummer_TNESpecified = info.DeplacementSummerDraught_TNE.HasValue;
if (info.FumigatedBulkCargo.HasValue) if (info.FumigatedBulkCargo.HasValue)
_nsw.conveyance.Info.FumigatedBulkCargo = (info.FumigatedBulkCargo.Value == 1) ? yorntype.Y : yorntype.N; _nsw.conveyance.Info.FumigatedBulkCargo = (info.FumigatedBulkCargo.Value == 1) ? yorntype.Y : yorntype.N;
_nsw.conveyance.Info.RequestedPositionInPortOfCall = info.RequestedPositionInPortOfCall; _nsw.conveyance.Info.RequestedPositionInPortOfCall = info.RequestedPositionInPortOfCall;
if(info.ShippingArea.HasValue) if (info.ShippingArea.HasValue)
_nsw.conveyance.Info.ShippingArea = (shippingareatype)info.ShippingArea.Value; _nsw.conveyance.Info.ShippingArea = (shippingareatype)info.ShippingArea.Value;
_nsw.conveyance.Info.SpecialRequirementsOfShipAtBerth = info.SpecialRequirementsOfShipAtBerth; _nsw.conveyance.Info.SpecialRequirementsOfShipAtBerth = info.SpecialRequirementsOfShipAtBerth;
break; break;
@ -255,7 +282,8 @@ namespace bsmd.hisnord
#region LADG #region LADG
case Message.NotificationClass.LADG: case Message.NotificationClass.LADG:
if(message.Elements.Count > 0) { if (message.Elements.Count > 0)
{
_nsw.conveyance.GeneralCargo = new loadunit[message.Elements.Count]; _nsw.conveyance.GeneralCargo = new loadunit[message.Elements.Count];
for (int i = 0; i < message.Elements.Count; i++) for (int i = 0; i < message.Elements.Count; i++)
{ {
@ -263,7 +291,7 @@ namespace bsmd.hisnord
loadunit lu = new loadunit(); loadunit lu = new loadunit();
lu.CargoCodeNST = ladg.CargoCodeNST; lu.CargoCodeNST = ladg.CargoCodeNST;
if (ladg.CargoGrossQuantity_TNE.HasValue) if (ladg.CargoGrossQuantity_TNE.HasValue)
lu.CargoGrossQuantity_TNE = (float) ladg.CargoGrossQuantity_TNE.Value; lu.CargoGrossQuantity_TNE = (float)ladg.CargoGrossQuantity_TNE.Value;
if (ladg.CargoNumberOfItems.HasValue) if (ladg.CargoNumberOfItems.HasValue)
lu.CargoNumberOfItems = ladg.CargoNumberOfItems.Value.ToString(); lu.CargoNumberOfItems = ladg.CargoNumberOfItems.Value.ToString();
if (ladg.CargoHandlingType.HasValue) if (ladg.CargoHandlingType.HasValue)
@ -287,13 +315,13 @@ namespace bsmd.hisnord
{ {
_nsw.conveyance.Items3 = new object[1]; _nsw.conveyance.Items3 = new object[1];
mdh _mdh = new mdh(); mdh _mdh = new mdh();
if(mdh.AwareOfFurtherInfections.HasValue) if (mdh.AwareOfFurtherInfections.HasValue)
_mdh.AwareOfConditionsForFurtherInfections = mdh.AwareOfFurtherInfections.Value ? yorntype.Y : yorntype.N; _mdh.AwareOfConditionsForFurtherInfections = mdh.AwareOfFurtherInfections.Value ? yorntype.Y : yorntype.N;
_mdh.InfectedArea = new infectedarea(); _mdh.InfectedArea = new infectedarea();
if(mdh.InfectedAreaDate.HasValue) if (mdh.InfectedAreaDate.HasValue)
_mdh.InfectedArea.InfectedAreaDate = mdh.InfectedAreaDate.Value; _mdh.InfectedArea.InfectedAreaDate = mdh.InfectedAreaDate.Value;
_mdh.InfectedArea.InfectedAreaPort = mdh.InfectedAreaPort; _mdh.InfectedArea.InfectedAreaPort = mdh.InfectedAreaPort;
if(mdh.InfectedAreaVisited.HasValue) if (mdh.InfectedAreaVisited.HasValue)
_mdh.InfectedAreaVisited = mdh.InfectedAreaVisited.Value ? yorntype.Y : yorntype.N; _mdh.InfectedAreaVisited = mdh.InfectedAreaVisited.Value ? yorntype.Y : yorntype.N;
if (mdh.MedicalConsulted.HasValue) if (mdh.MedicalConsulted.HasValue)
_mdh.MedicalConsulted = mdh.MedicalConsulted.Value ? yorntype.Y : yorntype.N; _mdh.MedicalConsulted = mdh.MedicalConsulted.Value ? yorntype.Y : yorntype.N;
@ -303,7 +331,7 @@ namespace bsmd.hisnord
_mdh.NonAccidentialDeathsDuringVoyageCount = mdh.NonAccidentalDeathsDuringVoyageCount.Value.ToString(); _mdh.NonAccidentialDeathsDuringVoyageCount = mdh.NonAccidentalDeathsDuringVoyageCount.Value.ToString();
if (mdh.NumberOfIllPersons.HasValue) if (mdh.NumberOfIllPersons.HasValue)
_mdh.NumberOfIllPersons = mdh.NumberOfIllPersons.Value.ToString(); _mdh.NumberOfIllPersons = mdh.NumberOfIllPersons.Value.ToString();
if(mdh.NumberOfIllPersonsHigherThanExpected.HasValue) if (mdh.NumberOfIllPersonsHigherThanExpected.HasValue)
_mdh.NumberOfIllPersonsHigherThanExpected = mdh.NumberOfIllPersonsHigherThanExpected.Value ? yorntype.Y : yorntype.N; _mdh.NumberOfIllPersonsHigherThanExpected = mdh.NumberOfIllPersonsHigherThanExpected.Value ? yorntype.Y : yorntype.N;
if (mdh.PortOfCallLast30Days.Count > 0) if (mdh.PortOfCallLast30Days.Count > 0)
{ {
@ -312,7 +340,8 @@ namespace bsmd.hisnord
{ {
_mdh.PortsOfCallLast30Days[i] = new portofcallmdh(); _mdh.PortsOfCallLast30Days[i] = new portofcallmdh();
_mdh.PortsOfCallLast30Days[i].Index = i.ToString(); _mdh.PortsOfCallLast30Days[i].Index = i.ToString();
if(mdh.PortOfCallLast30Days[i].CrewJoinedShip.Count > 0) { if (mdh.PortOfCallLast30Days[i].CrewJoinedShip.Count > 0)
{
_mdh.PortsOfCallLast30Days[i].PortOfCallLast30DaysCrewJoinedShip = new string[mdh.PortOfCallLast30Days[i].CrewJoinedShip.Count]; _mdh.PortsOfCallLast30Days[i].PortOfCallLast30DaysCrewJoinedShip = new string[mdh.PortOfCallLast30Days[i].CrewJoinedShip.Count];
for (int j = 0; j < mdh.PortOfCallLast30Days[i].CrewJoinedShip.Count; j++) for (int j = 0; j < mdh.PortOfCallLast30Days[i].CrewJoinedShip.Count; j++)
{ {
@ -351,7 +380,7 @@ namespace bsmd.hisnord
_mdh.ValidSanitaryControlExemptionOrCertificate.DateOfIssue = mdh.DateOfIssue.Value; _mdh.ValidSanitaryControlExemptionOrCertificate.DateOfIssue = mdh.DateOfIssue.Value;
_mdh.ValidSanitaryControlExemptionOrCertificate.PlaceOfIssue = mdh.PlaceOfIssue; _mdh.ValidSanitaryControlExemptionOrCertificate.PlaceOfIssue = mdh.PlaceOfIssue;
_nsw.conveyance.Items3[0] = mdh; _nsw.conveyance.Items3[0] = _mdh;
} }
break; break;
#endregion #endregion
@ -383,7 +412,7 @@ namespace bsmd.hisnord
_transit.NextPort.ETASpecified = noa_nod.ETAToNextPort.HasValue; _transit.NextPort.ETASpecified = noa_nod.ETAToNextPort.HasValue;
_transit.NextPort.Locode = noa_nod.NextPort; _transit.NextPort.Locode = noa_nod.NextPort;
} }
else if(message.MessageCore.Incoming) // einlaufend else if (message.MessageCore.Incoming) // einlaufend
{ {
import _import = _nsw.conveyance.Item as import; import _import = _nsw.conveyance.Item as import;
_import.LastPort = new lastport(); _import.LastPort = new lastport();
@ -428,16 +457,16 @@ namespace bsmd.hisnord
{ {
PAS pas = message.Elements[i] as PAS; PAS pas = message.Elements[i] as PAS;
_nsw.conveyance.PAS.Passengers[i] = new passenger(); _nsw.conveyance.PAS.Passengers[i] = new passenger();
if(pas.PassengerDateOfBirth.HasValue) if (pas.PassengerDateOfBirth.HasValue)
_nsw.conveyance.PAS.Passengers[i].PassengerDateOfBirth = pas.PassengerDateOfBirth.Value; _nsw.conveyance.PAS.Passengers[i].PassengerDateOfBirth = pas.PassengerDateOfBirth.Value;
_nsw.conveyance.PAS.Passengers[i].PassengerFirstName = pas.PassengerFirstName; _nsw.conveyance.PAS.Passengers[i].PassengerFirstName = pas.PassengerFirstName;
if(pas.PassengerGender.HasValue) if (pas.PassengerGender.HasValue)
_nsw.conveyance.PAS.Passengers[i].PassengerGender = (gendertype)pas.PassengerGender.Value; _nsw.conveyance.PAS.Passengers[i].PassengerGender = (gendertype)pas.PassengerGender.Value;
_nsw.conveyance.PAS.Passengers[i].PassengerGenderSpecified = pas.PassengerGender.HasValue; _nsw.conveyance.PAS.Passengers[i].PassengerGenderSpecified = pas.PassengerGender.HasValue;
_nsw.conveyance.PAS.Passengers[i].PassengerIdentityDocumentId = pas.PassengerIdentityDocumentId; _nsw.conveyance.PAS.Passengers[i].PassengerIdentityDocumentId = pas.PassengerIdentityDocumentId;
if (pas.PassengerIdentityDocumentType.HasValue) if (pas.PassengerIdentityDocumentType.HasValue)
_nsw.conveyance.PAS.Passengers[i].PassengerIdentityDocumentType = (documenttype)pas.PassengerIdentityDocumentType.Value; _nsw.conveyance.PAS.Passengers[i].PassengerIdentityDocumentType = (documenttype)pas.PassengerIdentityDocumentType.Value;
if(pas.PassengerInTransit.HasValue) if (pas.PassengerInTransit.HasValue)
_nsw.conveyance.PAS.Passengers[i].PassengerInTransit = pas.PassengerInTransit.Value ? yorntype.Y : yorntype.N; _nsw.conveyance.PAS.Passengers[i].PassengerInTransit = pas.PassengerInTransit.Value ? yorntype.Y : yorntype.N;
_nsw.conveyance.PAS.Passengers[i].PassengerLastName = pas.PassengerLastName; _nsw.conveyance.PAS.Passengers[i].PassengerLastName = pas.PassengerLastName;
_nsw.conveyance.PAS.Passengers[i].PassengerNationality = pas.PassengerNationality; _nsw.conveyance.PAS.Passengers[i].PassengerNationality = pas.PassengerNationality;
@ -491,7 +520,7 @@ namespace bsmd.hisnord
case Message.NotificationClass.PRE72H: case Message.NotificationClass.PRE72H:
PRE72H pre72h = message.Elements[0] as PRE72H; PRE72H pre72h = message.Elements[0] as PRE72H;
_nsw.conveyance.Pre72H = new pre72(); _nsw.conveyance.Pre72H = new pre72();
if(pre72h.DateOfLastExpandedInspection.HasValue) if (pre72h.DateOfLastExpandedInspection.HasValue)
_nsw.conveyance.Pre72H.DateOfLastExpandedInspection = pre72h.DateOfLastExpandedInspection.Value; _nsw.conveyance.Pre72H.DateOfLastExpandedInspection = pre72h.DateOfLastExpandedInspection.Value;
_nsw.conveyance.Pre72H.PlannedOperations = pre72h.PlannedOperations; _nsw.conveyance.Pre72H.PlannedOperations = pre72h.PlannedOperations;
if (pre72h.PlannedPeriodOfStay_HUR.HasValue) if (pre72h.PlannedPeriodOfStay_HUR.HasValue)
@ -503,9 +532,9 @@ namespace bsmd.hisnord
if (pre72h.ConditionCargoBallastTanks.HasValue) if (pre72h.ConditionCargoBallastTanks.HasValue)
_nsw.conveyance.Pre72H.TankerDetails.ConditionCargoBallastTanks = (cargoconditiontype)pre72h.ConditionCargoBallastTanks.Value; _nsw.conveyance.Pre72H.TankerDetails.ConditionCargoBallastTanks = (cargoconditiontype)pre72h.ConditionCargoBallastTanks.Value;
_nsw.conveyance.Pre72H.TankerDetails.NatureOfCargo = pre72h.NatureOfCargo; _nsw.conveyance.Pre72H.TankerDetails.NatureOfCargo = pre72h.NatureOfCargo;
if(pre72h.TankerHullConfiguration.HasValue) if (pre72h.TankerHullConfiguration.HasValue)
_nsw.conveyance.Pre72H.TankerDetails.TankerHullConfiguration = (hullconfigtype)pre72h.TankerHullConfiguration.Value; _nsw.conveyance.Pre72H.TankerDetails.TankerHullConfiguration = (hullconfigtype)pre72h.TankerHullConfiguration.Value;
if(pre72h.VolumeOfCargo.HasValue) if (pre72h.VolumeOfCargo.HasValue)
_nsw.conveyance.Pre72H.TankerDetails.VolumeOfCargo_TNE = (float)pre72h.VolumeOfCargo.Value; _nsw.conveyance.Pre72H.TankerDetails.VolumeOfCargo_TNE = (float)pre72h.VolumeOfCargo.Value;
_nsw.conveyance.Pre72H.TankerDetails.VolumeOfCargo_TNESpecified = pre72h.VolumeOfCargo.HasValue; _nsw.conveyance.Pre72H.TankerDetails.VolumeOfCargo_TNESpecified = pre72h.VolumeOfCargo.HasValue;
break; break;
@ -535,20 +564,20 @@ namespace bsmd.hisnord
_sec.CSOPhone = sec.CSOPhone; _sec.CSOPhone = sec.CSOPhone;
if (sec.CurrentShipSecurityLevel.HasValue) if (sec.CurrentShipSecurityLevel.HasValue)
_sec.CurrentShipSecurityLevel = (posint13type)sec.CurrentShipSecurityLevel.Value; _sec.CurrentShipSecurityLevel = (posint13type)sec.CurrentShipSecurityLevel.Value;
if(sec.GeneralDescriptionOfCargo.HasValue) if (sec.GeneralDescriptionOfCargo.HasValue)
_sec.GeneralDescriptionOfCargo = (cargodescriptiontype)sec.GeneralDescriptionOfCargo.Value; _sec.GeneralDescriptionOfCargo = (cargodescriptiontype)sec.GeneralDescriptionOfCargo.Value;
if(sec.ISSCDateOfExpiration.HasValue) if (sec.ISSCDateOfExpiration.HasValue)
_sec.ISSCDateOfExpiration = sec.ISSCDateOfExpiration.Value; _sec.ISSCDateOfExpiration = sec.ISSCDateOfExpiration.Value;
_sec.ISSCIssuerName = sec.ISSCIssuerName; _sec.ISSCIssuerName = sec.ISSCIssuerName;
if(sec.ISSCIssuerType.HasValue) if (sec.ISSCIssuerType.HasValue)
_sec.ISSCIssuerType = (isscissuertype)sec.ISSCIssuerType; _sec.ISSCIssuerType = (isscissuertype)sec.ISSCIssuerType;
if(sec.ISSCType.HasValue) if (sec.ISSCType.HasValue)
_sec.ISSCType = (issctype)sec.ISSCType; _sec.ISSCType = (issctype)sec.ISSCType;
_sec.PortFacilityOfArrival = sec.PortFacilityOfArrival; _sec.PortFacilityOfArrival = sec.PortFacilityOfArrival;
_sec.ReasonsForNoValidISSC = sec.ReasonsForNoValidISSC; _sec.ReasonsForNoValidISSC = sec.ReasonsForNoValidISSC;
if(sec.ValidISSCOnBoard.HasValue) if (sec.ValidISSCOnBoard.HasValue)
_sec.ValidISSCOnBoard = sec.ValidISSCOnBoard.Value ? yorntype.Y : yorntype.N; _sec.ValidISSCOnBoard = sec.ValidISSCOnBoard.Value ? yorntype.Y : yorntype.N;
if(!sec.LastTenPortFacilitesCalled.IsNullOrEmpty()) if (!sec.LastTenPortFacilitesCalled.IsNullOrEmpty())
{ {
_sec.Last10Ports = new last10port[sec.LastTenPortFacilitesCalled.Count]; _sec.Last10Ports = new last10port[sec.LastTenPortFacilitesCalled.Count];
for (int i = 0; i < sec.LastTenPortFacilitesCalled.Count; i++) for (int i = 0; i < sec.LastTenPortFacilitesCalled.Count; i++)
@ -557,27 +586,27 @@ namespace bsmd.hisnord
_sec.Last10Ports[i].Index = i.ToString(); _sec.Last10Ports[i].Index = i.ToString();
if (sec.LastTenPortFacilitesCalled[i].PortFacilityDateOfArrival.HasValue) if (sec.LastTenPortFacilitesCalled[i].PortFacilityDateOfArrival.HasValue)
_sec.Last10Ports[i].PortFacilityDateOfArrival = sec.LastTenPortFacilitesCalled[i].PortFacilityDateOfArrival.Value; _sec.Last10Ports[i].PortFacilityDateOfArrival = sec.LastTenPortFacilitesCalled[i].PortFacilityDateOfArrival.Value;
if(sec.LastTenPortFacilitesCalled[i].PortFacilityDateOfDeparture.HasValue) if (sec.LastTenPortFacilitesCalled[i].PortFacilityDateOfDeparture.HasValue)
_sec.Last10Ports[i].PortFacilityDateOfDeparture = sec.LastTenPortFacilitesCalled[i].PortFacilityDateOfDeparture.Value; _sec.Last10Ports[i].PortFacilityDateOfDeparture = sec.LastTenPortFacilitesCalled[i].PortFacilityDateOfDeparture.Value;
_sec.Last10Ports[i].PortFacilityGISISCode = sec.LastTenPortFacilitesCalled[i].PortFacilityGISISCode; _sec.Last10Ports[i].PortFacilityGISISCode = sec.LastTenPortFacilitesCalled[i].PortFacilityGISISCode;
_sec.Last10Ports[i].PortFacilityPortCountry = sec.LastTenPortFacilitesCalled[i].PortFacilityPortCountry; _sec.Last10Ports[i].PortFacilityPortCountry = sec.LastTenPortFacilitesCalled[i].PortFacilityPortCountry;
_sec.Last10Ports[i].PortFacilityPortLoCode = sec.LastTenPortFacilitesCalled[i].PortFacilityPortLoCode; _sec.Last10Ports[i].PortFacilityPortLoCode = sec.LastTenPortFacilitesCalled[i].PortFacilityPortLoCode;
_sec.Last10Ports[i].PortFacilityPortName = sec.LastTenPortFacilitesCalled[i].PortFacilitySecurityMattersToReport; _sec.Last10Ports[i].PortFacilityPortName = sec.LastTenPortFacilitesCalled[i].PortFacilitySecurityMattersToReport;
_sec.Last10Ports[i].PortFacilitySecurityMattersToReport = sec.LastTenPortFacilitesCalled[i].PortFacilitySecurityMattersToReport; _sec.Last10Ports[i].PortFacilitySecurityMattersToReport = sec.LastTenPortFacilitesCalled[i].PortFacilitySecurityMattersToReport;
if(sec.LastTenPortFacilitesCalled[i].PortFacilityShipSecurityLevel.HasValue) if (sec.LastTenPortFacilitesCalled[i].PortFacilityShipSecurityLevel.HasValue)
_sec.Last10Ports[i].PortFacilityShipSecurityLevel = (posint13type)sec.LastTenPortFacilitesCalled[i].PortFacilityShipSecurityLevel.Value; _sec.Last10Ports[i].PortFacilityShipSecurityLevel = (posint13type)sec.LastTenPortFacilitesCalled[i].PortFacilityShipSecurityLevel.Value;
} }
} }
if(!sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled.IsNullOrEmpty()) if (!sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled.IsNullOrEmpty())
{ {
_sec.LastActivities = new lastactivity[sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled.Count]; _sec.LastActivities = new lastactivity[sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled.Count];
for (int i = 0; i < sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled.Count; i++) for (int i = 0; i < sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled.Count; i++)
{ {
_sec.LastActivities[i] = new lastactivity(); _sec.LastActivities[i] = new lastactivity();
if(sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled[i].ShipToShipActivityDateFrom.HasValue) if (sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled[i].ShipToShipActivityDateFrom.HasValue)
_sec.LastActivities[i].ShipToShipActivityDateFrom = sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled[i].ShipToShipActivityDateFrom.Value; _sec.LastActivities[i].ShipToShipActivityDateFrom = sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled[i].ShipToShipActivityDateFrom.Value;
if(sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled[i].ShipToShipActivityDateTo.HasValue) if (sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled[i].ShipToShipActivityDateTo.HasValue)
_sec.LastActivities[i].ShipToShipActivityDateTo = sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled[i].ShipToShipActivityDateTo.Value; _sec.LastActivities[i].ShipToShipActivityDateTo = sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled[i].ShipToShipActivityDateTo.Value;
_sec.LastActivities[i].ShipToShipActivityLocation = new location(); _sec.LastActivities[i].ShipToShipActivityLocation = new location();
_sec.LastActivities[i].ShipToShipActivityLocation.Items = new object[3]; _sec.LastActivities[i].ShipToShipActivityLocation.Items = new object[3];
@ -626,7 +655,7 @@ namespace bsmd.hisnord
case Message.NotificationClass.STAT: case Message.NotificationClass.STAT:
STAT stat = message.Elements[0] as STAT; STAT stat = message.Elements[0] as STAT;
if (stat.Beam_MTR.HasValue) if (stat.Beam_MTR.HasValue)
_nsw.conveyance.vessel.Beam_MTR = (float) stat.Beam_MTR.Value; _nsw.conveyance.vessel.Beam_MTR = (float)stat.Beam_MTR.Value;
_nsw.conveyance.vessel.CallSign = stat.CallSign; _nsw.conveyance.vessel.CallSign = stat.CallSign;
_nsw.conveyance.vessel.Flag = stat.Flag; _nsw.conveyance.vessel.Flag = stat.Flag;
if (stat.GrossTonnage.HasValue) if (stat.GrossTonnage.HasValue)
@ -660,7 +689,7 @@ namespace bsmd.hisnord
break; break;
case Message.NotificationClass.TIEFD: case Message.NotificationClass.TIEFD:
TIEFD tiefd = message.Elements[0] as TIEFD; TIEFD tiefd = message.Elements[0] as TIEFD;
if(tiefd != null) if (tiefd != null)
{ {
if (tiefd.DraughtUponDeparture_DMT.HasValue) if (tiefd.DraughtUponDeparture_DMT.HasValue)
_nsw.conveyance.Draught_DMT = (float)tiefd.DraughtUponDeparture_DMT.Value; _nsw.conveyance.Draught_DMT = (float)tiefd.DraughtUponDeparture_DMT.Value;
@ -709,7 +738,8 @@ namespace bsmd.hisnord
} }
break; break;
case Message.NotificationClass.TOWD: case Message.NotificationClass.TOWD:
if(!message.MessageCore.Incoming) { if (!message.MessageCore.Incoming)
{
if (message.Elements.Count > 0) if (message.Elements.Count > 0)
{ {
_nsw.conveyance.TOWS = new tow[message.Elements.Count]; _nsw.conveyance.TOWS = new tow[message.Elements.Count];
@ -742,10 +772,80 @@ namespace bsmd.hisnord
break; break;
#endregion #endregion
#region WAS
case Message.NotificationClass.WAS: case Message.NotificationClass.WAS:
WAS was = message.Elements[0] as WAS;
break; if (was.WasteDisposalValidExemption ?? false)
{
_nsw.conveyance.Item1 = new object();
_nsw.conveyance.Item1 = ytype.Y;
} }
else
{
was _waste = new was();
_waste.ConfirmationOfCorrectness = (was.ConfirmationOfCorrectness ?? false) ? yorntype.Y : yorntype.N;
if (was.LastWasteDisposalDate.HasValue)
_waste.LastWasteDisposalDate = was.LastWasteDisposalDate.Value;
_waste.LastWasteDisposalPort = was.LastWasteDisposalPort;
if (was.WasteDisposalDelivery.HasValue)
_waste.WasteDisposalDelivery = (wastedeliverytype)was.WasteDisposalDelivery.Value;
if (was.WasteDisposalServiceProvider.Count > 0)
_waste.WasteDisposalServiceProviderName = new string[was.WasteDisposalServiceProvider.Count];
for (int i = 0; i < was.WasteDisposalServiceProvider.Count; i++)
{
_waste.WasteDisposalServiceProviderName[i] = was.WasteDisposalServiceProvider[i].WasteDisposalServiceProviderName;
}
if (was.Waste.Count > 0)
{
_waste.Wastes = new waste[was.Waste.Count];
for (int i = 0; i < was.Waste.Count; i++)
{
waste _aWaste = new waste();
_aWaste.WasteDescription = was.Waste[i].WasteDescription;
_aWaste.WasteDetails = new wastedetails();
_aWaste.WasteDetails.WasteAmountGeneratedTillNextPort_MTQSpecified = was.Waste[i].WasteAmountGeneratedTillNextPort_MTQ.HasValue;
if (was.Waste[i].WasteAmountGeneratedTillNextPort_MTQ.HasValue)
_aWaste.WasteDetails.WasteAmountGeneratedTillNextPort_MTQ = (float)was.Waste[i].WasteAmountGeneratedTillNextPort_MTQ.Value;
_aWaste.WasteDetails.WasteAmountRetained_MTQSpecified = was.Waste[i].WasteAmountRetained_MTQ.HasValue;
if (was.Waste[i].WasteAmountRetained_MTQ.HasValue)
_aWaste.WasteDetails.WasteAmountRetained_MTQ = (float)was.Waste[i].WasteAmountRetained_MTQ.Value;
_aWaste.WasteDetails.WasteCapacity_MTQSpecified = was.Waste[i].WasteCapacity_MTQ.HasValue;
if (was.Waste[i].WasteCapacity_MTQ.HasValue)
_aWaste.WasteDetails.WasteCapacity_MTQ = (float)was.Waste[i].WasteCapacity_MTQ.Value;
_aWaste.WasteDetails.WasteDisposalPort = was.Waste[i].WasteDisposalPort;
if (was.Waste[i].WasteDisposalAmount_MTQ.HasValue)
_aWaste.WasteDisposalAmount_MTQ = (float)was.Waste[i].WasteDisposalAmount_MTQ.Value;
if (was.Waste[i].WasteType.HasValue)
_aWaste.WasteType = (wastetype)was.Waste[i].WasteType.Value;
_waste.Wastes[i] = _aWaste;
}
}
_nsw.conveyance.Item1 = _waste;
}
break;
#endregion
}
}
#endregion
#region serialize and save message
string filename = string.Format("{0}-{1}.xml", DateTime.Now.ToString("yyyyMMddHHmmss"), messages[0].MessageCore.Id.Value);
_log.InfoFormat("saving {0} to output directory", filename);
string filePath = Path.Combine(Properties.Settings.Default.OutputDir, filename);
XmlSerializer serializer = new XmlSerializer(typeof(nsw));
using(TextWriter tw = new StreamWriter(filePath)) {
serializer.Serialize(tw, _nsw);
}
#endregion
#region send message and store result
transmitter.result theResult = transmitter.transmit(filePath);
#endregion #endregion

View File

@ -59,6 +59,11 @@
</Compile> </Compile>
<Compile Include="his-nord.cs" /> <Compile Include="his-nord.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<DependentUpon>Settings.settings</DependentUpon>
</Compile>
<Compile Include="Request.cs" /> <Compile Include="Request.cs" />
<Compile Include="transmitter.cs" /> <Compile Include="transmitter.cs" />
</ItemGroup> </ItemGroup>
@ -68,6 +73,16 @@
<Name>bsmd.database</Name> <Name>bsmd.database</Name>
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<ItemGroup>
<Content Include="readme.txt" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- 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.

View File

@ -0,0 +1,161 @@
Spezialitäten bei HIS Nord (Stand 25.7.15)
- "transmitter" wird verwendet um die erzeugten Daten an D&D zu schicken
- eine Rückmeldung erfolgt direkt über das Transmitter-Tool (Verstoß gegen XSD) oder über Email an den Meldenden, das passiert
bei "Highlevel" Fehlern aus dem NSW (Error/Violation).
- Da ein Haufen Pflichtangaben notwendig sind habe ich mich entschlossen, bei D&D den Message-Core immer komplett zu schicken
Sollen die doch das ganze auseinanderflöhen.
Ursprüngliche Mail von Deffke:
- Generell: Ist es möglich nur Teilnachrichten zu verschicken oder erwartet die Schnittstelle eine komplette Anmeldung?
à Die Schnittstelle erwartet bisher folgende Pflichtangaben, damit ein reibungsloser Ablauf funktioniert:
· Angabe der VISITID, TRANSITID oder ein eindeutiger CODE (können Sie selbst festlegen), zu dem alle Nachrichten gesandt bzw. zusammengefasst werden können
· Angabe der Melderdaten (OWNER_SENDER)
o Hier schlagen wir Ihnen folgende Handhabung vor:
§ In „name_short“ und „name_long“ werden die Firmenkurz- und langnamen eingetragen von dem jeweiligen Makler, Reederei etc.
· Auf dieser Basis können wir in unserem System eine eindeutige Zuordnung erreichen
· Deshalb besteht hier Abstimmungsbedarf hinsichtlich der Firmen für die Sie melden möchten.
o Zum Beispiel in unserem System ist Baltimar wie folgt gespeichert:
§ name_short: Baltimar
§ name_long: Baltimar Schiffahrt u. Transport GmbH
§ In der „address“ die Firmenadresse, z.B. von Baltimar
§ Im „contact“ bitte folgende Vorgaben berücksichtigen
· name: BSMD
· firstname: <Name eines zentral Verantwortlichen>
· phone: <Nummer unter der zentral jemand für Rückfragen erreichbar ist>
· fax:<Nummer, die zentral erreichbar ist>
· email: <Mail-Adresse, die zentral erreichbar ist>
· Angabe der notwendigen Schiffsstammdaten
· Angabe IMPORT, EXPORT, TRANSIT
o Sind Pflicht, da somit ermittelt werden kann, ob es sich um einen Eingang bzw. Ausgang für den Hafen bedeutet
o Transit ist für den Nord-Ostsee-Kanal (NOK) vorgesehen
· Angabe PERSONSONBOARD
o Zur Zeit noch Pflicht (historisch bedingt), könnten wir auf Wunsch auch optional machen
· Alle anderen Meldetypen und Angaben, die weiter oben nicht aufgezählt wurden, sind optional, d.h. können als Teilnachrichten gesandt werden
- Mit welchen Werten werden folgende Felder in nsw belegt:
- date_registration (aktuelle Zeit?)
· Dieser Wert wird bisher nicht für das Senden ans NSW benötigt
· Es dient lediglich der Auswertung, in welcher Reihenfolge die Meldung bzw. XML-Files erzeugt und abgearbeitet wurden
- message_sender
· Hier bitte BSMD eintragen
· Ans NSW werden aber die Werte aus dem OWNER_SENDER verwendet, speziell aus CONTACT
- message_recipient
· Hier bitte HIS-NORD eintragen
- document_reference (kann das verwendet werden um bei einer Antwort eine Rückwärts-Referenz auszuwerten?)
· Auf welcher Ebene erwarten Sie eine Rückwärts-Referenz?
o Beim Transmitter erhalten Sie die Fehlerausgabe der Schemavalidierung und dort wird der Dateiname als Referenz verwendet
o Falls was beim Import in unsere Datenbank bzw. beim Senden an das NSW schief geht und es an den gesandten XML-Files liegt, dann werden Mails an die Mail-Adresse aus CONTACT (OWNER_SENDER) gesendet
§ Über diesen Weg könnten auch angeforderte VISITIDs etc. gesendet werden, falls erwünscht
- Gibt es vom NSW Standard abweichende / ergänzende Felder und sind diese dokumentiert?
· Ich habe Ihnen hierzu die NSW-Spezifikation im Anhang zur Verfügung gestellt
· Grundsätzlich orientiert sich das an Ihnen überreichte XML-Schema an diesen Vorgaben mit folgenden Abweichungen
Meldetypen
Abweichungen
NOA_NOD
In IMPORT, EXPORT, TRANSIT vorkommend,
wobei zusätzlich Hafengebiet oder GISIS-Code gemeldet werden kann, ansonsten wird das Standard-Hafengebiet genommen, z.B. ÜSH für Überseehafen Rostock
ATA/ATD
In IMPORT, EXPORT
POBA/POBD
In PersonsOnBoard, je nach IMPORT, EXPORT wird entsprechender Ein-/Ausgang gemeldet
Name
In NameOfMaster
TIEFA/TIEFD
In Draught_DMT, je nach IMPORT, EXPORT wird entsprechender Ein-/Ausgang gemeldet
BKRA/BKRD
In BunkerFuelList, je nach IMPORT, EXPORT wird entsprechender Ein-/Ausgang gemeldet
STAT
In vessel
LADG
In GeneralCargo->LoadUnit
HAZA/HAZD
In GeneralCargo->LoadUnit, je nach IMPORT, EXPORT wird entsprechender Ein-/Ausgang gemeldet
SEC
In SEC
INFO
In Info
SERV
In SERV
PRE72H
In Pre72H
MDH
In MDH
WAS
In Waste
CREW/PAS/BPOL
In CREW/PAS/BPOL
TOWA/TOWD
In TOWS, je nach IMPORT, EXPORT wird entsprechender Ein-/Ausgang gemeldet
Für die Schemaänderung mit dem Hafengebiet erhalten Sie ein erneute Version des XML-Schemas.
· Unter PortOfCall (ComplexType: portofcallhazmat) kann zusätzlich das Hafengebiet/GISISCode zugeordnet werden, damit eine saubere Zuordnung im System erfolgen kann, ansonsten werden Standard-Hafengebiete verwendet

View File

@ -9,6 +9,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics;
using System.IO; using System.IO;
using System.Text; using System.Text;
using System.Xml; using System.Xml;
@ -20,6 +21,38 @@ namespace bsmd.hisnord
public class transmitter public class transmitter
{ {
private static ILog _log = LogManager.GetLogger(typeof(transmitter)); private static ILog _log = LogManager.GetLogger(typeof(transmitter));
/*
public static result UseHisNordTransmitter(string filenameFullPath)
{
Process process = new Process();
process.StartInfo.FileName = Properties.Settings.Default.Transmitter;
process.StartInfo.RedirectStandardError = true;
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.RedirectStandardInput = 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
process.Start();
int timeout = Properties.Settings.Default.BatchTimeoutMins * 1000 * 60; // convert to ms
process.WaitForExit((timeout == 0) ? int.MaxValue : timeout);
_log.Error(process.StandardError.ReadToEnd());
process.WaitForExit();
_log.Info(process.StandardOutput.ReadToEnd());
process.WaitForExit();
// now we should read the response message...
string resultFilename = string.Format("{0}.result.xml", Path.GetFileName(filenameFullPath));
string resultFullPath = Path.Combine(Properties.Settings.Default.ResultDir, resultFilename);
return result.ReadResult(resultFullPath);
}
*/
/// <summary> /// <summary>
/// class to read transmitter result xml files /// class to read transmitter result xml files
/// </summary> /// </summary>
@ -53,5 +86,7 @@ namespace bsmd.hisnord
} }
} }
} }
} }