diff options
author | CGantert345 <57003061+CGantert345@users.noreply.github.com> | 2021-03-26 16:17:13 +0100 |
---|---|---|
committer | CGantert345 <57003061+CGantert345@users.noreply.github.com> | 2021-03-26 16:17:13 +0100 |
commit | 8105ea23970d58a390c1df59fb041fadbb189d29 (patch) | |
tree | 2d9a64a55b107aad720cfa90f48b19619db66ef5 /src/org/uic/barcode/ticket/api/asn | |
parent | customer card fix and test (diff) | |
download | UIC-barcode-8105ea23970d58a390c1df59fb041fadbb189d29.tar UIC-barcode-8105ea23970d58a390c1df59fb041fadbb189d29.tar.gz UIC-barcode-8105ea23970d58a390c1df59fb041fadbb189d29.tar.bz2 UIC-barcode-8105ea23970d58a390c1df59fb041fadbb189d29.tar.lz UIC-barcode-8105ea23970d58a390c1df59fb041fadbb189d29.tar.xz UIC-barcode-8105ea23970d58a390c1df59fb041fadbb189d29.tar.zst UIC-barcode-8105ea23970d58a390c1df59fb041fadbb189d29.zip |
Diffstat (limited to 'src/org/uic/barcode/ticket/api/asn')
5 files changed, 26 insertions, 18 deletions
diff --git a/src/org/uic/barcode/ticket/api/asn/omv1/ParkingGroundData.java b/src/org/uic/barcode/ticket/api/asn/omv1/ParkingGroundData.java index 8119502..8142ee1 100644 --- a/src/org/uic/barcode/ticket/api/asn/omv1/ParkingGroundData.java +++ b/src/org/uic/barcode/ticket/api/asn/omv1/ParkingGroundData.java @@ -47,7 +47,7 @@ public class ParkingGroundData extends Object { @FieldOrder(order = 2)
@RestrictedString(CharacterRestriction.IA5String)
- public String parkingGroundId;
+ public String parkingGroundId = "";
@FieldOrder(order = 3)
@IntRange(minValue=0,maxValue=370)
@@ -335,7 +335,7 @@ public class ParkingGroundData extends Object { public Date getFromParkingDate(Date issuingDate){
- return DateTimeUtils.getDate(issuingDate, this.fromParkingDate, null);
+ return DateTimeUtils.getDate(issuingDate, this.fromParkingDate, 0L);
}
@@ -343,7 +343,7 @@ public class ParkingGroundData extends Object { if ( this.toParkingDate == null) return null;
- return DateTimeUtils.getDate(issuingDate, this.fromParkingDate + this.toParkingDate, null);
+ return DateTimeUtils.getDate(issuingDate, this.fromParkingDate + this.toParkingDate, 1439L);
}
diff --git a/src/org/uic/barcode/ticket/api/asn/omv1/VoucherData.java b/src/org/uic/barcode/ticket/api/asn/omv1/VoucherData.java index f721201..ab9eaea 100644 --- a/src/org/uic/barcode/ticket/api/asn/omv1/VoucherData.java +++ b/src/org/uic/barcode/ticket/api/asn/omv1/VoucherData.java @@ -21,7 +21,6 @@ package org.uic.barcode.ticket.api.asn.omv1; import java.util.Calendar;
import java.util.Date;
-import java.util.TimeZone;
import org.uic.barcode.asn1.datatypes.Asn1BigInteger;
import org.uic.barcode.asn1.datatypes.Asn1Optional;
@@ -287,9 +286,11 @@ public class VoucherData extends Object { Calendar cal = Calendar.getInstance();
cal.clear();
- cal.setTimeZone(TimeZone.getTimeZone("UTC"));
+ //cal.setTimeZone(TimeZone.getTimeZone("UTC"));
cal.set(Calendar.YEAR, this.validFromYear.intValue());
cal.set(Calendar.DAY_OF_YEAR, this.validFromDay.intValue());
+ cal.set(Calendar.MINUTE,0);
+ cal.set(Calendar.HOUR_OF_DAY,0);
return cal.getTime();
@@ -301,9 +302,11 @@ public class VoucherData extends Object { Calendar cal = Calendar.getInstance();
cal.clear();
- cal.setTimeZone(TimeZone.getTimeZone("UTC"));
+ //cal.setTimeZone(TimeZone.getTimeZone("UTC"));
cal.set(Calendar.YEAR, this.validUntilYear.intValue());
cal.set(Calendar.DAY_OF_YEAR, this.validUntilDay.intValue());
+ cal.set(Calendar.MINUTE,59);
+ cal.set(Calendar.HOUR_OF_DAY,23);
return cal.getTime();
diff --git a/src/org/uic/barcode/ticket/api/asn/omv2/CustomerCardData.java b/src/org/uic/barcode/ticket/api/asn/omv2/CustomerCardData.java index 4302f44..6ea31c1 100644 --- a/src/org/uic/barcode/ticket/api/asn/omv2/CustomerCardData.java +++ b/src/org/uic/barcode/ticket/api/asn/omv2/CustomerCardData.java @@ -262,14 +262,15 @@ public class CustomerCardData extends Object { public Date getValidFromDate (){
- if (this.validFromYear == null || this.validFromYear == 0) return null;
+ if (this.validFromYear == null || this.validFromDay == null) return null;
Calendar cal = Calendar.getInstance();
cal.clear();
- cal.setTimeZone(TimeZone.getTimeZone("UTC"));
+ //cal.setTimeZone(TimeZone.getTimeZone("UTC"));
cal.set(Calendar.YEAR, this.validFromYear.intValue());
cal.set(Calendar.DAY_OF_YEAR, this.validFromDay.intValue());
-
+ cal.set(Calendar.MINUTE,0);
+ cal.set(Calendar.HOUR_OF_DAY,0);
return cal.getTime();
}
@@ -277,17 +278,18 @@ public class CustomerCardData extends Object { public Date getValidUntilDate (){
- if (this.validUntilYear == null || this.validUntilYear == 0) return null;
+ if (this.validUntilYear == null || this.validUntilDay == null) return null;
Calendar cal = Calendar.getInstance();
cal.clear();
- cal.setTimeZone(TimeZone.getTimeZone("UTC"));
+ //cal.setTimeZone(TimeZone.getTimeZone("UTC"));
cal.set(Calendar.YEAR, this.validFromYear.intValue());
if (this.validUntilYear != null) {
cal.add(Calendar.YEAR, this.validUntilYear.intValue());
}
cal.set(Calendar.DAY_OF_YEAR, this.validUntilDay.intValue());
-
+ cal.set(Calendar.MINUTE,59);
+ cal.set(Calendar.HOUR_OF_DAY,23);
return cal.getTime();
}
diff --git a/src/org/uic/barcode/ticket/api/asn/omv2/ParkingGroundData.java b/src/org/uic/barcode/ticket/api/asn/omv2/ParkingGroundData.java index 4f6f6d8..0eec185 100644 --- a/src/org/uic/barcode/ticket/api/asn/omv2/ParkingGroundData.java +++ b/src/org/uic/barcode/ticket/api/asn/omv2/ParkingGroundData.java @@ -47,7 +47,7 @@ public class ParkingGroundData extends Object { @FieldOrder(order = 2)
@RestrictedString(CharacterRestriction.IA5String)
- public String parkingGroundId;
+ public String parkingGroundId = "";
@FieldOrder(order = 3)
@IntRange(minValue=0,maxValue=370)
@@ -335,7 +335,7 @@ public class ParkingGroundData extends Object { public Date getFromParkingDate(Date issuingDate){
- return DateTimeUtils.getDate(issuingDate, this.fromParkingDate, null);
+ return DateTimeUtils.getDate(issuingDate, this.fromParkingDate, 0L);
}
@@ -343,7 +343,7 @@ public class ParkingGroundData extends Object { if ( this.toParkingDate == null) return null;
- return DateTimeUtils.getDate(issuingDate, this.fromParkingDate + this.toParkingDate, null);
+ return DateTimeUtils.getDate(issuingDate, this.fromParkingDate + this.toParkingDate, 1439L);
}
diff --git a/src/org/uic/barcode/ticket/api/asn/omv2/VoucherData.java b/src/org/uic/barcode/ticket/api/asn/omv2/VoucherData.java index 458b040..1395976 100644 --- a/src/org/uic/barcode/ticket/api/asn/omv2/VoucherData.java +++ b/src/org/uic/barcode/ticket/api/asn/omv2/VoucherData.java @@ -21,7 +21,6 @@ package org.uic.barcode.ticket.api.asn.omv2; import java.util.Calendar;
import java.util.Date;
-import java.util.TimeZone;
import org.uic.barcode.asn1.datatypes.Asn1BigInteger;
import org.uic.barcode.asn1.datatypes.Asn1Optional;
@@ -287,9 +286,11 @@ public class VoucherData extends Object { Calendar cal = Calendar.getInstance();
cal.clear();
- cal.setTimeZone(TimeZone.getTimeZone("UTC"));
+ //cal.setTimeZone(TimeZone.getTimeZone("UTC"));
cal.set(Calendar.YEAR, this.validFromYear.intValue());
cal.set(Calendar.DAY_OF_YEAR, this.validFromDay.intValue());
+ cal.set(Calendar.MINUTE,0);
+ cal.set(Calendar.HOUR_OF_DAY,0);
return cal.getTime();
@@ -301,9 +302,11 @@ public class VoucherData extends Object { Calendar cal = Calendar.getInstance();
cal.clear();
- cal.setTimeZone(TimeZone.getTimeZone("UTC"));
+ //cal.setTimeZone(TimeZone.getTimeZone("UTC"));
cal.set(Calendar.YEAR, this.validUntilYear.intValue());
cal.set(Calendar.DAY_OF_YEAR, this.validUntilDay.intValue());
+ cal.set(Calendar.MINUTE,59);
+ cal.set(Calendar.HOUR_OF_DAY,23);
return cal.getTime();
|