aktueller Stand 2.4.12.*

This commit is contained in:
Daniel Schick 2015-11-22 17:08:08 +00:00
parent bd4b5b4d39
commit 4eca10bfb4
8 changed files with 172 additions and 68 deletions

Binary file not shown.

View File

@ -36,7 +36,6 @@ namespace bsmd.database
public bool? NoDPGOnBoardOnArrival { get; set; } public bool? NoDPGOnBoardOnArrival { get; set; }
[ShowReport] [ShowReport]
[Validation(ValidationCode.NOT_NULL)]
public bool? DPGManifestOnBoardOnArrival { get; set; } public bool? DPGManifestOnBoardOnArrival { get; set; }
[ShowReport] [ShowReport]

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.4.11")] [assembly: AssemblyInformationalVersion("2.4.12")]
[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

@ -1,4 +1,4 @@
using System.Reflection; using System.Reflection;
[assembly: AssemblyVersion("2.4.11.*")] [assembly: AssemblyVersion("2.4.12.*")]

View File

@ -656,74 +656,90 @@ namespace bsmd.dbh
} }
else else
{ // der blöde Teil { // der blöde Teil
rootMDH.Items = new object[19];
rootMDH.ItemsElementName = new ItemsChoiceType2[26]; List<object> mdhItems = new List<object>();
rootMDH.ItemsElementName[0] = ItemsChoiceType2.NonAccidentialDeathsDuringVoyage; List<ItemsChoiceType2> choiceTypes2 = new List<ItemsChoiceType2>();
rootMDH.Items[0] = mdh.NonAccidentalDeathsDuringVoyage ?? false ? RootMDHNonAccidentialDeathsDuringVoyage.Y : RootMDHNonAccidentialDeathsDuringVoyage.N;
rootMDH.ItemsElementName[1] = ItemsChoiceType2.NonAccidentialDeathsDuringVoyageCount; choiceTypes2.Add(ItemsChoiceType2.NonAccidentialDeathsDuringVoyage);
if (mdh.NonAccidentalDeathsDuringVoyageCount.HasValue) mdhItems.Add(mdh.NonAccidentalDeathsDuringVoyage ?? false ? RootMDHNonAccidentialDeathsDuringVoyage.Y : RootMDHNonAccidentialDeathsDuringVoyage.N);
rootMDH.Items[1] = mdh.NonAccidentalDeathsDuringVoyageCount.Value;
rootMDH.ItemsElementName[2] = ItemsChoiceType2.SuspisionInfectiousNature; choiceTypes2.Add(ItemsChoiceType2.NonAccidentialDeathsDuringVoyageCount);
rootMDH.Items[2] = mdh.SuspisionInfectiousNature ?? false ? RootMDHSuspisionInfectiousNature.Y : RootMDHSuspisionInfectiousNature.N; mdhItems.Add(mdh.NonAccidentalDeathsDuringVoyageCount ?? 0);
rootMDH.ItemsElementName[3] = ItemsChoiceType2.NumberOfIllPersonsHigherThanExpected;
rootMDH.Items[3] = mdh.NumberOfIllPersonsHigherThanExpected ?? false ? RootMDHNumberOfIllPersonsHigherThanExpected.Y : RootMDHNumberOfIllPersonsHigherThanExpected.N; choiceTypes2.Add(ItemsChoiceType2.SuspisionInfectiousNature);
rootMDH.ItemsElementName[4] = ItemsChoiceType2.NumberOfIllPersons; mdhItems.Add(mdh.SuspisionInfectiousNature ?? false ? RootMDHSuspisionInfectiousNature.Y : RootMDHSuspisionInfectiousNature.N);
if (mdh.NumberOfIllPersons.HasValue)
rootMDH.Items[4] = mdh.NumberOfIllPersons.Value; choiceTypes2.Add(ItemsChoiceType2.NumberOfIllPersonsHigherThanExpected);
rootMDH.ItemsElementName[5] = ItemsChoiceType2.SickPersonsOnBoard; mdhItems.Add(mdh.NumberOfIllPersonsHigherThanExpected ?? false ? RootMDHNumberOfIllPersonsHigherThanExpected.Y : RootMDHNumberOfIllPersonsHigherThanExpected.N);
rootMDH.Items[5] = mdh.SickPersonsOnBoard ?? false ? RootMDHSickPersonsOnBoard.Y : RootMDHSickPersonsOnBoard.N;
rootMDH.ItemsElementName[6] = ItemsChoiceType2.MedicalConsulted; choiceTypes2.Add(ItemsChoiceType2.NumberOfIllPersons);
rootMDH.Items[6] = mdh.MedicalConsulted ?? false ? RootMDHMedicalConsulted.Y : RootMDHMedicalConsulted.N; mdhItems.Add(mdh.NumberOfIllPersons ?? 0);
rootMDH.ItemsElementName[7] = ItemsChoiceType2.AwareOfConditionsForFurtherInfections;
rootMDH.Items[7] = mdh.AwareOfFurtherInfections ?? false ? RootMDHAwareOfConditionsForFurtherInfections.Y : RootMDHAwareOfConditionsForFurtherInfections.N; choiceTypes2.Add(ItemsChoiceType2.SickPersonsOnBoard);
rootMDH.ItemsElementName[8] = ItemsChoiceType2.SanitaryMeasuresApplied; mdhItems.Add(mdh.SickPersonsOnBoard ?? false ? RootMDHSickPersonsOnBoard.Y : RootMDHSickPersonsOnBoard.N);
rootMDH.Items[8] = mdh.SanitaryMeasuresApplied ?? false ? RootMDHSanitaryMeasuresApplied.Y : RootMDHSanitaryMeasuresApplied.N;
choiceTypes2.Add(ItemsChoiceType2.MedicalConsulted);
mdhItems.Add(mdh.MedicalConsulted ?? false ? RootMDHMedicalConsulted.Y : RootMDHMedicalConsulted.N);
choiceTypes2.Add(ItemsChoiceType2.AwareOfConditionsForFurtherInfections);
mdhItems.Add(mdh.AwareOfFurtherInfections ?? false ? RootMDHAwareOfConditionsForFurtherInfections.Y : RootMDHAwareOfConditionsForFurtherInfections.N);
choiceTypes2.Add(ItemsChoiceType2.SanitaryMeasuresApplied);
mdhItems.Add(mdh.SanitaryMeasuresApplied ?? false ? RootMDHSanitaryMeasuresApplied.Y : RootMDHSanitaryMeasuresApplied.N);
if (mdh.SanitaryMeasuresApplied ?? false) if (mdh.SanitaryMeasuresApplied ?? false)
{ {
rootMDH.ItemsElementName[9] = ItemsChoiceType2.SanitaryMeasuresDetails; choiceTypes2.Add(ItemsChoiceType2.SanitaryMeasuresDetails);
RootMDHSanitaryMeasuresDetails smDet = new RootMDHSanitaryMeasuresDetails(); RootMDHSanitaryMeasuresDetails smDet = new RootMDHSanitaryMeasuresDetails();
if (mdh.SanitaryMeasuresDate.HasValue) if (mdh.SanitaryMeasuresDate.HasValue)
smDet.SanitaryMeasuresDate = mdh.SanitaryMeasuresDate.Value; smDet.SanitaryMeasuresDate = mdh.SanitaryMeasuresDate.Value;
smDet.SanitaryMeasuresType = mdh.SanitaryMeasuresType; smDet.SanitaryMeasuresType = mdh.SanitaryMeasuresType;
smDet.SanitaryMeasuresLocation = mdh.SanitaryMeasuresLocation; smDet.SanitaryMeasuresLocation = mdh.SanitaryMeasuresLocation;
rootMDH.Items[9] = smDet; mdhItems.Add(smDet);
} }
rootMDH.ItemsElementName[10] = ItemsChoiceType2.StowawaysDetected; choiceTypes2.Add(ItemsChoiceType2.StowawaysDetected);
rootMDH.Items[10] = mdh.StowawaysDetected ?? false ? RootMDHStowawaysDetected.Y : RootMDHStowawaysDetected.N; mdhItems.Add(mdh.StowawaysDetected ?? false ? RootMDHStowawaysDetected.Y : RootMDHStowawaysDetected.N);
rootMDH.ItemsElementName[11] = ItemsChoiceType2.StowawaysJoiningLocation;
rootMDH.Items[11] = mdh.StowawaysJoiningLocation;
rootMDH.ItemsElementName[12] = ItemsChoiceType2.SickAnimalOrPetOnBoard;
rootMDH.Items[12] = mdh.SickAnimalOrPetOnBoard ?? false ? RootMDHSickAnimalOrPetOnBoard.Y : RootMDHSickAnimalOrPetOnBoard.N;
rootMDH.ItemsElementName[13] = ItemsChoiceType2.ValidSanitaryControlExemptionOrCertificateOnBoard;
rootMDH.Items[13] = mdh.ValidSanitaryControlExemptionOrCertificateOnBoard ?? false ? RootMDHValidSanitaryControlExemptionOrCertificateOnBoard.Y : RootMDHValidSanitaryControlExemptionOrCertificateOnBoard.N;
rootMDH.ItemsElementName[14] = ItemsChoiceType2.ValidSanitaryControlExemptionOrCertificate; choiceTypes2.Add(ItemsChoiceType2.StowawaysJoiningLocation);
mdhItems.Add(mdh.StowawaysJoiningLocation);
choiceTypes2.Add(ItemsChoiceType2.SickAnimalOrPetOnBoard);
mdhItems.Add(mdh.SickAnimalOrPetOnBoard ?? false ? RootMDHSickAnimalOrPetOnBoard.Y : RootMDHSickAnimalOrPetOnBoard.N);
choiceTypes2.Add(ItemsChoiceType2.ValidSanitaryControlExemptionOrCertificateOnBoard);
mdhItems.Add(mdh.ValidSanitaryControlExemptionOrCertificateOnBoard ?? false ? RootMDHValidSanitaryControlExemptionOrCertificateOnBoard.Y : RootMDHValidSanitaryControlExemptionOrCertificateOnBoard.N);
if (mdh.DateOfIssue.HasValue && !mdh.PlaceOfIssue.IsNullOrEmpty())
{
choiceTypes2.Add(ItemsChoiceType2.ValidSanitaryControlExemptionOrCertificate);
RootMDHValidSanitaryControlExemptionOrCertificate cert = new RootMDHValidSanitaryControlExemptionOrCertificate(); RootMDHValidSanitaryControlExemptionOrCertificate cert = new RootMDHValidSanitaryControlExemptionOrCertificate();
rootMDH.Items[14] = cert; mdhItems.Add(cert);
if (mdh.DateOfIssue.HasValue) cert.DateOfIssue = mdh.DateOfIssue.Value; cert.DateOfIssue = mdh.DateOfIssue.Value;
cert.PlaceOfIssue = mdh.PlaceOfIssue; cert.PlaceOfIssue = mdh.PlaceOfIssue;
rootMDH.ItemsElementName[15] = ItemsChoiceType2.SanitaryControlReinspectionRequired; }
rootMDH.Items[15] = mdh.SanitaryControlReinspectionRequired ?? false ? RootMDHSanitaryControlReinspectionRequired.Y : RootMDHSanitaryControlReinspectionRequired.N;
rootMDH.ItemsElementName[16] = ItemsChoiceType2.InfectedAreaVisited; choiceTypes2.Add(ItemsChoiceType2.SanitaryControlReinspectionRequired);
rootMDH.Items[16] = mdh.InfectedAreaVisited ?? false ? RootMDHInfectedAreaVisited.Y : RootMDHInfectedAreaVisited.N; mdhItems.Add(mdh.SanitaryControlReinspectionRequired ?? false ? RootMDHSanitaryControlReinspectionRequired.Y : RootMDHSanitaryControlReinspectionRequired.N);
choiceTypes2.Add(ItemsChoiceType2.InfectedAreaVisited);
mdhItems.Add(mdh.InfectedAreaVisited ?? false ? RootMDHInfectedAreaVisited.Y : RootMDHInfectedAreaVisited.N);
if (!mdh.InfectedAreaPort.IsNullOrEmpty() && mdh.InfectedAreaDate.HasValue) if (!mdh.InfectedAreaPort.IsNullOrEmpty() && mdh.InfectedAreaDate.HasValue)
{ {
rootMDH.ItemsElementName[17] = ItemsChoiceType2.InfectedArea; choiceTypes2.Add(ItemsChoiceType2.InfectedArea);
RootMDHInfectedArea infected = new RootMDHInfectedArea(); RootMDHInfectedArea infected = new RootMDHInfectedArea();
rootMDH.Items[17] = infected; mdhItems.Add(infected);
infected.InfectedAreaPort = mdh.InfectedAreaPort; infected.InfectedAreaPort = mdh.InfectedAreaPort;
if (mdh.InfectedAreaDate.HasValue) infected.InfectedAreaDate = mdh.InfectedAreaDate.Value; infected.InfectedAreaDate = mdh.InfectedAreaDate.Value;
} }
rootMDH.ItemsElementName[18] = ItemsChoiceType2.PortsOfCallLast30Days;
RootMDHPortsOfCallLast30Days l30d = new RootMDHPortsOfCallLast30Days();
rootMDH.Items[18] = l30d;
if (mdh.PortOfCallLast30Days.Count > 0) if (mdh.PortOfCallLast30Days.Count > 0)
{ {
choiceTypes2.Add(ItemsChoiceType2.PortsOfCallLast30Days);
RootMDHPortsOfCallLast30Days l30d = new RootMDHPortsOfCallLast30Days();
mdhItems.Add(l30d);
l30d.PortOfCallLast30Days = new RootMDHPortsOfCallLast30DaysPortOfCallLast30Days[mdh.PortOfCallLast30Days.Count]; l30d.PortOfCallLast30Days = new RootMDHPortsOfCallLast30DaysPortOfCallLast30Days[mdh.PortOfCallLast30Days.Count];
for (int i = 0; i < mdh.PortOfCallLast30Days.Count; i++) for (int i = 0; i < mdh.PortOfCallLast30Days.Count; i++)
{ {
@ -743,6 +759,10 @@ namespace bsmd.dbh
l30d.PortOfCallLast30Days[i].PortOfCallLast30DaysLocode = mdh.PortOfCallLast30Days[i].PortOfCallLast30DaysLocode; l30d.PortOfCallLast30Days[i].PortOfCallLast30DaysLocode = mdh.PortOfCallLast30Days[i].PortOfCallLast30DaysLocode;
} }
} }
rootMDH.Items = mdhItems.ToArray();
rootMDH.ItemsElementName = choiceTypes2.ToArray();
} }
item = rootMDH; item = rootMDH;

View File

@ -1163,13 +1163,16 @@ namespace bsmd.herberg.FormService
} }
// sanitize GISIS code // sanitize GISIS code
if (changedPfC)
{
if (poc.PortFacilityGISISCode.IsNullOrEmpty()) if (poc.PortFacilityGISISCode.IsNullOrEmpty())
{ {
poc.PortFacilityGISISCode = "0000"; poc.PortFacilityGISISCode = "0000";
if (poc.PortFacilitySecurityMattersToReport.IsNullOrEmpty()) poc.PortFacilitySecurityMattersToReport = string.Format("Remark: GISIS-Code not reported"); if (poc.PortFacilitySecurityMattersToReport.IsNullOrEmpty()) poc.PortFacilitySecurityMattersToReport = string.Format("Remark: GISIS-Code not reported");
else poc.PortFacilitySecurityMattersToReport = string.Format("{0} - Remark: GISIS-Code not reported", poc.PortFacilitySecurityMattersToReport); else poc.PortFacilitySecurityMattersToReport = string.Format("{0} - Remark: GISIS-Code not reported", poc.PortFacilitySecurityMattersToReport);
} }
else { else
{
Regex rgx = new Regex("[0-9]{4}"); Regex rgx = new Regex("[0-9]{4}");
if (!rgx.IsMatch(poc.PortFacilityGISISCode)) if (!rgx.IsMatch(poc.PortFacilityGISISCode))
{ {
@ -1179,6 +1182,8 @@ namespace bsmd.herberg.FormService
else poc.PortFacilitySecurityMattersToReport = string.Format("{0} - Remark: Reported GISIS-Code: {1}", poc.PortFacilitySecurityMattersToReport, sDict["PortFacilityGISISCode"] ?? ""); else poc.PortFacilitySecurityMattersToReport = string.Format("{0} - Remark: Reported GISIS-Code: {1}", poc.PortFacilitySecurityMattersToReport, sDict["PortFacilityGISISCode"] ?? "");
} }
} }
}
if (sDict.ContainsKey("ShipToShipActivityLocationName")) { sts.ShipToShipActivityLocationName = sDict["ShipToShipActivityLocationName"]; changedStS = true; } if (sDict.ContainsKey("ShipToShipActivityLocationName")) { sts.ShipToShipActivityLocationName = sDict["ShipToShipActivityLocationName"]; changedStS = true; }
if (sDict.ContainsKey("ShipToShipActivityLocationLoCode") && sDict.ContainsKey("ShipToShipActivityCountryCode") && (sDict["ShipToShipActivityLocationLoCode"].Length < 4)) if (sDict.ContainsKey("ShipToShipActivityLocationLoCode") && sDict.ContainsKey("ShipToShipActivityCountryCode") && (sDict["ShipToShipActivityLocationLoCode"].Length < 4))
@ -1663,6 +1668,8 @@ namespace bsmd.herberg.FormService
} }
} }
XtraLogic.ProcessMessage(aMessageCore, messages);
DBManager.Instance.Save(aMessageCore); DBManager.Instance.Save(aMessageCore);
} }
} }

View File

@ -0,0 +1,77 @@
//
// Class: XtraLogic
// Current CLR: 4.0.30319.42000
// System: Microsoft Visual Studio 10.0
// Author: dani
// Created: 11/21/2015 1:31:37 PM
//
// Copyright (c) 2015 Informatikbüro Daniel Schick. All rights reserved.
using System;
using System.Collections.Generic;
using log4net;
using bsmd.database;
namespace bsmd.herberg.FormService
{
public class XtraLogic
{
private static ILog _log = LogManager.GetLogger(typeof(XtraLogic));
/// <summary>
/// Diese Klasse implementiert Logik, die von BSMD separat definiert wurde, z.B. zur Vereinfachung
/// der Bearbeitung. Diese Logik ist nicht Teil der NSW Spezifikation. Sie wird nach dem kompletten Einlesen / Update
/// eines Anlaufs ausgeführt (HE).
/// </summary>
internal static void ProcessMessage(MessageCore core, Dictionary<string, Message> messageDict)
{
// Regel 1: 20.11.2015
// Fehlermeldung: MDH List of Ports during the last 30 days = leer
// => Automatische Übernahme des Letzten Hafens und des entsprechenden Abfahrtsdatums (NOA_NOD),
// damit entfällt manuelle Nachbearbeitung.
if(messageDict.ContainsKey("MDH") && messageDict.ContainsKey("NOA_NOD"))
{
MDH mdh = null;
NOA_NOD noa_nod = null;
if (messageDict["MDH"].Elements.Count > 0)
mdh = messageDict["MDH"].Elements[0] as MDH;
if (messageDict["NOA_NOD"].Elements.Count > 0)
noa_nod = messageDict["NOA_NOD"].Elements[0] as NOA_NOD;
if ((mdh != null) && (noa_nod != null))
{
if (!(mdh.MDHSimplification ?? false))
{
if (mdh.PortOfCallLast30Days.Count == 0)
{
PortOfCallLast30Days poc30 = new PortOfCallLast30Days();
poc30.PortOfCallLast30DaysCrewMembersJoined = false;
poc30.PortOfCallLast30DaysDateOfDeparture = noa_nod.ETDFromLastPort;
poc30.PortOfCallLast30DaysLocode = noa_nod.LastPort;
poc30.MDH = mdh;
mdh.PortOfCallLast30Days.Add(poc30);
DBManager.Instance.Save(poc30);
_log.InfoFormat("adding POCLast30Days for MDH. Port:{0} Departure:{1}", noa_nod.LastPort ?? "",
noa_nod.ETDFromLastPort ?? DateTime.MinValue);
}
}
}
}
/// Regel 2: Bei Transit wird der Port auf (ZZ)NOK gesetzt
/// In dashface wird "ETA" angezeigt, ich setze hier daher ETA auf ETAKielCanal
/// 20.11.2015
if (core.IsTransit)
{
core.Portname = "NOK";
core.PoC = "ZZNOK";
core.ETA = core.ETAKielCanal;
}
}
}
}

View File

@ -97,6 +97,7 @@
<DesignTime>True</DesignTime> <DesignTime>True</DesignTime>
<DependentUpon>Reference.map</DependentUpon> <DependentUpon>Reference.map</DependentUpon>
</Compile> </Compile>
<Compile Include="XtraLogic.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="App.config"> <None Include="App.config">