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 46a7c340
authored
Mar 31, 2023
by
Liv Haapala
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added counting limits for computer place products
1 parent
bd08c8c3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
code/moya-beans/ejbModule/fi/codecrew/moya/beans/ProductBean.java
code/moya-web/src/main/java/fi/codecrew/moya/web/helper/ProductShopItemHelper.java
code/moya-beans/ejbModule/fi/codecrew/moya/beans/ProductBean.java
View file @
46a7c34
...
@@ -221,6 +221,13 @@ public class ProductBean implements ProductBeanLocal {
...
@@ -221,6 +221,13 @@ public class ProductBean implements ProductBeanLocal {
int
freeCount
=
selectableCount
.
intValue
()
-
unusedSlotcount
;
int
freeCount
=
selectableCount
.
intValue
()
-
unusedSlotcount
;
BigDecimal
lim
=
getPrivateProductLimit
(
prod
,
user
,
userroles
);
if
(
prod
!=
null
&&
lim
!=
null
&&
lim
.
intValue
()
<
freeCount
){
//logger.info("product: {}, lim: {}", prod.getName(), lim.toString());
freeCount
=
lim
.
intValue
();
}
// logger.info("Prodlimit selectable {}, unused {}, free {}, prod {}", selectableCount, unusedSlots, freeCount, prod);
// logger.info("Prodlimit selectable {}, unused {}, free {}, prod {}", selectableCount, unusedSlots, freeCount, prod);
ret
.
put
(
prod
.
getId
(),
BigDecimal
.
valueOf
(
freeCount
));
ret
.
put
(
prod
.
getId
(),
BigDecimal
.
valueOf
(
freeCount
));
...
...
code/moya-web/src/main/java/fi/codecrew/moya/web/helper/ProductShopItemHelper.java
View file @
46a7c34
...
@@ -90,7 +90,6 @@ public class ProductShopItemHelper extends GenericCDIView {
...
@@ -90,7 +90,6 @@ public class ProductShopItemHelper extends GenericCDIView {
if
(
limitValue
!=
null
)
{
if
(
limitValue
!=
null
)
{
productsLeft
=
limitValue
.
subtract
(
item
.
getCount
());
productsLeft
=
limitValue
.
subtract
(
item
.
getCount
());
logger
.
debug
(
"limitValue: {}"
,
limitValue
.
toString
());
if
(
productsLeft
.
compareTo
(
BigDecimal
.
ZERO
)
<
0
)
{
if
(
productsLeft
.
compareTo
(
BigDecimal
.
ZERO
)
<
0
)
{
this
.
setProductShopItemCount
(
item
,
limitValue
);
this
.
setProductShopItemCount
(
item
,
limitValue
);
...
@@ -103,8 +102,6 @@ public class ProductShopItemHelper extends GenericCDIView {
...
@@ -103,8 +102,6 @@ public class ProductShopItemHelper extends GenericCDIView {
}
}
}
}
logger
.
debug
(
"productsLeft: {}"
,
productsLeft
.
toString
());
item
.
setLimit
(
productsLeft
);
item
.
setLimit
(
productsLeft
);
return
false
;
return
false
;
}
}
...
...
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