Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Linnea Samila
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
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
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
54 additions
and
5 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 @@
...
@@ -4,10 +4,9 @@
*/
*/
package
fi
.
insomnia
.
bortal
.
model
;
package
fi
.
insomnia
.
bortal
.
model
;
import
java.util.ArrayList
;
import
java.util.Calendar
;
import
java.util.Calendar
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.List
;
import
java.util.ArrayList
;
import
javax.persistence.Column
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.Entity
;
...
@@ -54,7 +53,7 @@ public class FoodWave extends GenericEntity {
...
@@ -54,7 +53,7 @@ public class FoodWave extends GenericEntity {
@OneToMany
(
mappedBy
=
"foodwave"
)
@OneToMany
(
mappedBy
=
"foodwave"
)
private
List
<
BillLine
>
billLines
;
private
List
<
BillLine
>
billLines
;
@OneToMany
(
mappedBy
=
"foodwave"
)
@OneToMany
(
mappedBy
=
"foodwave"
)
private
List
<
BillLine
>
unpaidBills
;
private
List
<
BillLine
>
unpaidBills
;
...
@@ -152,9 +151,26 @@ public class FoodWave extends GenericEntity {
...
@@ -152,9 +151,26 @@ public class FoodWave extends GenericEntity {
return
true
;
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
()
{
public
List
<
BillLine
>
getBillLines
()
{
return
billLines
;
return
billLines
;
}
}
public
Integer
getMaximumFoods
()
{
public
Integer
getMaximumFoods
()
{
return
maximumFoods
;
return
maximumFoods
;
}
}
...
@@ -176,6 +192,7 @@ public class FoodWave extends GenericEntity {
...
@@ -176,6 +192,7 @@ public class FoodWave extends GenericEntity {
return
retval
;
return
retval
;
}
}
public
void
setMaximumFoods
(
Integer
maximumFoods
)
{
public
void
setMaximumFoods
(
Integer
maximumFoods
)
{
this
.
maximumFoods
=
maximumFoods
;
this
.
maximumFoods
=
maximumFoods
;
}
}
...
...
code/LanBortalDatabase/src/fi/insomnia/bortal/model/FoodWaveTemplate.java
View file @
147bac3
...
@@ -83,6 +83,7 @@ public class FoodWaveTemplate extends GenericEntity {
...
@@ -83,6 +83,7 @@ public class FoodWaveTemplate extends GenericEntity {
public
List
<
Product
>
getProducts
()
{
public
List
<
Product
>
getProducts
()
{
return
products
;
return
products
;
}
}
/**
/**
* @param products
* @param products
...
...
code/LanBortalWeb/WebContent/actionlog/messagelist.xhtml
View file @
147bac3
...
@@ -46,7 +46,7 @@
...
@@ -46,7 +46,7 @@
<div
id=
"actionlog"
>
<div
id=
"actionlog"
>
<h:form
id=
"refresh"
>
<h:form
id=
"refresh"
>
<p:poll
interval=
"1"
update=
"actionlogtable"
/>
<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>
<p:column>
<f:facet
name=
"header"
>
<f:facet
name=
"header"
>
<h:outputText
value=
"#{i18n['actionlog.time']}"
/>
<h:outputText
value=
"#{i18n['actionlog.time']}"
/>
...
...
code/LanBortalWeb/WebContent/foodmanager/listOrders.xhtml
View file @
147bac3
...
@@ -137,6 +137,14 @@
...
@@ -137,6 +137,14 @@
</p:dataTable>
</p:dataTable>
</h:form>
</h:form>
<br
/>
<br
/>
<br
/>
<br
/>
<foodwave:summary
foodwaveProductSummaries=
"#{foodWaveView.productSummaries}"
foodwave=
"#{foodWaveView.selectedFoodWave}"
/>
</ui:define>
</ui:define>
...
...
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/shop/FoodWaveView.java
View file @
147bac3
package
fi
.
insomnia
.
bortal
.
web
.
cdiview
.
shop
;
package
fi
.
insomnia
.
bortal
.
web
.
cdiview
.
shop
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Calendar
;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.TreeSet
;
import
java.util.TreeSet
;
...
@@ -12,6 +14,8 @@ import javax.faces.model.ListDataModel;
...
@@ -12,6 +14,8 @@ import javax.faces.model.ListDataModel;
import
javax.inject.Inject
;
import
javax.inject.Inject
;
import
javax.inject.Named
;
import
javax.inject.Named
;
import
com.sun.xml.rpc.processor.schema.UnimplementedFeatureException
;
import
fi.insomnia.bortal.beans.AccountEventBeanLocal
;
import
fi.insomnia.bortal.beans.AccountEventBeanLocal
;
import
fi.insomnia.bortal.beans.BillBeanLocal
;
import
fi.insomnia.bortal.beans.BillBeanLocal
;
import
fi.insomnia.bortal.beans.EventBeanLocal
;
import
fi.insomnia.bortal.beans.EventBeanLocal
;
...
@@ -27,6 +31,7 @@ import fi.insomnia.bortal.model.FoodWaveTemplate;
...
@@ -27,6 +31,7 @@ import fi.insomnia.bortal.model.FoodWaveTemplate;
import
fi.insomnia.bortal.model.Product
;
import
fi.insomnia.bortal.model.Product
;
import
fi.insomnia.bortal.model.ProductFlag
;
import
fi.insomnia.bortal.model.ProductFlag
;
import
fi.insomnia.bortal.web.cdiview.GenericCDIView
;
import
fi.insomnia.bortal.web.cdiview.GenericCDIView
;
import
fi.insomnia.bortal.web.helpers.FoodwaveProductSummary
;
@Named
@Named
@ConversationScoped
@ConversationScoped
...
@@ -137,6 +142,23 @@ public class FoodWaveView extends GenericCDIView {
...
@@ -137,6 +142,23 @@ public class FoodWaveView extends GenericCDIView {
super
.
beginConversation
();
super
.
beginConversation
();
}
}
}
}
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
()
{
private
void
createNewProductSkeleton
()
{
TreeSet
<
ProductFlag
>
ts
=
new
TreeSet
<
ProductFlag
>();
TreeSet
<
ProductFlag
>
ts
=
new
TreeSet
<
ProductFlag
>();
...
@@ -199,7 +221,7 @@ public class FoodWaveView extends GenericCDIView {
...
@@ -199,7 +221,7 @@ public class FoodWaveView extends GenericCDIView {
public
void
initFoodWaveOrderList
()
{
public
void
initFoodWaveOrderList
()
{
if
(
super
.
requirePermissions
(
ShopPermission
.
MANAGE_FOODWAVES
)
&&
selectedFoodWave
==
null
)
{
if
(
super
.
requirePermissions
(
ShopPermission
.
MANAGE_FOODWAVES
)
&&
selectedFoodWave
==
null
)
{
System
.
out
.
println
(
"Testiä"
);
selectedFoodWave
=
foodWaveBean
.
findFoodwave
(
foodWaveId
);
selectedFoodWave
=
foodWaveBean
.
findFoodwave
(
foodWaveId
);
this
.
setAccountEventLines
(
new
ListDataModel
<
AccountEvent
>(
selectedFoodWave
.
getAccountEvents
()));
this
.
setAccountEventLines
(
new
ListDataModel
<
AccountEvent
>(
selectedFoodWave
.
getAccountEvents
()));
...
@@ -242,6 +264,7 @@ public class FoodWaveView extends GenericCDIView {
...
@@ -242,6 +264,7 @@ public class FoodWaveView extends GenericCDIView {
}
}
public
FoodWave
getSelectedFoodWave
()
{
public
FoodWave
getSelectedFoodWave
()
{
System
.
out
.
println
(
"APOFKASFASFASFASFASFASFASFASFASFKJIOJIO"
);
return
selectedFoodWave
;
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