diff options
Diffstat (limited to 'src/org/uic/barcode/ticket/api/utils/Api2OpenAsnEncoderV2.java')
-rw-r--r-- | src/org/uic/barcode/ticket/api/utils/Api2OpenAsnEncoderV2.java | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/src/org/uic/barcode/ticket/api/utils/Api2OpenAsnEncoderV2.java b/src/org/uic/barcode/ticket/api/utils/Api2OpenAsnEncoderV2.java index 97abcfa..61bdba1 100644 --- a/src/org/uic/barcode/ticket/api/utils/Api2OpenAsnEncoderV2.java +++ b/src/org/uic/barcode/ticket/api/utils/Api2OpenAsnEncoderV2.java @@ -886,8 +886,9 @@ public class Api2OpenAsnEncoderV2 { asnData.setTariffs(encodeTariffCollection(document.getTariffs()));
- asnData.setActivatedDays(document.getActivatedDays(),document.getValidFrom());
-
+ if (document.getActivatedDays() != null && !document.getActivatedDays().isEmpty()) {
+ asnData.addActivatedDays(DateTimeUtils.getActivatedDays(document.getValidFrom(), document.getActivatedDays()));
+ }
if (document.getClassCode() != ITravelClassType.second && document.getClassCode() != null){
asnData.setClassCode(TravelClassType.valueOf(document.getClassCode().name()));
}
@@ -1562,13 +1563,8 @@ public class Api2OpenAsnEncoderV2 { }
}
-
- if(document.getActivatedDays()!= null && document.getActivatedDays().size() > 0) {
- if (document.getValidFrom() != null) {
- asnData.setActivatedDays(document.getActivatedDays(),document.getValidFrom());
- } else {
- asnData.setActivatedDays(document.getActivatedDays(),issuingDate);
- }
+ if (document.getActivatedDays() != null && !document.getActivatedDays().isEmpty()) {
+ asnData.addActivatedDays(DateTimeUtils.getActivatedDays(document.getValidFrom(), document.getActivatedDays()));
}
if (document.getClassCode() != null) {
asnData.setClassCode(TravelClassType.valueOf(document.getClassCode().name()));
@@ -1703,10 +1699,9 @@ public class Api2OpenAsnEncoderV2 { asnData.setValidityDates(document.getValidFrom(), document.getValidUntil(), issuingDate);
- if(document.getActivatedDays()!= null && document.getActivatedDays().size() > 0) {
- asnData.setActivatedDays(document.getActivatedDays(), document.getValidFrom());
+ if (document.getActivatedDays() != null && !document.getActivatedDays().isEmpty()) {
+ asnData.addActivatedDays(DateTimeUtils.getActivatedDays(document.getValidFrom(), document.getActivatedDays()));
}
-
asnData.setExtension(encodeExtension(document.getExtension()));
return asnDocument;
|