-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[26834] mediorder - create medication label for rowa #768
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bitte die Anmerkungen auch für elexis/elexis-3-base#416 umsetzen!
@@ -493,9 +511,10 @@ private void applyScanner(String gtin, int diff, IArticle article) { | |||
diffSpinner.setSelection(DIFF_SPINNER_DEFAULT); | |||
|
|||
OrderElement orderElement = findOrderElementByEAN(gtin); | |||
if (orderElement != null) { | |||
if (orderElement != null && !orderElement.getOrderState().equals(OrderEntryState.DONE)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dreh das um, wenn du Variable.equals(Constant) hast, dann machst du im sinne der defensiven Programmierung immer Constant.equals(Variable) - sollte kein Problem sein wenn getOrderState() wohldefiniert ist, ist aber guter Stil!
@@ -529,7 +565,8 @@ private OrderElement findOrderElementByEAN(String ean) { | |||
} | |||
|
|||
for (OrderElement orderElement : orderElements) { | |||
if (orderElement.getArticle().getGtin().equals(ean)) { | |||
if (!orderElement.getOrderState().equals(OrderEntryState.MARKED) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
siehe oben
|
||
if (orderElements.contains(orderElement) | ||
&& orderElement.getAmount() == orderElement.getOrderEntry().getAmount()) { | ||
orderElement.setOrderState(OrderEntryState.MARKED.getValue()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
private class OrderedLabelProvider extends BaseLabelProvider { | ||
public String getText(Object element) { | ||
String text = StringUtils.EMPTY; | ||
if (element instanceof OrderElement) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
diesen Cast kannst du dir sparen, das kannst du auch mit
if (element instanceof OrderElement orderElement) {
schreiben (seit Java 17 glaub ich)
@@ -513,6 +532,23 @@ private void applyScanner(String gtin, int diff, IArticle article) { | |||
viewer.refresh(); | |||
} | |||
|
|||
private void executeMediorderPrintLabel(OrderElement orderElement, String gtin) { | |||
ICommandService commandService = PlatformUI.getWorkbench().getService(ICommandService.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oben in dieser Classe wird ein @Inject
gemacht, dass ist bereits e4 Style, du machst das e3 style, wovon wir eigentlich wegwollen. Bitte hol dir den ICommandService und auch den IHandlerService über @Inject
@@ -151,7 +161,7 @@ public OrderImportDialog(Shell parentShell, IOrder order, int actionMode) { | |||
IStockEntry stockEntry = StockServiceHolder.get().findStockEntryForArticleInStock(stock, | |||
StoreToStringServiceHolder.getStoreToString(entry.getArticle())); | |||
if (stockEntry != null) { | |||
OrderElement orderElement = new OrderElement(entry, stockEntry, entry.getAmount()); | |||
OrderElement orderElement = new OrderElement(entry, stockEntry, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bitte kurz erklären warum hier 0?
@@ -151,7 +161,7 @@ public OrderImportDialog(Shell parentShell, IOrder order, int actionMode) { | |||
IStockEntry stockEntry = StockServiceHolder.get().findStockEntryForArticleInStock(stock, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wir sollten generell im System wegkommen von den Holder Klassen. Versuch bitte, ob du das auch über @Inject
kriegen kannst. Siehe auch Kommentare unten.
@@ -1,7 +1,7 @@ | |||
package ch.elexis.core.model; | |||
|
|||
public enum OrderEntryState { | |||
OPEN(0), ORDERED(1), PARTIAL_DELIVER(2), DONE(3); | |||
OPEN(0), ORDERED(1), PARTIAL_DELIVER(2), DONE(3), MARKED(4); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was bedeutet MARKED? Wie bindet sich das in den Workflow Ablauf ein?
No description provided.