Commit aa840dcb by Liv Haapala

barcode fix

1 parent 1a1dec84
...@@ -328,6 +328,12 @@ public class BarcodeBean implements BarcodeBeanLocal { ...@@ -328,6 +328,12 @@ public class BarcodeBean implements BarcodeBeanLocal {
Place place = placeFacade.find(id); Place place = placeFacade.find(id);
return place; return place;
} else if(barcode.contains(PLACE_TEXTCODEPREFIX)) {
String trimmedBarcode = barcode.substring(barcode.indexOf(PLACE_TEXTCODEPREFIX));
int id = Integer.parseInt(trimmedBarcode.substring(PLACE_TEXTCODEPREFIX.length(), trimmedBarcode.length()));
Place place = placeFacade.find(id);
return place;
} }
} catch (NumberFormatException x) { } catch (NumberFormatException x) {
} }
...@@ -347,6 +353,13 @@ public class BarcodeBean implements BarcodeBeanLocal { ...@@ -347,6 +353,13 @@ public class BarcodeBean implements BarcodeBeanLocal {
if (card != null) if (card != null)
return card; return card;
} else if(barcode.contains(PRINTED_CARD_BARCODEPREFIX)) {
String trimmedBarcode = barcode.substring(barcode.indexOf(PRINTED_CARD_BARCODEPREFIX));
int id = Integer.parseInt(trimmedBarcode.substring(3, trimmedBarcode.length() - 1));
PrintedCard card = printedCardFacade.find(id);
if (card != null)
return card;
} }
} catch (NumberFormatException x) { } catch (NumberFormatException x) {
} }
...@@ -375,6 +388,13 @@ public class BarcodeBean implements BarcodeBeanLocal { ...@@ -375,6 +388,13 @@ public class BarcodeBean implements BarcodeBeanLocal {
EventUser user = userBean.findByEventUserId(id); EventUser user = userBean.findByEventUserId(id);
return user; return user;
} else if(barcode.contains(EVENTUSER_BARCODEPREFIX)) {
String trimmedBarcode = barcode.substring(barcode.indexOf(EVENTUSER_BARCODEPREFIX));
int id = Integer.parseInt(trimmedBarcode.substring(3, trimmedBarcode.length() - 1));
logger.debug("finding user with barcode {} and id {}", trimmedBarcode, id);
EventUser user = userBean.findByEventUserId(id);
return user;
} }
// try if it is our Eticket -code // try if it is our Eticket -code
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!