7.0.0.14: Korrekturen für die Verarbeitung des alten Sheets
This commit is contained in:
parent
521d7a3967
commit
8c521d16a1
@ -75,7 +75,7 @@
|
|||||||
<Label HorizontalAlignment="Right" Grid.Row="4" Grid.Column="0" Content="{x:Static p:Resources.textTicketNo}" Margin="0,0,10,0" />
|
<Label HorizontalAlignment="Right" Grid.Row="4" Grid.Column="0" Content="{x:Static p:Resources.textTicketNo}" Margin="0,0,10,0" />
|
||||||
<Label HorizontalContentAlignment="Right" Grid.Row="4" Grid.Column="3" Content="{x:Static p:Resources.textCreated}" Margin="0,0,10,0" />
|
<Label HorizontalContentAlignment="Right" Grid.Row="4" Grid.Column="3" Content="{x:Static p:Resources.textCreated}" Margin="0,0,10,0" />
|
||||||
<Label Name="labelCreated" Grid.Column="4" Grid.Row="4" Margin="2, 0, 0, 0" />
|
<Label Name="labelCreated" Grid.Column="4" Grid.Row="4" Margin="2, 0, 0, 0" />
|
||||||
<Button Name="buttonFormblattNeu" Grid.Column="5" Grid.Row="4" Margin="2" Click="buttonFormblattNeu_Click" >
|
<Button Name="buttonFormblattNeu" Grid.Column="5" Grid.Row="7" Margin="2" Click="buttonFormblattNeu_Click" >
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<TextBlock Text="Formblatt neu"></TextBlock>
|
<TextBlock Text="Formblatt neu"></TextBlock>
|
||||||
<Image Source="../Resources/excel.png" Margin="10,0,5,0" Height="16"/>
|
<Image Source="../Resources/excel.png" Margin="10,0,5,0" Height="16"/>
|
||||||
@ -129,7 +129,7 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<StackPanel Orientation="Horizontal" Grid.Column="5" Grid.Row="7" Visibility="Hidden" Name="stackPanelLock">
|
<StackPanel Orientation="Horizontal" Grid.Column="5" Grid.Row="4" Visibility="Hidden" Name="stackPanelLock">
|
||||||
<Image Source="../Resources/lock.png" Margin="0,0,5,0" Height="24" />
|
<Image Source="../Resources/lock.png" Margin="0,0,5,0" Height="24" />
|
||||||
<TextBlock Name="textBlockLockUserName" VerticalAlignment="Center" />
|
<TextBlock Name="textBlockLockUserName" VerticalAlignment="Center" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|||||||
@ -774,7 +774,7 @@ namespace ENI2.DetailViewControls
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void buttonFormblattNeu_Click(object sender, RoutedEventArgs e)
|
private void buttonFormblattNeu_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
string filename = string.Format("{0}_{1}_EU-NoAD-Data-Collecting-Tool-5_0.xlsx", this.Core.Shipname, this.Core.DisplayId);
|
string filename = string.Format("{0}_EU-NoAD-Data-Collecting-Tool-5_0.xlsx", this.Core.Shipname);
|
||||||
this.ExportData(filename, false);
|
this.ExportData(filename, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -36,8 +36,8 @@
|
|||||||
<MinimumRequiredVersion>5.4.0.0</MinimumRequiredVersion>
|
<MinimumRequiredVersion>5.4.0.0</MinimumRequiredVersion>
|
||||||
<CreateWebPageOnPublish>true</CreateWebPageOnPublish>
|
<CreateWebPageOnPublish>true</CreateWebPageOnPublish>
|
||||||
<WebPage>publish.html</WebPage>
|
<WebPage>publish.html</WebPage>
|
||||||
<ApplicationRevision>13</ApplicationRevision>
|
<ApplicationRevision>14</ApplicationRevision>
|
||||||
<ApplicationVersion>7.0.0.13</ApplicationVersion>
|
<ApplicationVersion>7.0.0.14</ApplicationVersion>
|
||||||
<UseApplicationTrust>false</UseApplicationTrust>
|
<UseApplicationTrust>false</UseApplicationTrust>
|
||||||
<CreateDesktopShortcut>true</CreateDesktopShortcut>
|
<CreateDesktopShortcut>true</CreateDesktopShortcut>
|
||||||
<PublishWizardCompleted>true</PublishWizardCompleted>
|
<PublishWizardCompleted>true</PublishWizardCompleted>
|
||||||
|
|||||||
@ -114,8 +114,11 @@ namespace ENI2.Excel
|
|||||||
{
|
{
|
||||||
result = 2;
|
result = 2;
|
||||||
}
|
}
|
||||||
else if (val.Equals("n", StringComparison.CurrentCultureIgnoreCase) || val.Equals("not applicable", StringComparison.CurrentCultureIgnoreCase) ||
|
else if (val.Equals("n", StringComparison.CurrentCultureIgnoreCase) ||
|
||||||
val.Equals("d", StringComparison.CurrentCultureIgnoreCase) || val.Equals("diverse", StringComparison.CurrentCultureIgnoreCase))
|
val.Equals("not applicable", StringComparison.CurrentCultureIgnoreCase) ||
|
||||||
|
val.Equals("not_applicable", StringComparison.CurrentCultureIgnoreCase) ||
|
||||||
|
val.Equals("d", StringComparison.CurrentCultureIgnoreCase) ||
|
||||||
|
val.Equals("diverse", StringComparison.CurrentCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
result = 9;
|
result = 9;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1171,8 +1171,20 @@ namespace ENI2.Excel
|
|||||||
was.Waste.Add(waste);
|
was.Waste.Add(waste);
|
||||||
}
|
}
|
||||||
|
|
||||||
waste.WasteType = (int?) reader.ReadNumber(wasteCode);
|
waste.WasteType = (int?) reader.ReadNumber(wasteCode);
|
||||||
|
// falls ein altes Sheet eingelesen wird, diese Felder automatisch mappen
|
||||||
|
if (waste.WasteType == 1100) waste.WasteType = 102;
|
||||||
|
if (waste.WasteType == 1200) waste.WasteType = 101;
|
||||||
|
if (waste.WasteType == 1300) waste.WasteType = 999;
|
||||||
|
if (waste.WasteType == 2100) waste.WasteType = 502;
|
||||||
|
if (waste.WasteType == 2200) waste.WasteType = 501;
|
||||||
|
if (waste.WasteType == 2300) waste.WasteType = 503;
|
||||||
|
if (waste.WasteType == 2311) waste.WasteType = 504;
|
||||||
|
if (waste.WasteType == 2308) waste.WasteType = 505;
|
||||||
|
if (waste.WasteType == 2313) waste.WasteType = 506;
|
||||||
|
if (waste.WasteType == 2309) waste.WasteType = 507;
|
||||||
|
if (waste.WasteType == 3000) waste.WasteType = 401;
|
||||||
|
if (waste.WasteType == 2600) waste.WasteType = 506;
|
||||||
|
|
||||||
// Waste description Spezialfälle für DK
|
// Waste description Spezialfälle für DK
|
||||||
waste.WasteDescription = reader.ReadText(wasteDescription);
|
waste.WasteDescription = reader.ReadText(wasteDescription);
|
||||||
@ -1204,25 +1216,25 @@ namespace ENI2.Excel
|
|||||||
if((reader.Mode == ExcelReader.CountryMode.DK) && (i==9))
|
if((reader.Mode == ExcelReader.CountryMode.DK) && (i==9))
|
||||||
{
|
{
|
||||||
_log.DebugFormat("DK: Changing Waste code {0} to 2300 for line {1}", waste.WasteType, i);
|
_log.DebugFormat("DK: Changing Waste code {0} to 2300 for line {1}", waste.WasteType, i);
|
||||||
waste.WasteType = 2300;
|
waste.WasteType = 2300;
|
||||||
}
|
}
|
||||||
|
|
||||||
waste.WasteDisposalAmount_MTQ = reader.ReadNumberDefaultZero(wasteAmount);
|
waste.WasteDisposalAmount_MTQ = reader.ReadNumberDefaultZero(wasteAmount);
|
||||||
waste.WasteCapacity_MTQ = reader.ReadNumberDefaultZero(wasteCapacity);
|
waste.WasteCapacity_MTQ = reader.ReadNumberDefaultZero(wasteCapacity);
|
||||||
waste.WasteAmountRetained_MTQ = reader.ReadNumberDefaultZero(wasteRetained);
|
waste.WasteAmountRetained_MTQ = reader.ReadNumberDefaultZero(wasteRetained);
|
||||||
|
|
||||||
waste.WasteDisposalPort = reader.ReadLoCode(wastePort); // aka RemainingWasteDisposalPort
|
waste.WasteDisposalPort = reader.ReadLoCode(wastePort); // aka RemainingWasteDisposalPort
|
||||||
|
|
||||||
if (waste.WasteDisposalPort.IsNullOrEmpty())
|
if (waste.WasteDisposalPort.IsNullOrEmpty())
|
||||||
{
|
{
|
||||||
waste.WasteDisposalPort = "ZZUKN";
|
waste.WasteDisposalPort = "ZZUKN";
|
||||||
}
|
}
|
||||||
|
|
||||||
waste.WasteAmountGeneratedTillNextPort_MTQ = reader.ReadNumberDefaultZero(amountGen);
|
waste.WasteAmountGeneratedTillNextPort_MTQ = reader.ReadNumberDefaultZero(amountGen);
|
||||||
|
|
||||||
if (!waste.WasteType.HasValue)
|
if (!waste.WasteType.HasValue)
|
||||||
{
|
{
|
||||||
was.Waste.Remove(waste);
|
was.Waste.Remove(waste);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -156,15 +156,17 @@ namespace ENI2.Excel
|
|||||||
case Message.NotificationClass.TIEFA:
|
case Message.NotificationClass.TIEFA:
|
||||||
if (message.Elements[0] is TIEFA tiefa)
|
if (message.Elements[0] is TIEFA tiefa)
|
||||||
{
|
{
|
||||||
|
// Ref-Sheet: dm, neues Formblatt: m
|
||||||
if (tiefa.DraughtUponArrival_DMT.HasValue)
|
if (tiefa.DraughtUponArrival_DMT.HasValue)
|
||||||
WriteNumber("TIEFA.DraughtUponArrival_DMT", tiefa.DraughtUponArrival_DMT.Value / 10.0);
|
WriteNumber("TIEFA.DraughtUponArrival_DMT", tiefa.DraughtUponArrival_DMT.Value / (isRefSheet ? 1 : 10.0));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Message.NotificationClass.TIEFD:
|
case Message.NotificationClass.TIEFD:
|
||||||
if (message.Elements[0] is TIEFD tiefd)
|
if (message.Elements[0] is TIEFD tiefd)
|
||||||
{
|
{
|
||||||
|
// Ref-Sheet: dm, neues Formblatt: m
|
||||||
if (tiefd.DraughtUponDeparture_DMT.HasValue)
|
if (tiefd.DraughtUponDeparture_DMT.HasValue)
|
||||||
WriteNumber("TIEFD.DraughtUponDeparture_DMT", tiefd.DraughtUponDeparture_DMT.Value / 10.0);
|
WriteNumber("TIEFD.DraughtUponDeparture_DMT", tiefd.DraughtUponDeparture_DMT.Value / (isRefSheet ? 1 : 10.0));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Message.NotificationClass.TOWA:
|
case Message.NotificationClass.TOWA:
|
||||||
@ -192,7 +194,7 @@ namespace ENI2.Excel
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
WriteCore(core);
|
WriteCore(core, isRefSheet);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -267,10 +269,10 @@ namespace ENI2.Excel
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void WriteCore(MessageCore core)
|
private void WriteCore(MessageCore core, bool isRefSheet)
|
||||||
{
|
{
|
||||||
WriteText("ID", core.IsTransit ? core.TransitId : core.VisitId);
|
WriteText("ID", core.IsTransit ? core.TransitId : core.VisitId);
|
||||||
WriteText("Visit.PortOfCall", core.PoC);
|
WriteText("Visit.PortOfCall", isRefSheet ? core.PoC : Locode.LocodeDB.LocationNameFromLocode(core.PoC));
|
||||||
WriteText("Visit.IMONumber", core.IMO);
|
WriteText("Visit.IMONumber", core.IMO);
|
||||||
WriteText("ReferenceNumber", core.HerbergReportType);
|
WriteText("ReferenceNumber", core.HerbergReportType);
|
||||||
WriteText("ShipMail", core.HerbergEmailContactReportingVessel);
|
WriteText("ShipMail", core.HerbergEmailContactReportingVessel);
|
||||||
@ -312,7 +314,7 @@ namespace ENI2.Excel
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (ReportDocument.cargoCodesNST.TryGetValue(ladg.CargoCodeNST, out string cargoCode))
|
if (ReportDocument.cargoCodesNST.TryGetValue(ladg.CargoCodeNST, out string cargoCode))
|
||||||
WriteText(lnType, cargoCode);
|
WriteText(lnType, cargoCode.Substring(3)); // description w/o code
|
||||||
}
|
}
|
||||||
WriteText(lnZusatz, ladg.CargoCodeNST_3);
|
WriteText(lnZusatz, ladg.CargoCodeNST_3);
|
||||||
WriteNumber(lnCNOI, ladg.CargoNumberOfItems);
|
WriteNumber(lnCNOI, ladg.CargoNumberOfItems);
|
||||||
@ -412,7 +414,10 @@ namespace ENI2.Excel
|
|||||||
|
|
||||||
WriteText(crewLastName, crew.CrewMemberLastName);
|
WriteText(crewLastName, crew.CrewMemberLastName);
|
||||||
WriteText(crewFirstName, crew.CrewMemberFirstName);
|
WriteText(crewFirstName, crew.CrewMemberFirstName);
|
||||||
WriteGender(crewGender, crew.CrewMemberGender);
|
if (isRefSheet)
|
||||||
|
WriteGenderCode(crewGender, crew.CrewMemberGender);
|
||||||
|
else
|
||||||
|
WriteGenderFull(crewGender, crew.CrewMemberGender);
|
||||||
WriteText(crewNationality, crew.CrewMemberNationality);
|
WriteText(crewNationality, crew.CrewMemberNationality);
|
||||||
WriteText(crewDuty, crew.CrewMemberDuty);
|
WriteText(crewDuty, crew.CrewMemberDuty);
|
||||||
WriteText(crewPlaceOfBirth, crew.CrewMemberPlaceOfBirth);
|
WriteText(crewPlaceOfBirth, crew.CrewMemberPlaceOfBirth);
|
||||||
@ -820,7 +825,10 @@ namespace ENI2.Excel
|
|||||||
|
|
||||||
WriteText(pasLastName, pas.PassengerLastName);
|
WriteText(pasLastName, pas.PassengerLastName);
|
||||||
WriteText(pasFirstName, pas.PassengerFirstName);
|
WriteText(pasFirstName, pas.PassengerFirstName);
|
||||||
WriteGender(pasGender, pas.PassengerGender);
|
if (isRefSheet)
|
||||||
|
WriteGenderCode(pasGender, pas.PassengerGender);
|
||||||
|
else
|
||||||
|
WriteGenderFull(pasGender, pas.PassengerGender);
|
||||||
WriteText(pasNationality, pas.PassengerNationality);
|
WriteText(pasNationality, pas.PassengerNationality);
|
||||||
WriteText(pasEmbarkation, pas.PassengerPortOfEmbarkation);
|
WriteText(pasEmbarkation, pas.PassengerPortOfEmbarkation);
|
||||||
WriteText(pasDebarkation, pas.PassengerPortOfDisembarkation);
|
WriteText(pasDebarkation, pas.PassengerPortOfDisembarkation);
|
||||||
@ -1104,9 +1112,9 @@ namespace ENI2.Excel
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
WriteText("WAS.LastWasteDisposalPort", was.LastWasteDisposalPort);
|
WriteText("WAS.LastWasteDisposalPort", isRefSheet ? was.LastWasteDisposalPort : Locode.LocodeDB.LocationNameFromLocode(was.LastWasteDisposalPort));
|
||||||
WriteText("WAS.WasteDisposalServiceProviderName", was.WasteDisposalServiceProviderText);
|
WriteText("WAS.WasteDisposalServiceProviderName", was.WasteDisposalServiceProviderText);
|
||||||
WriteText("WAS.NextWasteDisposalPort", was.NextWasteDisposalPort);
|
WriteText("WAS.NextWasteDisposalPort", isRefSheet? was.NextWasteDisposalPort : Locode.LocodeDB.LocationNameFromLocode(was.NextWasteDisposalPort));
|
||||||
WriteBoolean("WAS.ConfirmationOfCorrectness", true);
|
WriteBoolean("WAS.ConfirmationOfCorrectness", true);
|
||||||
WriteBoolean("WAS.ConfirmationOfSufficiency", true);
|
WriteBoolean("WAS.ConfirmationOfSufficiency", true);
|
||||||
|
|
||||||
@ -1240,7 +1248,7 @@ namespace ENI2.Excel
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (LocalizedLookup.getVesselTypes().TryGetValue(stat.ShipType, out string shipType))
|
if (LocalizedLookup.getVesselTypes().TryGetValue(stat.ShipType, out string shipType))
|
||||||
WriteText("STAT.ShipType", shipType);
|
WriteText("STAT.ShipType", shipType.Substring(3));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1280,7 +1288,7 @@ namespace ENI2.Excel
|
|||||||
|
|
||||||
#region write simple things
|
#region write simple things
|
||||||
|
|
||||||
private void WriteGender(string label, byte? gender)
|
private void WriteGenderCode(string label, byte? gender)
|
||||||
{
|
{
|
||||||
if(gender.HasValue)
|
if(gender.HasValue)
|
||||||
{
|
{
|
||||||
@ -1291,6 +1299,17 @@ namespace ENI2.Excel
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void WriteGenderFull(string label, byte? gender)
|
||||||
|
{
|
||||||
|
if (gender.HasValue)
|
||||||
|
{
|
||||||
|
if (gender == 0) WriteText(label, "not known");
|
||||||
|
if (gender == 1) WriteText(label, "male");
|
||||||
|
if (gender == 2) WriteText(label, "female");
|
||||||
|
if (gender == 9) WriteText(label, "not applicable");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region write value types
|
#region write value types
|
||||||
|
|||||||
@ -175,8 +175,11 @@ namespace ENI2.Util
|
|||||||
{
|
{
|
||||||
result = 2;
|
result = 2;
|
||||||
}
|
}
|
||||||
else if (val.Equals("d", StringComparison.CurrentCultureIgnoreCase) || val.Equals("diverse", StringComparison.CurrentCultureIgnoreCase) ||
|
else if (val.Equals("d", StringComparison.CurrentCultureIgnoreCase) ||
|
||||||
val.Equals("n", StringComparison.CurrentCultureIgnoreCase) || val.Equals("not applicable", StringComparison.CurrentCultureIgnoreCase))
|
val.Equals("diverse", StringComparison.CurrentCultureIgnoreCase) ||
|
||||||
|
val.Equals("n", StringComparison.CurrentCultureIgnoreCase) ||
|
||||||
|
val.Equals("not_applicable", StringComparison.CurrentCultureIgnoreCase) ||
|
||||||
|
val.Equals("not applicable", StringComparison.CurrentCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
result = 9;
|
result = 9;
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
Loading…
Reference in New Issue
Block a user