Commit 6ff1da55 by Tuukka Kivilahti

Game -> license and refactor

1 parent 875fb1f2
Showing with 285 additions and 402 deletions
...@@ -12,12 +12,12 @@ import java.util.List; ...@@ -12,12 +12,12 @@ import java.util.List;
import javax.ejb.EJB; import javax.ejb.EJB;
import javax.ejb.Stateless; import javax.ejb.Stateless;
import fi.codecrew.moya.facade.GameCodeFacade; import fi.codecrew.moya.facade.LicenseCodeFacade;
import fi.codecrew.moya.facade.GameFacade; import fi.codecrew.moya.facade.LicenseTargetFacade;
import fi.codecrew.moya.model.EventMap; import fi.codecrew.moya.model.EventMap;
import fi.codecrew.moya.model.EventUser; import fi.codecrew.moya.model.EventUser;
import fi.codecrew.moya.model.Game; import fi.codecrew.moya.model.LicenseTarget;
import fi.codecrew.moya.model.GameCode; import fi.codecrew.moya.model.LicenseCode;
import fi.codecrew.moya.model.GroupMembership; import fi.codecrew.moya.model.GroupMembership;
import fi.codecrew.moya.model.LanEvent; import fi.codecrew.moya.model.LanEvent;
import fi.codecrew.moya.model.Place; import fi.codecrew.moya.model.Place;
...@@ -26,13 +26,13 @@ import fi.codecrew.moya.model.Place; ...@@ -26,13 +26,13 @@ import fi.codecrew.moya.model.Place;
* Session Bean implementation class GameBean * Session Bean implementation class GameBean
*/ */
@Stateless @Stateless
public class GameBean implements GameBeanLocal { public class LicenseBean implements LicenseBeanLocal {
@EJB @EJB
GameCodeFacade gameCodeFacade; LicenseCodeFacade gameCodeFacade;
@EJB @EJB
GameFacade gameFacade; LicenseTargetFacade gameFacade;
@EJB @EJB
...@@ -41,34 +41,11 @@ public class GameBean implements GameBeanLocal { ...@@ -41,34 +41,11 @@ public class GameBean implements GameBeanLocal {
@EJB @EJB
PlaceBeanLocal placeBean; PlaceBeanLocal placeBean;
public GameCode getCode(Place place) {
List<GameCode> codes = place.getGameCodes();
if(codes.size() > 0) {
return codes.get(0);
}
return null;
}
public List<GameCode> findUserCodes(EventUser user) { public List<LicenseCode> findUserCodes(EventUser user) {
ArrayList<GameCode> returnCodes = new ArrayList<GameCode>(); ArrayList<LicenseCode> returnCodes = new ArrayList<LicenseCode>();
// first get free gamecodes from user places
if(user.getCurrentPlaces() != null) {
for(GroupMembership memberShip : user.getGroupMemberships()) {
if(memberShip.getPlaceReservation() == null)
continue;
for(GameCode placeGameCode : memberShip.getPlaceReservation().getGameCodes()) {
if(placeGameCode.getUser() == null) {
returnCodes.add(placeGameCode);
}
}
}
}
for(GameCode userGameCode : user.getUser().getGameCodes()) { for(LicenseCode userGameCode : user.getUser().getGameCodes()) {
returnCodes.add(userGameCode); returnCodes.add(userGameCode);
} }
...@@ -80,7 +57,7 @@ public class GameBean implements GameBeanLocal { ...@@ -80,7 +57,7 @@ public class GameBean implements GameBeanLocal {
* *
* @param code * @param code
*/ */
private boolean generateCode(GameCode code) { private boolean generateCode(LicenseCode code) {
if (code.getCode() == null || code.getCode().trim().equals("")) { if (code.getCode() == null || code.getCode().trim().equals("")) {
if (code.getGame().getCodeUrl() == null || code.getGame().getCodeUrl().trim().equals("")) if (code.getGame().getCodeUrl() == null || code.getGame().getCodeUrl().trim().equals(""))
...@@ -122,7 +99,7 @@ public class GameBean implements GameBeanLocal { ...@@ -122,7 +99,7 @@ public class GameBean implements GameBeanLocal {
return false; return false;
} }
public boolean accessCode(GameCode code, EventUser user) { public boolean accessCode(LicenseCode code, EventUser user) {
if(code.getUser() != null) if(code.getUser() != null)
return false; return false;
...@@ -141,11 +118,11 @@ public class GameBean implements GameBeanLocal { ...@@ -141,11 +118,11 @@ public class GameBean implements GameBeanLocal {
return true; return true;
} }
public List<Game> findAll(LanEvent event) { public List<LicenseTarget> findAll(LanEvent event) {
return event.getGames(); return event.getGames();
} }
public void saveOrCreateGame(Game game) { public void saveOrCreateLicense(LicenseTarget game) {
if (game.getId() == null) { if (game.getId() == null) {
game.setEvent(eventBean.getCurrentEvent()); game.setEvent(eventBean.getCurrentEvent());
eventBean.getCurrentEvent().getGames().add(game); eventBean.getCurrentEvent().getGames().add(game);
...@@ -160,27 +137,41 @@ public class GameBean implements GameBeanLocal { ...@@ -160,27 +137,41 @@ public class GameBean implements GameBeanLocal {
/** /**
* Default constructor. * Default constructor.
*/ */
public GameBean() { public LicenseBean() {
// TODO Auto-generated constructor stub // TODO Auto-generated constructor stub
} }
@Override @Override
public void generateCodesForAllPlaces(Game game) { public List<LicenseTarget> findUserGames(EventUser user) {
if(game == null)
return;
LanEvent currentEvent = eventBean.getCurrentEvent(); ArrayList<LicenseTarget> returnLicenses = new ArrayList<LicenseTarget>();
for(EventMap map : currentEvent.getEventMaps()) { if(user.getCurrentPlaces() != null) {
for(Place place : map.getPlaces()) { for(GroupMembership memberShip : user.getGroupMemberships()) {
GameCode code = new GameCode(place, game); if(memberShip.getPlaceReservation() == null)
gameCodeFacade.create(code); continue;
code = gameCodeFacade.merge(code);
place.getGameCodes().add(code); for(LicenseTarget license : memberShip.getPlaceReservation().getProduct().getLicenseTargets()) {
if(license.isActive())
returnLicenses.add(license);
}
} }
} }
return returnLicenses;
}
@Override
public List<LicenseTarget> findUnopenedUserGames(EventUser user) {
List<LicenseTarget> returnLicenses = findUserGames(user);
for(LicenseCode code : findUserCodes(user)) {
returnLicenses.remove(code);
}
return returnLicenses;
} }
} }
...@@ -14,7 +14,7 @@ import org.slf4j.LoggerFactory; ...@@ -14,7 +14,7 @@ import org.slf4j.LoggerFactory;
import fi.codecrew.moya.enums.apps.BillPermission; import fi.codecrew.moya.enums.apps.BillPermission;
import fi.codecrew.moya.enums.apps.CompoPermission; import fi.codecrew.moya.enums.apps.CompoPermission;
import fi.codecrew.moya.enums.apps.ContentPermission; import fi.codecrew.moya.enums.apps.ContentPermission;
import fi.codecrew.moya.enums.apps.GamePermission; import fi.codecrew.moya.enums.apps.LicensePermission;
import fi.codecrew.moya.enums.apps.MapPermission; import fi.codecrew.moya.enums.apps.MapPermission;
import fi.codecrew.moya.enums.apps.PollPermission; import fi.codecrew.moya.enums.apps.PollPermission;
import fi.codecrew.moya.enums.apps.ShopPermission; import fi.codecrew.moya.enums.apps.ShopPermission;
...@@ -295,8 +295,8 @@ public class MenuBean implements MenuBeanLocal { ...@@ -295,8 +295,8 @@ public class MenuBean implements MenuBeanLocal {
foodwaveTopmenu.addPage(menuitemfacade.findOrCreate("/foodwave/ThanksForOrderingFromCounter"), ShopPermission.SHOP_FOODWAVE).setVisible(false); foodwaveTopmenu.addPage(menuitemfacade.findOrCreate("/foodwave/ThanksForOrderingFromCounter"), ShopPermission.SHOP_FOODWAVE).setVisible(false);
MenuNavigation gameTopmenu = usernavi.addPage(null, null); MenuNavigation gameTopmenu = usernavi.addPage(null, null);
gameTopmenu.setKey("topnavi.game"); gameTopmenu.setKey("topnavi.license");
gameTopmenu.addPage(menuitemfacade.findOrCreate("/gamecode/viewCodes"), GamePermission.VIEW_OWN_CODES); gameTopmenu.addPage(menuitemfacade.findOrCreate("/license/viewCodes"), LicensePermission.VIEW_OWN_CODES);
MenuNavigation pollTopmenu = usernavi.addPage(null, null); MenuNavigation pollTopmenu = usernavi.addPage(null, null);
...@@ -387,8 +387,8 @@ public class MenuBean implements MenuBeanLocal { ...@@ -387,8 +387,8 @@ public class MenuBean implements MenuBeanLocal {
foodnavi.addPage(menuitemfacade.findOrCreate("/foodadmin/editTemplate"), ShopPermission.MANAGE_FOODWAVES).setVisible(false); foodnavi.addPage(menuitemfacade.findOrCreate("/foodadmin/editTemplate"), ShopPermission.MANAGE_FOODWAVES).setVisible(false);
MenuNavigation gamenavi = adminnavi.addPage(null, null); MenuNavigation gamenavi = adminnavi.addPage(null, null);
gamenavi.setKey("topnavi.game"); gamenavi.setKey("topnavi.license");
gamenavi.addPage(menuitemfacade.findOrCreate("/gamecode/manageCodes"), GamePermission.MANAGE); gamenavi.addPage(menuitemfacade.findOrCreate("/license/manageCodes"), LicensePermission.MANAGE);
} }
@Override @Override
......
...@@ -17,7 +17,7 @@ import fi.codecrew.moya.enums.apps.BillPermission; ...@@ -17,7 +17,7 @@ import fi.codecrew.moya.enums.apps.BillPermission;
import fi.codecrew.moya.enums.apps.CompoPermission; import fi.codecrew.moya.enums.apps.CompoPermission;
import fi.codecrew.moya.enums.apps.ContentPermission; import fi.codecrew.moya.enums.apps.ContentPermission;
import fi.codecrew.moya.enums.apps.EventPermission; import fi.codecrew.moya.enums.apps.EventPermission;
import fi.codecrew.moya.enums.apps.GamePermission; import fi.codecrew.moya.enums.apps.LicensePermission;
import fi.codecrew.moya.enums.apps.IAppPermission; import fi.codecrew.moya.enums.apps.IAppPermission;
import fi.codecrew.moya.enums.apps.MapPermission; import fi.codecrew.moya.enums.apps.MapPermission;
import fi.codecrew.moya.enums.apps.PollPermission; import fi.codecrew.moya.enums.apps.PollPermission;
...@@ -93,8 +93,8 @@ import fi.codecrew.moya.model.User; ...@@ -93,8 +93,8 @@ import fi.codecrew.moya.model.User;
EventPermission.S_MANAGE_PRIVATE_PROPERTIES, EventPermission.S_MANAGE_PRIVATE_PROPERTIES,
EventPermission.S_MANAGE_PROPERTIES, EventPermission.S_MANAGE_PROPERTIES,
GamePermission.S_MANAGE, LicensePermission.S_MANAGE,
GamePermission.S_VIEW_OWN_CODES LicensePermission.S_VIEW_OWN_CODES
}) })
@LocalBean @LocalBean
public class PermissionBean implements PermissionBeanLocal { public class PermissionBean implements PermissionBeanLocal {
......
...@@ -2,6 +2,7 @@ package fi.codecrew.moya.beans; ...@@ -2,6 +2,7 @@ package fi.codecrew.moya.beans;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode; import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.Calendar; import java.util.Calendar;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
...@@ -19,6 +20,8 @@ import javax.ejb.Stateless; ...@@ -19,6 +20,8 @@ import javax.ejb.Stateless;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import fi.codecrew.moya.bortal.views.BillSummary;
import fi.codecrew.moya.enums.apps.ShopPermission;
import fi.codecrew.moya.facade.AccountEventFacade; import fi.codecrew.moya.facade.AccountEventFacade;
import fi.codecrew.moya.facade.BillLineFacade; import fi.codecrew.moya.facade.BillLineFacade;
import fi.codecrew.moya.facade.DiscountFacade; import fi.codecrew.moya.facade.DiscountFacade;
...@@ -26,13 +29,6 @@ import fi.codecrew.moya.facade.EventUserFacade; ...@@ -26,13 +29,6 @@ import fi.codecrew.moya.facade.EventUserFacade;
import fi.codecrew.moya.facade.InventoryEventFacade; import fi.codecrew.moya.facade.InventoryEventFacade;
import fi.codecrew.moya.facade.ProductFacade; import fi.codecrew.moya.facade.ProductFacade;
import fi.codecrew.moya.facade.UserFacade; import fi.codecrew.moya.facade.UserFacade;
import fi.codecrew.moya.beans.BillBeanLocal;
import fi.codecrew.moya.beans.EventBeanLocal;
import fi.codecrew.moya.beans.PermissionBeanLocal;
import fi.codecrew.moya.beans.ProductBeanLocal;
import fi.codecrew.moya.beans.UserBeanLocal;
import fi.codecrew.moya.bortal.views.BillSummary;
import fi.codecrew.moya.enums.apps.ShopPermission;
import fi.codecrew.moya.model.AccountEvent; import fi.codecrew.moya.model.AccountEvent;
import fi.codecrew.moya.model.Discount; import fi.codecrew.moya.model.Discount;
import fi.codecrew.moya.model.EventUser; import fi.codecrew.moya.model.EventUser;
...@@ -365,4 +361,18 @@ public class ProductBean implements ProductBeanLocal { ...@@ -365,4 +361,18 @@ public class ProductBean implements ProductBeanLocal {
public List<Product> findProductsForEvent() { public List<Product> findProductsForEvent() {
return productFacade.findAll(); return productFacade.findAll();
} }
@Override
public List<Product> findPlaceProducts() {
ArrayList<Product> returnProducts = new ArrayList<Product>();
for(Product product : findProductsForEvent()) {
if(product.getPlaces() != null && product.getPlaces().size() > 0) {
returnProducts.add(product);
}
}
return returnProducts;
}
} }
package fi.codecrew.moya.facade;
import javax.ejb.LocalBean;
import javax.ejb.Stateless;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Root;
import fi.codecrew.moya.model.GameCode;
import fi.codecrew.moya.model.GameCode_;
import fi.codecrew.moya.model.News;
import fi.codecrew.moya.model.Place;
@Stateless
@LocalBean
public class GameCodeFacade extends IntegerPkGenericFacade<GameCode> {
public GameCodeFacade() {
super(GameCode.class);
}
public GameCode findByPlace(Place place) {
CriteriaBuilder cb = getEm().getCriteriaBuilder();
CriteriaQuery<GameCode> cq = cb.createQuery(GameCode.class);
Root<GameCode> root = cq.from(GameCode.class);
cq.where(cb.equal(root.get(GameCode_.place), place));
return getSingleNullableResult(getEm().createQuery(cq));
}
}
...@@ -3,15 +3,13 @@ package fi.codecrew.moya.facade; ...@@ -3,15 +3,13 @@ package fi.codecrew.moya.facade;
import javax.ejb.LocalBean; import javax.ejb.LocalBean;
import javax.ejb.Stateless; import javax.ejb.Stateless;
import fi.codecrew.moya.model.Game; import fi.codecrew.moya.model.LicenseCode;
@Stateless @Stateless
@LocalBean @LocalBean
public class GameFacade extends IntegerPkGenericFacade<Game> { public class LicenseCodeFacade extends IntegerPkGenericFacade<LicenseCode> {
public GameFacade() { public LicenseCodeFacade() {
super(LicenseCode.class);
super(Game.class);
} }
} }
package fi.codecrew.moya.facade;
import javax.ejb.LocalBean;
import javax.ejb.Stateless;
import fi.codecrew.moya.model.LicenseTarget;
@Stateless
@LocalBean
public class LicenseTargetFacade extends IntegerPkGenericFacade<LicenseTarget> {
public LicenseTargetFacade() {
super(LicenseTarget.class);
}
}
package fi.codecrew.moya.beans;
import java.util.List;
import javax.ejb.Local;
import fi.codecrew.moya.model.EventUser;
import fi.codecrew.moya.model.Game;
import fi.codecrew.moya.model.GameCode;
import fi.codecrew.moya.model.LanEvent;
import fi.codecrew.moya.model.Place;
@Local
public interface GameBeanLocal {
public GameCode getCode(Place place);
public boolean accessCode(GameCode code, EventUser user);
public List<Game> findAll(LanEvent event);
public void saveOrCreateGame(Game game);
public List<GameCode> findUserCodes(EventUser user);
public void generateCodesForAllPlaces(Game game);
}
package fi.codecrew.moya.beans;
import java.util.List;
import javax.ejb.Local;
import fi.codecrew.moya.model.EventUser;
import fi.codecrew.moya.model.LicenseTarget;
import fi.codecrew.moya.model.LicenseCode;
import fi.codecrew.moya.model.LanEvent;
import fi.codecrew.moya.model.Place;
@Local
public interface LicenseBeanLocal {
public boolean accessCode(LicenseCode code, EventUser user);
public List<LicenseTarget> findAll(LanEvent event);
public void saveOrCreateLicense(LicenseTarget game);
public List<LicenseCode> findUserCodes(EventUser user);
public List<LicenseTarget> findUserGames(EventUser user);
public List<LicenseTarget> findUnopenedUserGames(EventUser user);
}
\ No newline at end of file
...@@ -55,5 +55,7 @@ public interface ProductBeanLocal { ...@@ -55,5 +55,7 @@ public interface ProductBeanLocal {
void saveInventoryEvent(InventoryEvent ie); void saveInventoryEvent(InventoryEvent ie);
List<Product> findProductsForEvent(); List<Product> findProductsForEvent();
List<Product> findPlaceProducts();
} }
...@@ -75,7 +75,7 @@ public class LanEvent extends GenericEntity { ...@@ -75,7 +75,7 @@ public class LanEvent extends GenericEntity {
private List<Compo> compos; private List<Compo> compos;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "event") @OneToMany(cascade = CascadeType.ALL, mappedBy = "event")
private List<Game> games; private List<LicenseTarget> games;
@OneToMany(mappedBy = "event", cascade = CascadeType.ALL) @OneToMany(mappedBy = "event", cascade = CascadeType.ALL)
private List<CardTemplate> cardTemplates; private List<CardTemplate> cardTemplates;
...@@ -284,13 +284,13 @@ public class LanEvent extends GenericEntity { ...@@ -284,13 +284,13 @@ public class LanEvent extends GenericEntity {
this.properties = properties; this.properties = properties;
} }
public List<Game> getGames() { public List<LicenseTarget> getGames() {
if(games == null) if(games == null)
games = new ArrayList<Game>(); games = new ArrayList<LicenseTarget>();
return games; return games;
} }
public void setGames(List<Game> games) { public void setGames(List<LicenseTarget> games) {
this.games = games; this.games = games;
} }
......
...@@ -21,28 +21,22 @@ import org.eclipse.persistence.annotations.OptimisticLockingType; ...@@ -21,28 +21,22 @@ import org.eclipse.persistence.annotations.OptimisticLockingType;
* *
*/ */
@Entity @Entity
@Table(name = "gamecodes") @Table(name = "licensecodes")
@OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS) @OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS)
public class GameCode extends GenericEntity { public class LicenseCode extends GenericEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@Column(name = "accessed", nullable = true) @Column(name = "accessed", nullable = true)
@Temporal(TemporalType.TIMESTAMP) @Temporal(TemporalType.TIMESTAMP)
private Calendar accessed = null; private Calendar accessed = null;
@Column(name = "code") @Column(name = "code")
private String code; private String code;
@JoinColumn(name = "game_id", referencedColumnName = "id") @JoinColumn(name = "game_id", referencedColumnName = "id")
@ManyToOne @ManyToOne
private Game game; private LicenseTarget game;
@JoinColumn(name = "user_id", referencedColumnName = "id") @JoinColumn(name = "user_id", referencedColumnName = "id")
@ManyToOne @ManyToOne
...@@ -54,12 +48,12 @@ public class GameCode extends GenericEntity { ...@@ -54,12 +48,12 @@ public class GameCode extends GenericEntity {
public GameCode() { public LicenseCode() {
super(); super();
} }
public GameCode(Place place, Game game) { public LicenseCode(Place place, LicenseTarget game) {
this(); this();
this.place = place; this.place = place;
this.game = game; this.game = game;
...@@ -94,13 +88,13 @@ public class GameCode extends GenericEntity { ...@@ -94,13 +88,13 @@ public class GameCode extends GenericEntity {
public Game getGame() { public LicenseTarget getGame() {
return game; return game;
} }
public void setGame(Game game) { public void setGame(LicenseTarget game) {
this.game = game; this.game = game;
} }
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
*/ */
package fi.codecrew.moya.model; package fi.codecrew.moya.model;
import java.util.Calendar;
import java.util.List; import java.util.List;
import javax.persistence.Column; import javax.persistence.Column;
...@@ -14,6 +15,8 @@ import javax.persistence.ManyToOne; ...@@ -14,6 +15,8 @@ import javax.persistence.ManyToOne;
import javax.persistence.OneToMany; import javax.persistence.OneToMany;
import javax.persistence.OrderBy; import javax.persistence.OrderBy;
import javax.persistence.Table; import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.eclipse.persistence.annotations.OptimisticLocking; import org.eclipse.persistence.annotations.OptimisticLocking;
import org.eclipse.persistence.annotations.OptimisticLockingType; import org.eclipse.persistence.annotations.OptimisticLockingType;
...@@ -22,14 +25,17 @@ import org.eclipse.persistence.annotations.OptimisticLockingType; ...@@ -22,14 +25,17 @@ import org.eclipse.persistence.annotations.OptimisticLockingType;
* *
*/ */
@Entity @Entity
@Table(name = "games") @Table(name = "licenseTargets")
@OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS) @OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS)
public class Game extends GenericEntity { public class LicenseTarget extends GenericEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@Column(name = "active")
private boolean active = false;
@Column(name = "name") @Column(name = "name")
private String name; private String name;
...@@ -41,7 +47,6 @@ public class Game extends GenericEntity { ...@@ -41,7 +47,6 @@ public class Game extends GenericEntity {
@Column(name = "code_url") @Column(name = "code_url")
private String codeUrl; private String codeUrl;
@JoinColumn(name = "event_id", referencedColumnName = "id") @JoinColumn(name = "event_id", referencedColumnName = "id")
@ManyToOne @ManyToOne
...@@ -49,15 +54,13 @@ public class Game extends GenericEntity { ...@@ -49,15 +54,13 @@ public class Game extends GenericEntity {
@OneToMany(mappedBy = "game", fetch = FetchType.LAZY) @OneToMany(mappedBy = "game", fetch = FetchType.LAZY)
@OrderBy() @OrderBy()
private List<GameCode> gameCodes; private List<LicenseCode> licenseCodes;
@JoinColumn(name = "product_id", referencedColumnName = "id")
@ManyToOne
private Product product;
public Game() { public LicenseTarget() {
super(); super();
} }
...@@ -132,16 +135,55 @@ public class Game extends GenericEntity { ...@@ -132,16 +135,55 @@ public class Game extends GenericEntity {
public List<GameCode> getGameCodes() { public List<LicenseCode> getGameCodes() {
return gameCodes; return licenseCodes;
} }
public void setGameCodes(List<GameCode> gameCodes) { public void setGameCodes(List<LicenseCode> gameCodes) {
this.gameCodes = gameCodes; this.licenseCodes = gameCodes;
} }
public Product getProduct() {
return product;
}
public void setProduct(Product product) {
this.product = product;
}
public boolean isActive() {
return active;
}
public boolean getActive() {
return active;
}
public void setActive(boolean active) {
this.active = active;
}
public List<LicenseCode> getLicenseCodes() {
return licenseCodes;
}
public void setLicenseCodes(List<LicenseCode> licenseCodes) {
this.licenseCodes = licenseCodes;
}
} }
...@@ -91,11 +91,6 @@ public class Place extends GenericEntity { ...@@ -91,11 +91,6 @@ public class Place extends GenericEntity {
@JoinColumn(name = "current_eventuser_id", referencedColumnName = EventUser.ID_COLUMN) @JoinColumn(name = "current_eventuser_id", referencedColumnName = EventUser.ID_COLUMN)
@ManyToOne @ManyToOne
private EventUser currentUser; private EventUser currentUser;
@OneToMany(mappedBy = "place", fetch = FetchType.LAZY)
@OrderBy()
private List<GameCode> gameCodes;
public Place() { public Place() {
super(); super();
...@@ -288,17 +283,4 @@ public class Place extends GenericEntity { ...@@ -288,17 +283,4 @@ public class Place extends GenericEntity {
this.disabled = disabled; this.disabled = disabled;
} }
public List<GameCode> getGameCodes() {
if(gameCodes == null) {
gameCodes = new ArrayList<GameCode>();
}
return gameCodes;
}
public void setGameCodes(List<GameCode> gameCodes) {
this.gameCodes = gameCodes;
}
} }
...@@ -70,6 +70,11 @@ public class Product extends GenericEntity { ...@@ -70,6 +70,11 @@ public class Product extends GenericEntity {
@Column(name = "barcode") @Column(name = "barcode")
private String barcode; private String barcode;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "product")
private List<LicenseTarget> licenseTargets;
@Enumerated(EnumType.STRING) @Enumerated(EnumType.STRING)
@PrivateOwned @PrivateOwned
@ElementCollection() @ElementCollection()
...@@ -332,4 +337,12 @@ public class Product extends GenericEntity { ...@@ -332,4 +337,12 @@ public class Product extends GenericEntity {
this.inventoryEvents = inventoryEvents; this.inventoryEvents = inventoryEvents;
} }
public List<LicenseTarget> getLicenseTargets() {
return licenseTargets;
}
public void setLicenseTargets(List<LicenseTarget> licenseTargets) {
this.licenseTargets = licenseTargets;
}
} }
...@@ -113,7 +113,7 @@ public class User extends GenericEntity implements IUser { ...@@ -113,7 +113,7 @@ public class User extends GenericEntity implements IUser {
@OneToMany(mappedBy = "user", fetch = FetchType.LAZY) @OneToMany(mappedBy = "user", fetch = FetchType.LAZY)
@OrderBy() @OrderBy()
private List<GameCode> gameCodes; private List<LicenseCode> gameCodes;
@Transient @Transient
private static final Logger logger = LoggerFactory.getLogger(User.class); private static final Logger logger = LoggerFactory.getLogger(User.class);
...@@ -361,14 +361,14 @@ public class User extends GenericEntity implements IUser { ...@@ -361,14 +361,14 @@ public class User extends GenericEntity implements IUser {
} }
public List<GameCode> getGameCodes() { public List<LicenseCode> getGameCodes() {
if(gameCodes == null) if(gameCodes == null)
gameCodes = new ArrayList<GameCode>(); gameCodes = new ArrayList<LicenseCode>();
return gameCodes; return gameCodes;
} }
public void setGameCodes(List<GameCode> gameCodes) { public void setGameCodes(List<LicenseCode> gameCodes) {
this.gameCodes = gameCodes; this.gameCodes = gameCodes;
} }
......
...@@ -4,7 +4,7 @@ import fi.codecrew.moya.enums.apps.BillPermission; ...@@ -4,7 +4,7 @@ import fi.codecrew.moya.enums.apps.BillPermission;
import fi.codecrew.moya.enums.apps.CompoPermission; import fi.codecrew.moya.enums.apps.CompoPermission;
import fi.codecrew.moya.enums.apps.ContentPermission; import fi.codecrew.moya.enums.apps.ContentPermission;
import fi.codecrew.moya.enums.apps.EventPermission; import fi.codecrew.moya.enums.apps.EventPermission;
import fi.codecrew.moya.enums.apps.GamePermission; import fi.codecrew.moya.enums.apps.LicensePermission;
import fi.codecrew.moya.enums.apps.IAppPermission; import fi.codecrew.moya.enums.apps.IAppPermission;
import fi.codecrew.moya.enums.apps.MapPermission; import fi.codecrew.moya.enums.apps.MapPermission;
import fi.codecrew.moya.enums.apps.PollPermission; import fi.codecrew.moya.enums.apps.PollPermission;
...@@ -24,7 +24,7 @@ public enum BortalApplication { ...@@ -24,7 +24,7 @@ public enum BortalApplication {
SALESPOINT(SalespointPermission.class), SALESPOINT(SalespointPermission.class),
COMPO(CompoPermission.class), COMPO(CompoPermission.class),
EVENT(EventPermission.class), EVENT(EventPermission.class),
GAME(GamePermission.class), LICENSE(LicensePermission.class),
; ;
......
...@@ -2,28 +2,27 @@ package fi.codecrew.moya.enums.apps; ...@@ -2,28 +2,27 @@ package fi.codecrew.moya.enums.apps;
import fi.codecrew.moya.enums.BortalApplication; import fi.codecrew.moya.enums.BortalApplication;
public enum GamePermission implements IAppPermission { public enum LicensePermission implements IAppPermission {
MANAGE, MANAGE,
VIEW_OWN_CODES, VIEW_OWN_CODES,
; ;
public static final String S_MANAGE = "GAME/MANAGE"; public static final String S_MANAGE = "LICENSE/MANAGE";
public static final String S_VIEW_OWN_CODES = "GAME/VIEW_OWN_CODES"; public static final String S_VIEW_OWN_CODES = "LICENSE/VIEW_OWN_CODES";
private final String fullName; private final String fullName;
private final String key; private final String key;
private static final String I18N_HEADER = "bortalApplication.game."; private static final String I18N_HEADER = "bortalApplication.license.";
private GamePermission() { private LicensePermission() {
fullName = new StringBuilder().append(getParent().toString()).append(DELIMITER).append(toString()).toString(); fullName = new StringBuilder().append(getParent().toString()).append(DELIMITER).append(toString()).toString();
key = I18N_HEADER + name(); key = I18N_HEADER + name();
} }
@Override @Override
public BortalApplication getParent() { public BortalApplication getParent() {
return BortalApplication.GAME; return BortalApplication.LICENSE;
} }
@Override @Override
......
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:products="http://java.sun.com/jsf/composite/tools/products" xmlns:tools="http://java.sun.com/jsf/composite/tools" xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces.org/ui">
<h:body>
<ui:composition template="/layout/#{sessionHandler.layout}/template.xhtml">
<f:metadata>
<f:viewParam name="userid" value="#{userView.userid}" />
<f:event type="preRenderView" listener="#{gameCodeView.initAdminView}" />
</f:metadata>
<ui:param name="thispage" value="page.gamecode.manageCodes" />
<ui:define name="content">
<h:form>
<p:dataTable border="1" id="games" value="#{gameCodeView.games}" var="game">
<p:column>
<f:facet name="header">
<h:outputText value="${i18n['game.name']}" />
</f:facet>
<h:outputText value="#{game.name}" />
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="edit" />
</f:facet>
<p:commandButton value="muokkaa" update=":editgame" >
<f:setPropertyActionListener value="#{game}" target="#{gameCodeView.currentGame}" />
</p:commandButton>
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="game.codecount" />
</f:facet>
<h:outputText value="#{game.gameCodes.size()}" />
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="GENEROI" />
</f:facet>
<p:commandButton value="generoi kaikille paikoille" action="#{gameCodeView.generateSelectedToAllPlaces}">
<f:setPropertyActionListener value="#{game}" target="#{gameCodeView.currentGame}" />
</p:commandButton>
</p:column>
</p:dataTable>
</h:form>
<br /><br />
<h:form id="editgame" >
<p:panelGrid columns="2">
<f:facet name="header">
<h:outputLabel rendered="#{gameCodeView.currentGame.id == null}" value="#{i18n['game.create']}" />
<h:outputLabel rendered="#{gameCodeView.currentGame.id != null}" value="#{i18n['game.edit']}" />
</f:facet>
<h:outputLabel value="service" />
<p:inputText value="#{gameCodeView.currentGame.service}" />
<h:outputLabel value="name" />
<p:inputText value="#{gameCodeView.currentGame.name}" />
<h:outputLabel value="description" />
<p:inputText value="#{gameCodeView.currentGame.description}" />
<h:outputLabel value="url" />
<p:inputText value="#{gameCodeView.currentGame.codeUrl}" />
<p:commandButton action="#{gameCodeView.saveCurrentGame}" value="save" />
</p:panelGrid>
</h:form>
<h:form>
<p:commandButton id="cancelbtn" onclick="confirmation.show()" value="#{i18n['bill.cancel']}" />
<p:confirmDialog id="confirmDialog" message="#{i18n['generic.sure.message']}" header="#{i18n['generic.sure.header']}" severity="alert" widgetVar="confirmation">
<p:commandButton value="#{i18n['generic.sure.yes']}" onclick="confirmation.hide()" actionListener="#{billEditView.expireBill()}" ajax="false" />
<p:commandButton value="#{i18n['generic.sure.no']}" onclick="confirmation.hide()" type="button" />
</p:confirmDialog>
</h:form>
</ui:define>
</ui:composition>
</h:body>
</html>
\ No newline at end of file
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:products="http://java.sun.com/jsf/composite/tools/products" xmlns:tools="http://java.sun.com/jsf/composite/tools" xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces.org/ui">
<h:body>
<ui:composition template="/layout/#{sessionHandler.layout}/template.xhtml">
<ui:param name="thispage" value="page.gamecode.viewCodes" />
<f:metadata>
<f:viewParam name="userid" value="#{userView.userid}" />
<f:event type="preRenderView" listener="#{gameCodeView.initUserView}" />
</f:metadata>
<ui:define name="content">
<h:form>
<h:outputLabel rendered="#{gameCodeView.noGameCodes}" value="#{i18n['game.noGameCodes']}" />
<p:dataTable rendered="#{not gameCodeView.noGameCodes}" columnClasses="nowrap,numalign,numalign,nowrap,numalign" styleClass="bordertable" id="codes" value="#{gameCodeView.gameCodes}" var="code">
<p:column sortBy="#{code.game.service}">
<f:facet name="header">
<h:outputText value="#{i18n['game.service']}" />
</f:facet>
<h:outputText value="#{code.game.service}" />
</p:column>
<p:column sortBy="#{code.game.name}">
<f:facet name="header">
<h:outputText value="#{i18n['game.name']}" />
</f:facet>
<h:outputText value="#{code.game.name}" />
</p:column>
<p:column sortBy="#{code.game.description}">
<f:facet name="header">
<h:outputText value="#{i18n['game.description']}" />
</f:facet>
<h:outputText value="#{code.game.description}" />
</p:column>
<p:column sortBy="#{code.code}">
<f:facet name="header">
<h:outputText value="#{i18n['game.code']}" />
</f:facet>
<h:outputText rendered="#{not code.accessed}" value="ei avattu" />
<h:commandButton rendered="#{not code.accessed}" value="#{i18n['game.open']}" action="#{gameCodeView.openSelectedCode}" />
<h:outputText rendered="#{code.accessed}" value="#{code.code}" />
</p:column>
</p:dataTable>
</h:form>
</ui:define>
</ui:composition>
</h:body>
</html>
\ No newline at end of file
...@@ -41,17 +41,7 @@ ...@@ -41,17 +41,7 @@
<h:selectManyCheckbox id="permissions" layout="pageDirection" value="#{bapp.selected}"> <h:selectManyCheckbox id="permissions" layout="pageDirection" value="#{bapp.selected}">
<f:selectItems value="#{bapp.permissions}" var="per" itemLabel="#{i18n[per.i18nKey]}" /> <f:selectItems value="#{bapp.permissions}" var="per" itemLabel="#{i18n[per.i18nKey]}" />
</h:selectManyCheckbox> </h:selectManyCheckbox>
<!-- <ui:repeat id="permDescs" var="perm" value="#{bapp.permissions}"> -->
<!-- <div>#{perm.name} / #{perm.description}</div> -->
<!-- </ui:repeat> -->
</h:column> </h:column>
<!-- <h:column> -->
<!-- <ui:repeat id="permissions" var="perm" value="#{bapp.permissions}"> -->
<!-- <div> -->
<!-- <h:selectBooleanCheckbox value="#{perm.canHas}" /> -->
<!-- </div> -->
<!-- </ui:repeat> -->
<!-- </h:column> -->
</h:dataTable> </h:dataTable>
<h:commandButton id="save2" value="#{i18n['role.savePermissions']}" action="#{roleView.savePermissions}" /> <h:commandButton id="save2" value="#{i18n['role.savePermissions']}" action="#{roleView.savePermissions}" />
......
...@@ -86,9 +86,12 @@ error.error = You have encountered an error. ...@@ -86,9 +86,12 @@ error.error = You have encountered an error.
eventorg.create = Create eventorg.create = Create
game.create = Create game.active = Aktiivinen
game.edit = Edit game.codecount = Avattuja
game.out = Gamecodes are out, pleace contact administration game.create = Create
game.edit = Edit
game.out = Gamecodes are out, pleace contact administration
game.product = Tuote
generic.sure.header = Confirmation generic.sure.header = Confirmation
generic.sure.message = Are you sure? generic.sure.message = Are you sure?
...@@ -162,4 +165,6 @@ resetmailSent.header = Email sent ...@@ -162,4 +165,6 @@ resetmailSent.header = Email sent
subnavi.cards = \u0009\u0009 subnavi.cards = \u0009\u0009
topnavi.license = Lisenssikoodit
user.unauthenticated = Kirjautumaton user.unauthenticated = Kirjautumaton
...@@ -277,7 +277,9 @@ foodwavetemplate.selectproducts = Products ...@@ -277,7 +277,9 @@ foodwavetemplate.selectproducts = Products
foodwavetemplate.startTime = Foodwave time foodwavetemplate.startTime = Foodwave time
foodwavetemplate.waveName = Wave name foodwavetemplate.waveName = Wave name
game.active = Active
game.code = Code game.code = Code
game.codecount = Opened
game.create = Create game.create = Create
game.description = Description game.description = Description
game.edit = Edit game.edit = Edit
...@@ -286,6 +288,7 @@ game.name = Name ...@@ -286,6 +288,7 @@ game.name = Name
game.noGameCodes = You have no gamecodes game.noGameCodes = You have no gamecodes
game.open = Open code game.open = Open code
game.out = Please contact out customer service game.out = Please contact out customer service
game.product = Product
game.service = Game service game.service = Game service
gamepoints = Gamepoints gamepoints = Gamepoints
...@@ -782,6 +785,7 @@ topnavi.event = Event ...@@ -782,6 +785,7 @@ topnavi.event = Event
topnavi.foodwave = Food topnavi.foodwave = Food
topnavi.frontpage = Front page topnavi.frontpage = Front page
topnavi.game = Gamecodes topnavi.game = Gamecodes
topnavi.license = Licensecodes
topnavi.log = Log topnavi.log = Log
topnavi.maps = Maps topnavi.maps = Maps
topnavi.placemap = Map topnavi.placemap = Map
......
...@@ -277,7 +277,9 @@ foodwavetemplate.selectproducts = Tuotteet ...@@ -277,7 +277,9 @@ foodwavetemplate.selectproducts = Tuotteet
foodwavetemplate.startTime = Tilausaika foodwavetemplate.startTime = Tilausaika
foodwavetemplate.waveName = Tilauksen nimi foodwavetemplate.waveName = Tilauksen nimi
game.active = Aktiivinen
game.code = Koodi game.code = Koodi
game.codecount = Avattuja
game.create = Luo game.create = Luo
game.description = Kuvaus game.description = Kuvaus
game.edit = Muokkaa game.edit = Muokkaa
...@@ -286,6 +288,7 @@ game.name = Nimi ...@@ -286,6 +288,7 @@ game.name = Nimi
game.noGameCodes = Sinulla ei ole pelikoodeja game.noGameCodes = Sinulla ei ole pelikoodeja
game.open = Ota koodi k\u00E4ytt\u00F6\u00F6n game.open = Ota koodi k\u00E4ytt\u00F6\u00F6n
game.out = Ei voitu avata pelikoodia, ota yhteytt\u00E4 asiakaspalveluun. game.out = Ei voitu avata pelikoodia, ota yhteytt\u00E4 asiakaspalveluun.
game.product = Tuote
game.service = Pelipalvelu game.service = Pelipalvelu
gamepoints = Pelipisteit\u00E4 gamepoints = Pelipisteit\u00E4
...@@ -767,6 +770,7 @@ topnavi.event = Tapahtuma ...@@ -767,6 +770,7 @@ topnavi.event = Tapahtuma
topnavi.foodwave = Ruokatilaus topnavi.foodwave = Ruokatilaus
topnavi.frontpage = Etusivu topnavi.frontpage = Etusivu
topnavi.game = Pelikoodit topnavi.game = Pelikoodit
topnavi.license = Lisenssikoodit
topnavi.log = Logi topnavi.log = Logi
topnavi.maps = Kartat topnavi.maps = Kartat
topnavi.placemap = Paikkakartta topnavi.placemap = Paikkakartta
......
package fi.codecrew.moya.web.cdiview.game; package fi.codecrew.moya.web.cdiview.license;
import java.util.List;
import javax.ejb.EJB; import javax.ejb.EJB;
import javax.enterprise.context.ConversationScoped; import javax.enterprise.context.ConversationScoped;
import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;
import javax.faces.model.ListDataModel; import javax.faces.model.ListDataModel;
import javax.inject.Inject; import javax.inject.Inject;
import javax.inject.Named; import javax.inject.Named;
import fi.codecrew.moya.beans.EventBeanLocal; import fi.codecrew.moya.beans.EventBeanLocal;
import fi.codecrew.moya.beans.GameBeanLocal; import fi.codecrew.moya.beans.LicenseBeanLocal;
import fi.codecrew.moya.enums.apps.BillPermission; import fi.codecrew.moya.beans.ProductBeanLocal;
import fi.codecrew.moya.enums.apps.GamePermission; import fi.codecrew.moya.enums.apps.LicensePermission;
import fi.codecrew.moya.model.Bill;
import fi.codecrew.moya.model.EventUser; import fi.codecrew.moya.model.EventUser;
import fi.codecrew.moya.model.Game; import fi.codecrew.moya.model.LicenseCode;
import fi.codecrew.moya.model.GameCode; import fi.codecrew.moya.model.LicenseTarget;
import fi.codecrew.moya.model.Product;
import fi.codecrew.moya.web.annotations.SelectedUser; import fi.codecrew.moya.web.annotations.SelectedUser;
import fi.codecrew.moya.web.cdiview.GenericCDIView; import fi.codecrew.moya.web.cdiview.GenericCDIView;
@Named @Named
@ConversationScoped @ConversationScoped
public class GameCodeView extends GenericCDIView { public class LicenseView extends GenericCDIView {
private static final long serialVersionUID = -8346420143750551402L; private static final long serialVersionUID = -8346420143750551402L;
...@@ -33,92 +33,93 @@ public class GameCodeView extends GenericCDIView { ...@@ -33,92 +33,93 @@ public class GameCodeView extends GenericCDIView {
EventBeanLocal eventBean; EventBeanLocal eventBean;
@EJB @EJB
GameBeanLocal gameBean; LicenseBeanLocal licenseBean;
@EJB
ProductBeanLocal productBean;
ListDataModel<Game> gamesDataModel; private ListDataModel<LicenseTarget> licenses;
ListDataModel<GameCode> gameCodesDataModel; private ListDataModel<LicenseCode> licenseCodes;
private Game currentGame; private LicenseTarget currentLicense;
public void initAdminView() { public void initAdminView() {
if (super.requirePermissions(GamePermission.MANAGE)) { if (super.requirePermissions(LicensePermission.MANAGE)) {
if (gamesDataModel == null) { if (licenses == null) {
this.currentGame = new Game(); this.currentLicense = new LicenseTarget();
this.currentGame.setEvent(eventBean.getCurrentEvent()); this.currentLicense.setEvent(eventBean.getCurrentEvent());
this.gamesDataModel = new ListDataModel<Game>(gameBean.findAll(eventBean.getCurrentEvent())); this.licenses = new ListDataModel<LicenseTarget>(licenseBean.findAll(eventBean.getCurrentEvent()));
this.beginConversation(); this.beginConversation();
} }
} }
} }
public void initUserView() { public void initUserView() {
if (super.requirePermissions(GamePermission.VIEW_OWN_CODES)) { if (super.requirePermissions(LicensePermission.VIEW_OWN_CODES)) {
if (gamesDataModel == null) { if (licenses == null) {
this.gameCodesDataModel = new ListDataModel<GameCode>(gameBean.findUserCodes(user)); this.licenseCodes = new ListDataModel<LicenseCode>(licenseBean.findUserCodes(user));
System.out.println("codecount: " + gameCodesDataModel.getRowCount());
this.beginConversation(); this.beginConversation();
} }
} }
} }
public ListDataModel<Game> getGames() { public String saveCurrentLicense() {
licenseBean.saveOrCreateLicense(currentLicense);
return gamesDataModel; return null;
}
public ListDataModel<GameCode> getGameCodes() {
return gameCodesDataModel;
} }
public Game getCurrentGame() {
return this.currentGame;
}
public void setCurrentGame(Game game) {
this.currentGame = game;
}
public String saveCurrentGame() { public String editSelected() {
gameBean.saveOrCreateGame(currentGame);
return null; return null;
} }
public String generateSelectedToAllPlaces() { public String openSelectedCode() {
if (gamesDataModel != null && gamesDataModel.isRowAvailable()) { /*if (gameCodesDataModel != null && gameCodesDataModel.isRowAvailable()) {
Game game = gamesDataModel.getRowData(); LicenseCode code = gameCodesDataModel.getRowData();
gameBean.generateCodesForAllPlaces(game); if (!licenseBean.accessCode(code, user)) {
this.addFaceMessage("game.out");
}
} }
*/
return null; return "todo";
} }
public String editSelected() { public boolean isNoGameCodes() {
//return (getGameCodes().getRowCount() <= 0);
/*if (gamesDataModel != null && gamesDataModel.isRowAvailable()) { return false;
currentGame = gamesDataModel.getRowData(); }
}*/ public ListDataModel<LicenseCode> getLicenseCodes() {
return licenseCodes;
}
return null; public void setLicenseCodes(ListDataModel<LicenseCode> licenseCodes) {
this.licenseCodes = licenseCodes;
} }
public String openSelectedCode() { public ListDataModel<LicenseTarget> getLicenses() {
if (gameCodesDataModel != null && gameCodesDataModel.isRowAvailable()) { return licenses;
GameCode code = gameCodesDataModel.getRowData(); }
if (!gameBean.accessCode(code, user)) { public void setLicenses(ListDataModel<LicenseTarget> licenses) {
this.addFaceMessage("game.out"); this.licenses = licenses;
} }
}
return null; public LicenseTarget getCurrentLicense() {
return currentLicense;
} }
public boolean isNoGameCodes() { public void setCurrentLicense(LicenseTarget currentLicense) {
return (getGameCodes().getRowCount() <= 0); this.currentLicense = currentLicense;
}
public List<Product> getProductsForLicenses() {
return productBean.findPlaceProducts();
} }
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!