Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Codecrew
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
30
Merge Requests
2
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 147bac3e
authored
Oct 26, 2012
by
Tuukka Kivilahti, TKffTK
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
foodwave summary
1 parent
dc64db73
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
53 additions
and
4 deletions
code/LanBortalDatabase/src/fi/insomnia/bortal/model/FoodWave.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/FoodWaveTemplate.java
code/LanBortalWeb/WebContent/actionlog/messagelist.xhtml
code/LanBortalWeb/WebContent/foodmanager/listOrders.xhtml
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/shop/FoodWaveView.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/FoodWave.java
View file @
147bac3
...
...
@@ -4,10 +4,9 @@
*/
package
fi
.
insomnia
.
bortal
.
model
;
import
java.util.ArrayList
;
import
java.util.Calendar
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.ArrayList
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
...
...
@@ -152,9 +151,26 @@ public class FoodWave extends GenericEntity {
return
true
;
}
public
List
<
Product
>
getOrderedProducts
()
{
List
<
Product
>
retlist
=
new
ArrayList
<
Product
>();
if
(
getAccountEvents
()
!=
null
)
{
for
(
AccountEvent
ae
:
getAccountEvents
())
{
if
(!
retlist
.
contains
(
ae
.
getProduct
()))
{
retlist
.
add
(
ae
.
getProduct
());
}
}
}
return
retlist
;
}
public
List
<
BillLine
>
getBillLines
()
{
return
billLines
;
}
public
Integer
getMaximumFoods
()
{
return
maximumFoods
;
}
...
...
@@ -176,6 +192,7 @@ public class FoodWave extends GenericEntity {
return
retval
;
}
public
void
setMaximumFoods
(
Integer
maximumFoods
)
{
this
.
maximumFoods
=
maximumFoods
;
}
...
...
code/LanBortalDatabase/src/fi/insomnia/bortal/model/FoodWaveTemplate.java
View file @
147bac3
...
...
@@ -84,6 +84,7 @@ public class FoodWaveTemplate extends GenericEntity {
return
products
;
}
/**
* @param products
* the products to set
...
...
code/LanBortalWeb/WebContent/actionlog/messagelist.xhtml
View file @
147bac3
...
...
@@ -46,7 +46,7 @@
<div
id=
"actionlog"
>
<h:form
id=
"refresh"
>
<p:poll
interval=
"1"
update=
"actionlogtable"
/>
<p:dataTable
styleClass=
"bordertable"
id=
"actionlogtable"
value=
"#{actionLogMessageView.messages}"
var=
"message"
paginator=
"true"
rows=
"10"
paginatorTemplate=
"{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}
"
>
<p:dataTable
2styleClass
="
bordertable
"
id=
"actionlogtable"
value=
"#{actionLogMessageView.messages}"
var=
"message"
paginator=
"true"
rows=
"30"
paginatorTemplate=
"{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
rowsPerPageTemplate=
"10,20,30,50,100
"
>
<p:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"#{i18n['actionlog.time']}"
/>
...
...
code/LanBortalWeb/WebContent/foodmanager/listOrders.xhtml
View file @
147bac3
...
...
@@ -137,6 +137,14 @@
</p:dataTable>
</h:form>
<br
/>
<br
/>
<br
/>
<br
/>
<foodwave:summary
foodwaveProductSummaries=
"#{foodWaveView.productSummaries}"
foodwave=
"#{foodWaveView.selectedFoodWave}"
/>
</ui:define>
...
...
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/shop/FoodWaveView.java
View file @
147bac3
package
fi
.
insomnia
.
bortal
.
web
.
cdiview
.
shop
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.TreeSet
;
...
...
@@ -12,6 +14,8 @@ import javax.faces.model.ListDataModel;
import
javax.inject.Inject
;
import
javax.inject.Named
;
import
com.sun.xml.rpc.processor.schema.UnimplementedFeatureException
;
import
fi.insomnia.bortal.beans.AccountEventBeanLocal
;
import
fi.insomnia.bortal.beans.BillBeanLocal
;
import
fi.insomnia.bortal.beans.EventBeanLocal
;
...
...
@@ -27,6 +31,7 @@ import fi.insomnia.bortal.model.FoodWaveTemplate;
import
fi.insomnia.bortal.model.Product
;
import
fi.insomnia.bortal.model.ProductFlag
;
import
fi.insomnia.bortal.web.cdiview.GenericCDIView
;
import
fi.insomnia.bortal.web.helpers.FoodwaveProductSummary
;
@Named
@ConversationScoped
...
...
@@ -138,6 +143,23 @@ public class FoodWaveView extends GenericCDIView {
}
}
public
List
<
FoodwaveProductSummary
>
getProductSummaries
()
{
System
.
out
.
println
(
"..asdfasdf"
);
HashMap
<
Product
,
FoodwaveProductSummary
>
pmap
=
new
HashMap
<
Product
,
FoodwaveProductSummary
>();
for
(
AccountEvent
ae
:
getSelectedFoodWave
().
getAccountEvents
())
{
if
(!
pmap
.
containsKey
(
ae
.
getProduct
()))
{
pmap
.
put
(
ae
.
getProduct
(),
new
FoodwaveProductSummary
(
ae
.
getProduct
(),
new
BigDecimal
(
0
),
new
BigDecimal
(
0
)));
}
System
.
out
.
println
(
".."
);
pmap
.
get
(
ae
.
getProduct
()).
add
(
ae
);
}
System
.
out
.
println
(
"::"
+
pmap
.
values
().
size
());
return
new
ArrayList
<
FoodwaveProductSummary
>(
pmap
.
values
());
}
private
void
createNewProductSkeleton
()
{
TreeSet
<
ProductFlag
>
ts
=
new
TreeSet
<
ProductFlag
>();
ts
.
add
(
ProductFlag
.
PREPAID_INSTANT_CREATE
);
...
...
@@ -199,7 +221,7 @@ public class FoodWaveView extends GenericCDIView {
public
void
initFoodWaveOrderList
()
{
if
(
super
.
requirePermissions
(
ShopPermission
.
MANAGE_FOODWAVES
)
&&
selectedFoodWave
==
null
)
{
System
.
out
.
println
(
"Testiä"
);
selectedFoodWave
=
foodWaveBean
.
findFoodwave
(
foodWaveId
);
this
.
setAccountEventLines
(
new
ListDataModel
<
AccountEvent
>(
selectedFoodWave
.
getAccountEvents
()));
...
...
@@ -242,6 +264,7 @@ public class FoodWaveView extends GenericCDIView {
}
public
FoodWave
getSelectedFoodWave
()
{
System
.
out
.
println
(
"APOFKASFASFASFASFASFASFASFASFASFKJIOJIO"
);
return
selectedFoodWave
;
}
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment