diff --git a/src/main/java/com/beimi/config/web/GameServerConfiguration.java b/src/main/java/com/beimi/config/web/GameServerConfiguration.java index 6d4e883..248ab41 100644 --- a/src/main/java/com/beimi/config/web/GameServerConfiguration.java +++ b/src/main/java/com/beimi/config/web/GameServerConfiguration.java @@ -74,7 +74,7 @@ public class GameServerConfiguration // config.setSSLProtocol("https"); int workThreads = !StringUtils.isBlank(threads) && threads.matches("[\\d]{1,6}") ? Integer.parseInt(threads) : 100 ; config.setWorkerThreads(workThreads); - + // config.setStoreFactory(new HazelcastStoreFactory()); config.setAuthorizationListener(new AuthorizationListener() { public boolean isAuthorized(HandshakeData data) { diff --git a/src/main/java/com/beimi/config/web/StartedEventListener.java b/src/main/java/com/beimi/config/web/StartedEventListener.java index 388805a..6afd2a3 100644 --- a/src/main/java/com/beimi/config/web/StartedEventListener.java +++ b/src/main/java/com/beimi/config/web/StartedEventListener.java @@ -64,7 +64,7 @@ public class StartedEventListener implements ApplicationListener gamePlaywayList = playwayRes.findAll() ; - if(gamePlaywayList.size() > 0){ + if(gamePlaywayList != null){ for(GamePlayway playway : gamePlaywayList){ CacheHelper.getSystemCacheBean().put(playway.getId(), playway, playway.getOrgi()); } @@ -72,7 +72,7 @@ public class StartedEventListener implements ApplicationListener gameRoomList = gameRoomRes.findAll() ; - if(gameRoomList.size() > 0){ + if(gameRoomList!= null){ for(GameRoom gameRoom : gameRoomList){ if(gameRoom.isCardroom()){ gameRoomRes.delete(gameRoom);//回收房卡房间资源 diff --git a/src/main/java/com/beimi/config/web/StringToDateConverter.java b/src/main/java/com/beimi/config/web/StringToDateConverter.java new file mode 100644 index 0000000..bba43b9 --- /dev/null +++ b/src/main/java/com/beimi/config/web/StringToDateConverter.java @@ -0,0 +1,42 @@ +package com.beimi.config.web; + +import java.text.SimpleDateFormat; +import java.util.Date; + +import org.apache.commons.lang.StringUtils; +import org.springframework.core.convert.converter.Converter; + +public class StringToDateConverter implements Converter { + private static final String dateFormat = "yyyy-MM-dd HH:mm:ss"; + private static final String shortDateFormat = "yyyy-MM-dd"; + + /** + * @see org.springframework.core.convert.converter.Converter#convert(java.lang.Object) + */ + @Override + public Date convert(String source) { + if (StringUtils.isBlank(source)) { + return null; + } + source = source.trim(); + try { + if (source.contains("-")) { + SimpleDateFormat formatter; + if (source.contains(":")) { + formatter = new SimpleDateFormat(dateFormat); + } else { + formatter = new SimpleDateFormat(shortDateFormat); + } + Date dtDate = formatter.parse(source); + return dtDate; + } else if (source.matches("^\\d+$")) { + Long lDate = new Long(source); + return new Date(lDate); + } + } catch (Exception e) { + throw new RuntimeException(String.format("parser %s to Date fail", source)); + } + throw new RuntimeException(String.format("parser %s to Date fail", source)); + } + +} \ No newline at end of file diff --git a/src/main/java/com/beimi/config/web/WebConfigBeans.java b/src/main/java/com/beimi/config/web/WebConfigBeans.java new file mode 100644 index 0000000..5153010 --- /dev/null +++ b/src/main/java/com/beimi/config/web/WebConfigBeans.java @@ -0,0 +1,31 @@ +package com.beimi.config.web; + +import javax.annotation.PostConstruct; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Configuration; +import org.springframework.core.convert.support.GenericConversionService; +import org.springframework.web.bind.support.ConfigurableWebBindingInitializer; +import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter; + +@Configuration +public class WebConfigBeans { + @Autowired + private RequestMappingHandlerAdapter handlerAdapter; + + /** + * 增加字符串转日期的功能 + */ + @PostConstruct + public void initEditableValidation() { + + ConfigurableWebBindingInitializer initializer = (ConfigurableWebBindingInitializer) handlerAdapter + .getWebBindingInitializer(); + if (initializer.getConversionService() != null) { + GenericConversionService genericConversionService = (GenericConversionService) initializer + .getConversionService(); + genericConversionService.addConverter(new StringToDateConverter()); + } + + } +} \ No newline at end of file diff --git a/src/main/java/com/beimi/core/BMDataContext.java b/src/main/java/com/beimi/core/BMDataContext.java index 967f9f8..ed76384 100644 --- a/src/main/java/com/beimi/core/BMDataContext.java +++ b/src/main/java/com/beimi/core/BMDataContext.java @@ -13,6 +13,7 @@ public class BMDataContext { public static final String DEFAULT_TYPE = "default" ; //默认分类代码 public static final String BEIMI_SYSTEM_DIC = "com.dic.system.template"; public static final String BEIMI_SYSTEM_GAME_TYPE_DIC = "com.dic.game.type"; + public static final String BEIMI_SHOP_WARES_TYPE_DIC = "com.dic.shop.warestype"; public static final String BEIMI_SYSTEM_GAME_SCENE_DIC = "com.dic.scene.item"; public static final String BEIMI_SYSTEM_GAME_CARDTYPE_DIC = "com.dic.game.dizhu.cardtype"; diff --git a/src/main/java/com/beimi/web/handler/ApplicationController.java b/src/main/java/com/beimi/web/handler/ApplicationController.java index 1d20c1c..2df64d6 100644 --- a/src/main/java/com/beimi/web/handler/ApplicationController.java +++ b/src/main/java/com/beimi/web/handler/ApplicationController.java @@ -2,19 +2,14 @@ package com.beimi.web.handler; import javax.servlet.http.HttpServletRequest; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.ModelAndView; import com.beimi.util.Menu; -import com.beimi.web.service.repository.jpa.UserRepository; @Controller public class ApplicationController extends Handler{ - - @Autowired - private UserRepository userRepository; @RequestMapping("/") @Menu(type = "apps" , subtype = "index" , access = false) diff --git a/src/main/java/com/beimi/web/handler/api/rest/user/GuestPlayerController.java b/src/main/java/com/beimi/web/handler/api/rest/user/GuestPlayerController.java index 3513c94..72fb47e 100644 --- a/src/main/java/com/beimi/web/handler/api/rest/user/GuestPlayerController.java +++ b/src/main/java/com/beimi/web/handler/api/rest/user/GuestPlayerController.java @@ -106,6 +106,17 @@ public class GuestPlayerController extends Handler{ playerResultData.setGametype(gameConfig.getGamemodel()); playerResultData.setNoaiwaitime(gameConfig.getTimeout()); //无AI的时候 等待时长 playerResultData.setNoaimsg(gameConfig.getTimeoutmsg()); //无AI的时候,到达最大时长以后的 提示消息,提示完毕后,解散房间 + + playerResultData.setSubsidy(gameConfig.isSubsidy()); //是否启用了破产补助 + playerResultData.setSubtimes(gameConfig.getSubtimes()); //每天破产补助的次数 + playerResultData.setSubgolds(gameConfig.getSubgolds()); //每次破产补助的金额 + + playerResultData.setSubmsg(gameConfig.getSubmsg()); + + playerResultData.setRecmsg(gameConfig.getRecmsg()); + + playerResultData.setLefttimes(gameConfig.getSubtimes()); //需要从数据库中查询当天剩余次数 + /** * 封装 游戏对象,发送到客户端 */ diff --git a/src/main/java/com/beimi/web/handler/apps/AppsController.java b/src/main/java/com/beimi/web/handler/apps/AppsController.java index d77d8ad..42bb720 100644 --- a/src/main/java/com/beimi/web/handler/apps/AppsController.java +++ b/src/main/java/com/beimi/web/handler/apps/AppsController.java @@ -15,9 +15,6 @@ import com.beimi.web.service.repository.jpa.UserRepository; @Controller public class AppsController extends Handler{ - @Autowired - private UserRepository userRes; - @RequestMapping({"/apps/content"}) @Menu(type="apps", subtype="content") public ModelAndView content(ModelMap map , HttpServletRequest request){ diff --git a/src/main/java/com/beimi/web/handler/apps/business/platform/GameShopController.java b/src/main/java/com/beimi/web/handler/apps/business/platform/GameShopController.java new file mode 100644 index 0000000..6d304d3 --- /dev/null +++ b/src/main/java/com/beimi/web/handler/apps/business/platform/GameShopController.java @@ -0,0 +1,104 @@ +package com.beimi.web.handler.apps.business.platform; + +import java.util.Date; + +import javax.servlet.http.HttpServletRequest; +import javax.validation.Valid; + +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Sort; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.servlet.ModelAndView; + +import com.beimi.core.BMDataContext; +import com.beimi.util.Menu; +import com.beimi.util.cache.CacheHelper; +import com.beimi.web.handler.Handler; +import com.beimi.web.model.SysDic; +import com.beimi.web.model.Wares; +import com.beimi.web.service.repository.jpa.SkuRepository; +import com.beimi.web.service.repository.jpa.WaresRepository; + +@Controller +@RequestMapping("/apps/shop") +public class GameShopController extends Handler{ + + @Autowired + private WaresRepository waresRes ; + + @Autowired + private SkuRepository skuRes ; + + @RequestMapping({"/wares"}) + @Menu(type="shop", subtype="wares") + public ModelAndView account(ModelMap map , HttpServletRequest request , @Valid String type){ + if(!StringUtils.isBlank(type)) { + SysDic dic = (SysDic) CacheHelper.getSystemCacheBean().getCacheObject(type, BMDataContext.SYSTEM_ORGI) ; + if(dic!=null) { + map.addAttribute("dic" , dic) ; + map.addAttribute("waresList" , waresRes.findByOrgiAndWarestype(super.getOrgi(request), dic.getId() , new PageRequest(super.getP(request), super.getPs(request), Sort.Direction.ASC, "inx"))) ; + } + } + return request(super.createAppsTempletResponse("/apps/business/platform/shop/index")); + } + + @RequestMapping("/add") + @Menu(type="shop", subtype="wares") + public ModelAndView add(ModelMap map , HttpServletRequest request, @Valid String type) { + if(!StringUtils.isBlank(type)) { + Wares wares = new Wares(); + wares.setWarestype(type); + map.addAttribute("wares" , wares) ; + map.addAttribute("type" , type) ; + } + return request(super.createRequestPageTempletResponse("/apps/business/platform/shop/wares/add")); + } + + @RequestMapping("/save") + @Menu(type="shop", subtype="wares") + public ModelAndView save(HttpServletRequest request ,@Valid Wares wares , @RequestParam(value = "imageurl", required = false) MultipartFile imageurl) { + wares.setOrgi(super.getOrgi(request)); + wares.setCreater(super.getUser(request).getId()); + wares.setCreatetime(new Date()); + wares.setImageurl(""); + waresRes.save(wares) ; + return request(super.createRequestPageTempletResponse("redirect:/apps/shop/wares.html?type="+wares.getWarestype())); + } + + + @RequestMapping("/delete") + @Menu(type = "admin" , subtype = "role") + public ModelAndView userroledelete(HttpServletRequest request ,@Valid String id) { + Wares wares= waresRes.findByIdAndOrgi(id, super.getOrgi(request)) ; + if(wares!=null){ + waresRes.delete(wares) ; + } + return request(super.createRequestPageTempletResponse("redirect:/apps/shop/wares.html?type="+wares.getWarestype())); + } + + @RequestMapping("/edit") + @Menu(type="shop", subtype="wares") + public ModelAndView edit(ModelMap map ,HttpServletRequest request , @Valid String id) { + map.addAttribute("wares", waresRes.findByIdAndOrgi(id, super.getOrgi(request))) ; + return request(super.createRequestPageTempletResponse("/apps/business/platform/shop/wares/edit")) ; + } + + @RequestMapping("/update") + @Menu(type="shop", subtype="wares") + public ModelAndView update(HttpServletRequest request ,@Valid Wares wares) { + Wares temp = waresRes.findByIdAndOrgi(wares.getId(), super.getOrgi(request)) ; + if(temp != null){ + temp.setName(wares.getName()); + temp.setUpdatetime(new Date()); + temp.setOrgi(super.getOrgi(request)); + waresRes.save(wares) ; + } + return request(super.createRequestPageTempletResponse("redirect:/apps/shop/wares.html?type="+wares.getWarestype())); + } +} diff --git a/src/main/java/com/beimi/web/interceptor/UserInterceptorHandler.java b/src/main/java/com/beimi/web/interceptor/UserInterceptorHandler.java index 01aa9e5..9ea6053 100644 --- a/src/main/java/com/beimi/web/interceptor/UserInterceptorHandler.java +++ b/src/main/java/com/beimi/web/interceptor/UserInterceptorHandler.java @@ -80,6 +80,8 @@ public class UserInterceptorHandler extends HandlerInterceptorAdapter { view.addObject("systemConfig", new SystemConfig()) ; } view.addObject("gameTypeList", BeiMiDic.getInstance().getDic(BMDataContext.BEIMI_SYSTEM_GAME_TYPE_DIC)) ; + + view.addObject("shopWaresTypeList", BeiMiDic.getInstance().getDic(BMDataContext.BEIMI_SHOP_WARES_TYPE_DIC)) ; } } diff --git a/src/main/java/com/beimi/web/model/GameConfig.java b/src/main/java/com/beimi/web/model/GameConfig.java index a5bcfba..2b05507 100644 --- a/src/main/java/com/beimi/web/model/GameConfig.java +++ b/src/main/java/com/beimi/web/model/GameConfig.java @@ -60,6 +60,12 @@ public class GameConfig implements java.io.Serializable{ private boolean anysdkshare ; //启用 AnySDK分享 private boolean anysdklogin ; //启用 AnySDK登录验证 + private boolean subsidy ; //启用破产补助 + private int subtimes ; //破产补助次数 + private int subgolds ; //破产补助金额 + private String submsg ; //破产补助的提示消息 + private String recmsg ; //金币不足的提示,和破产补助提示 同时判断,如果还有破产补助,就不会提示这个 + @Id @Column(length = 32) @GeneratedValue(generator = "system-uuid") @@ -272,4 +278,34 @@ public class GameConfig implements java.io.Serializable{ public void setAnysdklogin(boolean anysdklogin) { this.anysdklogin = anysdklogin; } + public boolean isSubsidy() { + return subsidy; + } + public void setSubsidy(boolean subsidy) { + this.subsidy = subsidy; + } + public int getSubtimes() { + return subtimes; + } + public void setSubtimes(int subtimes) { + this.subtimes = subtimes; + } + public int getSubgolds() { + return subgolds; + } + public void setSubgolds(int subgolds) { + this.subgolds = subgolds; + } + public String getSubmsg() { + return submsg; + } + public void setSubmsg(String submsg) { + this.submsg = submsg; + } + public String getRecmsg() { + return recmsg; + } + public void setRecmsg(String recmsg) { + this.recmsg = recmsg; + } } diff --git a/src/main/java/com/beimi/web/model/ResultData.java b/src/main/java/com/beimi/web/model/ResultData.java index 859ef27..92be48e 100644 --- a/src/main/java/com/beimi/web/model/ResultData.java +++ b/src/main/java/com/beimi/web/model/ResultData.java @@ -26,6 +26,14 @@ public class ResultData implements java.io.Serializable{ private int noaiwaitime ; //没有AI接入的时候的最大等待时长 private String noaimsg ; //没有AI接入的时候达到最大等待时长的 提示消息 + private boolean subsidy ; //启用破产补助 + private int subtimes ; //破产补助次数 + private int subgolds ; //破产补助金额 + private String submsg ; //破产补助提示消息 + private String recmsg ; //金币不足进行充值的时候的提示 + + private int lefttimes ; //当天剩余补助次数 + private Token token ; private List games ; //游戏配置里选择的游戏类型 @@ -124,4 +132,52 @@ public class ResultData implements java.io.Serializable{ public void setNoaimsg(String noaimsg) { this.noaimsg = noaimsg; } + + public boolean isSubsidy() { + return subsidy; + } + + public void setSubsidy(boolean subsidy) { + this.subsidy = subsidy; + } + + public int getSubtimes() { + return subtimes; + } + + public void setSubtimes(int subtimes) { + this.subtimes = subtimes; + } + + public int getSubgolds() { + return subgolds; + } + + public void setSubgolds(int subgolds) { + this.subgolds = subgolds; + } + + public int getLefttimes() { + return lefttimes; + } + + public void setLefttimes(int lefttimes) { + this.lefttimes = lefttimes; + } + + public String getSubmsg() { + return submsg; + } + + public void setSubmsg(String submsg) { + this.submsg = submsg; + } + + public String getRecmsg() { + return recmsg; + } + + public void setRecmsg(String recmsg) { + this.recmsg = recmsg; + } } diff --git a/src/main/java/com/beimi/web/model/Sku.java b/src/main/java/com/beimi/web/model/Sku.java new file mode 100644 index 0000000..9a919dc --- /dev/null +++ b/src/main/java/com/beimi/web/model/Sku.java @@ -0,0 +1,154 @@ +package com.beimi.web.model; + +import java.util.Date; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; + +@Entity +@Table(name = "bm_wares_sku") +@org.hibernate.annotations.Proxy(lazy = false) +public class Sku implements java.io.Serializable{ + + /** + * + */ + private static final long serialVersionUID = 1115593425069549681L; + + private String id ; + private String name ; + private String code ; + + private int inx; //知识分类排序位置 + + private Date createtime ; + private String creater; + private String username ; + + private String description ;//分类备注描述信息 + + private Date updatetime ; + private String waresid ; //商品ID + private String pmethod ; //购买方式 + + private String status ; //状态,启用,禁用 + + private boolean defaultsku ;//默认使用 + + private int price ; //价格 + private int stock; //库存 + private int sku; //SKU销量 + private String orgi ; + + @Id + @Column(length = 32) + @GeneratedValue(generator = "system-uuid") + @GenericGenerator(name = "system-uuid", strategy = "uuid") + public String getId() { + return id; + } + public void setId(String id) { + this.id = id; + } + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + public String getCode() { + return code; + } + public void setCode(String code) { + this.code = code; + } + public int getInx() { + return inx; + } + public void setInx(int inx) { + this.inx = inx; + } + public Date getCreatetime() { + return createtime; + } + public void setCreatetime(Date createtime) { + this.createtime = createtime; + } + public String getCreater() { + return creater; + } + public void setCreater(String creater) { + this.creater = creater; + } + public String getUsername() { + return username; + } + public void setUsername(String username) { + this.username = username; + } + public String getDescription() { + return description; + } + public void setDescription(String description) { + this.description = description; + } + public Date getUpdatetime() { + return updatetime; + } + public void setUpdatetime(Date updatetime) { + this.updatetime = updatetime; + } + public String getWaresid() { + return waresid; + } + public void setWaresid(String waresid) { + this.waresid = waresid; + } + public String getPmethod() { + return pmethod; + } + public void setPmethod(String pmethod) { + this.pmethod = pmethod; + } + public int getPrice() { + return price; + } + public void setPrice(int price) { + this.price = price; + } + public int getStock() { + return stock; + } + public void setStock(int stock) { + this.stock = stock; + } + public int getSku() { + return sku; + } + public void setSku(int sku) { + this.sku = sku; + } + public String getOrgi() { + return orgi; + } + public void setOrgi(String orgi) { + this.orgi = orgi; + } + public String getStatus() { + return status; + } + public void setStatus(String status) { + this.status = status; + } + public boolean isDefaultsku() { + return defaultsku; + } + public void setDefaultsku(boolean defaultsku) { + this.defaultsku = defaultsku; + } +} diff --git a/src/main/java/com/beimi/web/model/Wares.java b/src/main/java/com/beimi/web/model/Wares.java new file mode 100644 index 0000000..51791e2 --- /dev/null +++ b/src/main/java/com/beimi/web/model/Wares.java @@ -0,0 +1,210 @@ +package com.beimi.web.model; + + +import java.util.Date; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; + +@Entity +@Table(name = "bm_wares") +@org.hibernate.annotations.Proxy(lazy = false) +public class Wares implements java.io.Serializable{ + + /** + * + */ + private static final long serialVersionUID = 1115593425069549681L; + + private String id ; + private String name ; + private String code ; + + /** + * 之所以将 商品和SKU分开,是因为,处理金币、钻石、房卡以外的,某些有限量的商品需要有库存限制,例如兑换的商品,先到先得 + * 通过SKU来控制库存,能够更好的管理商城里的商品销售,此外,根据租户自己选择销售的商品 , 例如: + * 几点到几点卖什 么、卖的东西轮流在切换;什么日子特别卖什么;每周的什么时候卖什么,当玩家满足某 个条件的时候,可以购买什么 + * 再例如:玩家有超级贝卡的时候,可以8折的价格购买商城内的所有物品 + * + * + */ + private int price ; //建议价格 , 由SKU定价和库存 + private int stock ; + private String imageurl ; + private String warestype; + + private String recomtype ; + + private String pmethod ; //购买方式 + private String shopid ; //店铺ID , 备用 + private int spu ; //SPU销量 + private String payment ; //支付方式 + + private int inx; //商品排序位置 + + private Date createtime ; + private String creater; + private String username ; + + private Date starttime; + private Date endtime ; + + + private String description ;//商品备注描述信息 + + private Date updatetime ; + private String orgi ; + + private String status ; //状态,启用,禁用 + + private boolean enablesku ; //是否启用SKU + + @Id + @Column(length = 32) + @GeneratedValue(generator = "system-uuid") + @GenericGenerator(name = "system-uuid", strategy = "uuid") + public String getId() { + return id; + } + public void setId(String id) { + this.id = id; + } + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + public String getCode() { + return code; + } + public void setCode(String code) { + this.code = code; + } + public int getInx() { + return inx; + } + public void setInx(int inx) { + this.inx = inx; + } + public Date getCreatetime() { + return createtime; + } + public void setCreatetime(Date createtime) { + this.createtime = createtime; + } + public String getCreater() { + return creater; + } + public void setCreater(String creater) { + this.creater = creater; + } + public String getUsername() { + return username; + } + public void setUsername(String username) { + this.username = username; + } + public String getDescription() { + return description; + } + public void setDescription(String description) { + this.description = description; + } + public Date getUpdatetime() { + return updatetime; + } + public void setUpdatetime(Date updatetime) { + this.updatetime = updatetime; + } + public int getPrice() { + return price; + } + public void setPrice(int price) { + this.price = price; + } + public int getStock() { + return stock; + } + public void setStock(int stock) { + this.stock = stock; + } + public String getImageurl() { + return imageurl; + } + public void setImageurl(String imageurl) { + this.imageurl = imageurl; + } + public String getWarestype() { + return warestype; + } + public void setWarestype(String warestype) { + this.warestype = warestype; + } + public String getPmethod() { + return pmethod; + } + public void setPmethod(String pmethod) { + this.pmethod = pmethod; + } + public String getShopid() { + return shopid; + } + public void setShopid(String shopid) { + this.shopid = shopid; + } + public int getSpu() { + return spu; + } + public void setSpu(int spu) { + this.spu = spu; + } + public String getOrgi() { + return orgi; + } + public void setOrgi(String orgi) { + this.orgi = orgi; + } + public String getStatus() { + return status; + } + public void setStatus(String status) { + this.status = status; + } + public Date getStarttime() { + return starttime; + } + public void setStarttime(Date starttime) { + this.starttime = starttime; + } + public Date getEndtime() { + return endtime; + } + public void setEndtime(Date endtime) { + this.endtime = endtime; + } + public String getRecomtype() { + return recomtype; + } + public void setRecomtype(String recomtype) { + this.recomtype = recomtype; + } + public boolean isEnablesku() { + return enablesku; + } + public void setEnablesku(boolean enablesku) { + this.enablesku = enablesku; + } + public String getPayment() { + return payment; + } + public void setPayment(String payment) { + this.payment = payment; + } + +} diff --git a/src/main/java/com/beimi/web/model/WaresType.java b/src/main/java/com/beimi/web/model/WaresType.java new file mode 100644 index 0000000..02466c4 --- /dev/null +++ b/src/main/java/com/beimi/web/model/WaresType.java @@ -0,0 +1,109 @@ +package com.beimi.web.model; + +import java.util.Date; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; + +@Entity +@Table(name = "bm_wares_type") +@org.hibernate.annotations.Proxy(lazy = false) +public class WaresType implements java.io.Serializable{ + + /** + * + */ + private static final long serialVersionUID = 1115593425069549681L; + + private String id ; + private String name ; + private String code ; + + private int inx; //知识分类排序位置 + + private Date createtime ; + private String creater; + private String username ; + + private String description ;//分类备注描述信息 + + private Date updatetime ; + private String parentid ; //父级ID + private String orgi ; + + @Id + @Column(length = 32) + @GeneratedValue(generator = "system-uuid") + @GenericGenerator(name = "system-uuid", strategy = "uuid") + public String getId() { + return id; + } + public void setId(String id) { + this.id = id; + } + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + public String getCode() { + return code; + } + public void setCode(String code) { + this.code = code; + } + public int getInx() { + return inx; + } + public void setInx(int inx) { + this.inx = inx; + } + public Date getCreatetime() { + return createtime; + } + public void setCreatetime(Date createtime) { + this.createtime = createtime; + } + public String getCreater() { + return creater; + } + public void setCreater(String creater) { + this.creater = creater; + } + public String getUsername() { + return username; + } + public void setUsername(String username) { + this.username = username; + } + public String getDescription() { + return description; + } + public void setDescription(String description) { + this.description = description; + } + public Date getUpdatetime() { + return updatetime; + } + public void setUpdatetime(Date updatetime) { + this.updatetime = updatetime; + } + public String getParentid() { + return parentid; + } + public void setParentid(String parentid) { + this.parentid = parentid; + } + public String getOrgi() { + return orgi; + } + public void setOrgi(String orgi) { + this.orgi = orgi; + } +} diff --git a/src/main/java/com/beimi/web/service/repository/jpa/SkuRepository.java b/src/main/java/com/beimi/web/service/repository/jpa/SkuRepository.java new file mode 100644 index 0000000..98483e0 --- /dev/null +++ b/src/main/java/com/beimi/web/service/repository/jpa/SkuRepository.java @@ -0,0 +1,20 @@ +package com.beimi.web.service.repository.jpa; + +import java.util.List; + +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.jpa.repository.JpaRepository; + +import com.beimi.web.model.Sku; + +public interface SkuRepository extends JpaRepository{ + + public abstract Sku findByIdAndOrgi(String id, String orgi); + + public abstract Page findByOrgi(String orgi, Pageable page); + + public abstract List findByOrgi(String orgi); + + public abstract List findByOrgiAndWaresid(String orgi, String waresid); +} diff --git a/src/main/java/com/beimi/web/service/repository/jpa/WaresRepository.java b/src/main/java/com/beimi/web/service/repository/jpa/WaresRepository.java new file mode 100644 index 0000000..12727e7 --- /dev/null +++ b/src/main/java/com/beimi/web/service/repository/jpa/WaresRepository.java @@ -0,0 +1,23 @@ +package com.beimi.web.service.repository.jpa; + +import java.util.List; + +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.jpa.repository.JpaRepository; + +import com.beimi.web.model.Wares; + +public interface WaresRepository extends JpaRepository{ + + public abstract Wares findByIdAndOrgi(String id, String orgi); + + public abstract Page findByOrgi(String orgi, Pageable page); + + public abstract List findByOrgi(String orgi); + + public abstract List findByOrgiAndWarestype(String orgi, String warestype); + + + public abstract Page findByOrgiAndWarestype(String orgi, String warestype, Pageable page); +} diff --git a/src/main/java/com/beimi/web/service/repository/jpa/WaresTypeRepository.java b/src/main/java/com/beimi/web/service/repository/jpa/WaresTypeRepository.java new file mode 100644 index 0000000..9aa0220 --- /dev/null +++ b/src/main/java/com/beimi/web/service/repository/jpa/WaresTypeRepository.java @@ -0,0 +1,14 @@ +package com.beimi.web.service.repository.jpa; + +import java.util.List; + +import org.springframework.data.jpa.repository.JpaRepository; + +import com.beimi.web.model.WaresType; + +public interface WaresTypeRepository extends JpaRepository{ + + public abstract WaresType findByIdAndOrgi(String id, String orgi); + + public abstract List findByOrgi(String orgi, String code); +} diff --git a/src/main/resources/static/css/beimi.css b/src/main/resources/static/css/beimi.css index bcc1f71..e343e83 100644 --- a/src/main/resources/static/css/beimi.css +++ b/src/main/resources/static/css/beimi.css @@ -2309,8 +2309,6 @@ select{ height: 38px; line-height: 38px; line-height: 36px\9; - border: 1px solid #f0f2f5; - background-color: #fff; border-radius: 2px; color:#666666; width:190px; diff --git a/src/main/resources/templates/apps/business/platform/config/game.html b/src/main/resources/templates/apps/business/platform/config/game.html index 89f1a79..62f96ca 100644 --- a/src/main/resources/templates/apps/business/platform/config/game.html +++ b/src/main/resources/templates/apps/business/platform/config/game.html @@ -170,6 +170,67 @@ +
+
7、启用破产补助功能
+
+
+
+

玩家的金币用完以后的补助功能

+

启用后设置每天补助的次数和每次补助的金币数量

+
+
+ checked="checked"> +
+
+
+
+
+

破产补助次数

+

填写每个玩家每天可以进行破产补助的次数

+
+
+ + +
+
+
+
+

每次补助的金币数量

+

填写每次破产补助的金币数量

+
+
+ +
+
+
+
+

破产补助的提示消息

+

客户端弹出提示破产补助的提示消息

+
+
+ +
+
+
+ +
+
8、金币不足时进入充值的提示消息
+
+
+
+

玩家金币不足的时候,点击进入游戏时的提示消息

+

玩家如果还有破产补助次数,系统会优先提示进行破产补助

+
+
+ +
+
+
+
@@ -254,6 +315,13 @@ }else{ $('.anysdk').hide(); } - }) + }); + form.on("checkbox(subsidy)" , function(data){ + if(data.elem.checked == true){ + $('.subsidy').show(); + }else{ + $('.subsidy').hide(); + } + }); }); \ No newline at end of file diff --git a/src/main/resources/templates/apps/business/platform/include/left.html b/src/main/resources/templates/apps/business/platform/include/left.html index abeb33b..a8c935f 100644 --- a/src/main/resources/templates/apps/business/platform/include/left.html +++ b/src/main/resources/templates/apps/business/platform/include/left.html @@ -35,6 +35,31 @@ +
  • + 游戏商城 +
    + <#if shopWaresTypeList??> + <#list shopWaresTypeList as shopWaresType> +
    class="layui-this"> + ${shopWaresType.name!''} +
    + + +
    +
  • + +
  • + 订单管理 +
    +
    class="layui-this"> + 订单管理 +
    +
    class="layui-this"> + 购买记录 +
    +
    +
  • +
  • 游戏信息
    diff --git a/src/main/resources/templates/apps/business/platform/shop/index.html b/src/main/resources/templates/apps/business/platform/shop/index.html new file mode 100644 index 0000000..48e1a7b --- /dev/null +++ b/src/main/resources/templates/apps/business/platform/shop/index.html @@ -0,0 +1,121 @@ +
    +
    +
    + <#include "/apps/business/platform/include/left.html"/>
    +
    +
    +
    +
    +

    + 商品列表<#if waresList??>(${waresList.totalElements!''}) + + + +

    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + <#if waresList?? && waresList.content??> + <#list waresList.content as wares> + + + + + + + + + + + + + +
    名称分类价格支付方式状态序号启用SKU操作
    + + +
    + ${wares.name!''} + <#if wares.datastatus == true>(已删除) +
    +
    + <#if wares.starttime == null && wares.endtime == null> + 永久有效 + <#else> + ${wares.starttime!''}~${wares.endtime!''} + +
    + +
    + +
    ${uKeFuDic[wares.warestype!''].name!''} ${wares.price!''}${uKeFuDic[wares.payment!''].name!''} + <#if wares.status?? && wares.status == "on">上架 + <#if wares.status?? && wares.status == "off">下架 + ${wares.inx!''} + <#if wares.enablesku?? && wares.enablesku == true> + + + + + + 编辑 + + <#if !(wares.warestype?? && wares.warestype == "0") && wares.datastatus != true > + + + 删除 + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + \ No newline at end of file diff --git a/src/main/resources/templates/apps/business/platform/shop/wares/add.html b/src/main/resources/templates/apps/business/platform/shop/wares/add.html new file mode 100644 index 0000000..aa662a6 --- /dev/null +++ b/src/main/resources/templates/apps/business/platform/shop/wares/add.html @@ -0,0 +1,164 @@ +<#include "/public/macro.html"> +
    +
    +
    +
    +

    基本信息

    +
    +
    +
    + +
    + + *(必填项) +
    +
    + +
    + +
    + <@select "com.dic.shop.warestype" "warestype" type!'' "lay-ignore required lay-verify='required' "/> +
    +
    +
    +
    +
    + +
    + <@select "com.dic.shop.payment" "payment" payment!'' "lay-ignore required lay-verify='required' "/> +
    +
    +
    + +
    + <@select "com.dic.shop.recomtyped" "recomtype" recomtype!'' "lay-ignore required lay-verify='required' "/> +
    +
    +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    +
    +
    + +
    + + +
    +
    +
    + +
    + + +
    +
    +
    +
    +
    +
    +

    扩展信息

    +
    +
    +
    + +
    + + +
    +
    +
    + +
    + + +
    +
    +
    + + +
    +
    + +
    + +
    +
    +
    + +
    +
    + +
    + +
    +
    +
    +
    +
    +
    + +
    +
    + + +
    +
    +
    +
    + + \ No newline at end of file diff --git a/src/main/resources/templates/apps/business/platform/shop/wares/edit.html b/src/main/resources/templates/apps/business/platform/shop/wares/edit.html new file mode 100644 index 0000000..52889a9 --- /dev/null +++ b/src/main/resources/templates/apps/business/platform/shop/wares/edit.html @@ -0,0 +1,163 @@ +<#include "/public/macro.html"> +
    +
    + +
    +
    +

    基本信息

    +
    +
    +
    + +
    + + *(必填项) +
    +
    + +
    + +
    + <@select "com.dic.shop.warestype" "warestype" wares.warestype!'' "lay-ignore required lay-verify='required' "/> +
    +
    +
    +
    +
    + +
    + <@select "com.dic.shop.payment" "payment" wares.payment!'' "lay-ignore required lay-verify='required' "/> +
    +
    +
    + +
    + <@select "com.dic.shop.recomtyped" "recomtype" wares.recomtype!'' "lay-ignore required lay-verify='required' "/> +
    +
    +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    +
    +
    + +
    + checked> + checked> +
    +
    +
    + +
    + checked> + checked> +
    +
    +
    +
    +
    +
    +

    扩展信息

    +
    +
    +
    + +
    + + +
    +
    +
    + +
    + + +
    +
    +
    + + +
    +
    + +
    + +
    +
    +
    + +
    +
    + +
    + +
    +
    +
    +
    +
    +
    + +
    +
    + + +
    +
    +
    +
    + + \ No newline at end of file diff --git a/src/main/resources/templates/public/macro.html b/src/main/resources/templates/public/macro.html new file mode 100644 index 0000000..5e6da95 --- /dev/null +++ b/src/main/resources/templates/public/macro.html @@ -0,0 +1,42 @@ +<#macro select code name value attr style> + + + + +<#macro select2 code name value attr style defaultname> + + + +<#macro subselect macroSysDicList name value attr style> + + + + +<#macro checkbox sysDicList name value style> + <#list sysDicList as macroSysDic> + checked="checked"> + + + +<#macro checkbox sysDicList name value style> + <#list sysDicList as macroSysDic> + checked="checked"> + + \ No newline at end of file