NSW 3.3.13

This commit is contained in:
Daniel Schick 2017-02-01 21:00:29 +00:00
parent e2c4fbd05c
commit df14b19c4c
17 changed files with 3351 additions and 23 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -225,6 +225,25 @@ namespace bsmd.ExcelReadService
return result; return result;
} }
internal byte? ReadCargoHandlingType(string lookup)
{
string val = this.ReadText(lookup);
byte? result = null;
if(val != null)
{
if (val.IndexOf("load", StringComparison.OrdinalIgnoreCase) >= 0) result = 0;
if (val.IndexOf("discharge", StringComparison.OrdinalIgnoreCase) >= 0) result = 1;
if (val.IndexOf("transit", StringComparison.OrdinalIgnoreCase) >= 0) result = 2;
if (result == null)
this.Conf.ConfirmText(lookup, val, ReadState.WARN);
else
this.Conf.ConfirmText(lookup, val, ReadState.OK);
}
return result;
}
/// <summary> /// <summary>
/// read nationality field an returns 2 Char ISO code (optional lookup) and "confirms" /// read nationality field an returns 2 Char ISO code (optional lookup) and "confirms"
/// the field /// the field

View File

@ -760,7 +760,7 @@ namespace bsmd.ExcelReadService
{ {
string ibc_productName = string.Format("HAZD.IBC.ProductName_{0}", i); string ibc_productName = string.Format("HAZD.IBC.ProductName_{0}", i);
string ibc_pollutionCategory = string.Format("HAZD.IBC.PollutionCategory_{0}", i); string ibc_pollutionCategory = string.Format("HAZD.IBC.PollutionCategory_{0}", i);
string ibc_flash = string.Format("HAZD.IBC.FlashpointInformation_{0}", i); string ibc_flash = string.Format("HAZD.IBC.Flashpoint_CEL_{0}", i);
string ibc_quantity = string.Format("HAZD.IBC.Quantity_KGM_{0}", i); string ibc_quantity = string.Format("HAZD.IBC.Quantity_KGM_{0}", i);
string ibc_stowagePosition = string.Format("HAZD.IBC.StowagePosition_{0}", i); string ibc_stowagePosition = string.Format("HAZD.IBC.StowagePosition_{0}", i);
string ibc_portOfLoading = string.Format("HAZD.IBC.PortOfLoading_{0}", i); string ibc_portOfLoading = string.Format("HAZD.IBC.PortOfLoading_{0}", i);
@ -966,7 +966,7 @@ namespace bsmd.ExcelReadService
STAT stat = statMessage.Elements[0] as STAT; STAT stat = statMessage.Elements[0] as STAT;
Util.ScanMessage(stat, reader); Util.ScanMessage(stat, reader);
stat.MMSINumber = reader.ReadTextNoWhitespace("STAT.MMSINumber"); stat.MMSINumber = reader.ReadTextNoWhitespace("STAT.MMSINumber");
reader.Conf.ConfirmText("STAT.MMSINumber", stat.MMSINumber, (stat.MMSINumber.IsNullOrEmpty() || (stat.MMSINumber.Length != 7)) ? ExcelReader.ReadState.FAIL : ExcelReader.ReadState.OK); reader.Conf.ConfirmText("STAT.MMSINumber", stat.MMSINumber, (stat.MMSINumber.IsNullOrEmpty() || (stat.MMSINumber.Length != 9)) ? ExcelReader.ReadState.FAIL : ExcelReader.ReadState.OK);
stat.ISMCompanyId = reader.ReadTextNoWhitespace("STAT.ISMCompanyId"); stat.ISMCompanyId = reader.ReadTextNoWhitespace("STAT.ISMCompanyId");
if(!stat.ISMCompanyId.IsNullOrEmpty() && stat.ISMCompanyId.Length < 7) if(!stat.ISMCompanyId.IsNullOrEmpty() && stat.ISMCompanyId.Length < 7)
@ -1216,7 +1216,9 @@ namespace bsmd.ExcelReadService
if (reader.Mode == ExcelReader.CountryMode.DE) if (reader.Mode == ExcelReader.CountryMode.DE)
{ {
reader.Conf.ConfirmText(wastetype, waste.WasteTypeDisplayV4, ExcelReader.ReadState.OK); waste.WasteType = i; // remove for V4
// change for V4
reader.Conf.ConfirmText(wastetype, waste.WasteTypeDisplay, ExcelReader.ReadState.OK);
reader.Conf.ConfirmNumber(wasteCode, waste.WasteType, ExcelReader.ReadState.OK); reader.Conf.ConfirmNumber(wasteCode, waste.WasteType, ExcelReader.ReadState.OK);
} }
else if (reader.Mode == ExcelReader.CountryMode.DK) else if (reader.Mode == ExcelReader.CountryMode.DK)
@ -1935,16 +1937,7 @@ namespace bsmd.ExcelReadService
ladgMessage.Elements.Add(ladg); ladgMessage.Elements.Add(ladg);
} }
string handlingTypeString = reader.ReadText(lnCHT); ladg.CargoHandlingType = reader.ReadCargoHandlingType(lnCHT);
if (!handlingTypeString.IsNullOrEmpty())
{
// irgendwas mit "*load*" drin wird load, alles andere discharge
ladg.CargoHandlingType = handlingTypeString.Contains("load", StringComparison.InvariantCultureIgnoreCase) ? (byte) 0 : (byte) 1;
reader.Conf.ConfirmText(lnCHT, handlingTypeString, ExcelReader.ReadState.OK);
} else
{
reader.Conf.ConfirmText(lnCHT, handlingTypeString, ExcelReader.ReadState.WARN);
}
ladg.CargoCodeNST = reader.ReadText(lnType); ladg.CargoCodeNST = reader.ReadText(lnType);
// Cargo Type Freitext in DK // Cargo Type Freitext in DK

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("3.3.12")] [assembly: AssemblyInformationalVersion("3.3.13")]
[assembly: AssemblyCopyright("Copyright © 2014-2017 Informatikbüro Daniel Schick. All rights reserved.")] [assembly: AssemblyCopyright("Copyright © 2014-2017 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("3.3.12.*")] [assembly: AssemblyVersion("3.3.13.*")]

View File

@ -591,20 +591,25 @@ namespace bsmd.dbh
case Message.NotificationClass.LADG: case Message.NotificationClass.LADG:
{ {
RootLADG rootLADG = new RootLADG(); RootLADG rootLADG = new RootLADG();
rootLADG.Cargo = new RootLADGCargo[message.Elements.Count]; List<RootLADGCargo> cargoList = new List<RootLADGCargo>();
for (int i = 0; i < message.Elements.Count; i++ ) for (int i = 0; i < message.Elements.Count; i++ )
{ {
LADG ladg = message.Elements[i] as LADG; LADG ladg = message.Elements[i] as LADG;
rootLADG.Cargo[i] = new RootLADGCargo(); RootLADGCargo cargo = new RootLADGCargo();
if(ladg.CargoHandlingType.HasValue) if (ladg.CargoHandlingType.HasValue)
rootLADG.Cargo[i].CargoHandlingType = (HandlingType)(ladg.CargoHandlingType); {
rootLADG.Cargo[i].CargoCodeNST = ladg.CargoCodeNST; if (ladg.CargoHandlingType > 1) continue;
cargo.CargoHandlingType = (HandlingType)(ladg.CargoHandlingType);
}
cargo.CargoCodeNST = ladg.CargoCodeNST;
if (ladg.CargoGrossQuantity_TNE.HasValue) if (ladg.CargoGrossQuantity_TNE.HasValue)
rootLADG.Cargo[i].CargoGrossQuantity_TNE = Decimal.Round((decimal) ladg.CargoGrossQuantity_TNE.Value, 3); cargo.CargoGrossQuantity_TNE = Decimal.Round((decimal) ladg.CargoGrossQuantity_TNE.Value, 3);
rootLADG.Cargo[i].CargoNumberOfItemsSpecified = ladg.CargoNumberOfItems.HasValue; cargo.CargoNumberOfItemsSpecified = ladg.CargoNumberOfItems.HasValue;
if (ladg.CargoNumberOfItems.HasValue) if (ladg.CargoNumberOfItems.HasValue)
rootLADG.Cargo[i].CargoNumberOfItems = ladg.CargoNumberOfItems.Value; cargo.CargoNumberOfItems = ladg.CargoNumberOfItems.Value;
cargoList.Add(cargo);
} }
rootLADG.Cargo = cargoList.ToArray();
item = rootLADG; item = rootLADG;
} }
break; break;

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="log4net" version="2.0.7" targetFramework="net45" />
</packages>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,244 @@
<?xml version="1.0" encoding="utf-8" ?>
<!--Created with Liquid XML Studio - FREE Community Edition 7.0.3.780 (http://www.liquid-technologies.com)-->
<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="Root">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="Version">
<xs:annotation>
<xs:documentation>Version number of schema</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="1" />
<xs:maxLength value="5" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="MessageId" type="xs:string">
<xs:annotation>
<xs:documentation>Unique message identifier.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="VisitId">
<xs:annotation>
<xs:documentation>Required when TransitId is missing and field "Type" is not "VISIT or "TRANSIT"</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="(DE)([A-Z]{3})-([0-9]{4})-([A-Z]{6})" />
<xs:length value="17" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element minOccurs="0" name="TransitId">
<xs:annotation>
<xs:documentation>Required when VisitId is missing and field "Type" is not "VISIT or "TRANSIT"</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="(ZZNOK)-([0-9]{4})-([A-Z]{6})" />
<xs:length value="17" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element minOccurs="0" name="SisNumbers">
<xs:annotation>
<xs:documentation>A list of SIS numbers. An empty list means that all sent numbers will be deleted. Sending a new list overwrites existing ones completely.</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" name="SisNumber">
<xs:annotation>
<xs:documentation>One SIS number</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="[A-Z0-9]{4}" />
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Timestamp" type="xs:dateTime">
<xs:annotation>
<xs:documentation>Timestamp, when the message is sent</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="SenderReference">
<xs:annotation>
<xs:documentation>A customer reference that can be freely filled and will be send back in the following response. No checks are made on this field. When a new Visit- or TransitId is obtained, it should be used as a reference to match the response to its corresponding request.</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="35" />
<xs:minLength value="0" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Type">
<xs:annotation>
<xs:documentation>The message type (should be the same as in the request message):
- VISIT: Creates a new declaration with the application for a VisitId. It's allowed to send further data in one or more reporting classes
- TRANSIT: same with TransitId
- DATA: Only data for one or more reporting classes are included
- RESET: The data of one or more reporting classes are deleted
- CANCEL: The whole declaration is cancelled</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="VISIT" />
<xs:enumeration value="TRANSIT" />
<xs:enumeration value="DATA" />
<xs:enumeration value="RESET" />
<xs:enumeration value="CANCEL" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element minOccurs="0" name="ReportingClassesFull">
<xs:annotation>
<xs:documentation>Reporting classes that are received with all necessary data.</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="ReportingClass" type="ReportingClassCode">
<xs:annotation>
<xs:documentation>The code of a reporting class.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element minOccurs="0" name="ReportingClassesPartial">
<xs:annotation>
<xs:documentation>Reporting classes that are received with some data missing (see Messages for errors/violations).</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="ReportingClass" type="ReportingClassCode">
<xs:annotation>
<xs:documentation>The code of a reporting class.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element minOccurs="0" name="ReportingClassesError">
<xs:annotation>
<xs:documentation>Reporting classes that are received with some data missing (see Messages for errors/violations).</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="ReportingClass" type="ReportingClassCode">
<xs:annotation>
<xs:documentation>The code of a reporting class.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element minOccurs="0" name="ReportingClassesResetted">
<xs:annotation>
<xs:documentation>Reporting classes that are resetted (due to a message with Type RESET).</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="ReportingClass" type="ReportingClassCode">
<xs:annotation>
<xs:documentation>The code of a reporting class.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Messages">
<xs:annotation>
<xs:documentation>Errors, Violations, etc.</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" name="Message">
<xs:complexType>
<xs:sequence>
<xs:element name="ID">
<xs:annotation>
<xs:documentation>ID (given from NSW)</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="3" />
<xs:maxLength value="4" />
<xs:pattern value="([1-9][0-9]{2,3})" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Type">
<xs:annotation>
<xs:documentation>Type of Message (functional error, process error in report, process error in message basket, process error during status request, or violation)</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="INFO" />
<xs:enumeration value="WARNING" />
<xs:enumeration value="VIOLATION" />
<xs:enumeration value="ERROR" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Location">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="1" />
<xs:maxLength value="32" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Text">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="1" />
<xs:maxLength value="255" />
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:simpleType name="ReportingClassCode">
<xs:restriction base="xs:string">
<xs:enumeration value="NOA_NOD" />
<xs:enumeration value="ATA" />
<xs:enumeration value="ATD" />
<xs:enumeration value="SEC" />
<xs:enumeration value="AGNT" />
<xs:enumeration value="POBA" />
<xs:enumeration value="POBD" />
<xs:enumeration value="NAME" />
<xs:enumeration value="TIEFA" />
<xs:enumeration value="TIEFD" />
<xs:enumeration value="BKRA" />
<xs:enumeration value="BKRD" />
<xs:enumeration value="STAT" />
<xs:enumeration value="LADG" />
<xs:enumeration value="INFO" />
<xs:enumeration value="SERV" />
<xs:enumeration value="PRE72H" />
<xs:enumeration value="MDH" />
<xs:enumeration value="WAS" />
<xs:enumeration value="CREW" />
<xs:enumeration value="PAS" />
<xs:enumeration value="BPOL" />
<xs:enumeration value="TOWA" />
<xs:enumeration value="TOWD" />
<xs:enumeration value="HAZA" />
<xs:enumeration value="HAZD" />
</xs:restriction>
</xs:simpleType>
</xs:schema>