diff --git a/src/main/java/com/jmfy/controller/CdkInfoController.java b/src/main/java/com/jmfy/controller/CdkInfoController.java index 99381b6..22574fa 100644 --- a/src/main/java/com/jmfy/controller/CdkInfoController.java +++ b/src/main/java/com/jmfy/controller/CdkInfoController.java @@ -1,6 +1,7 @@ package com.jmfy.controller; import com.jmfy.dao.CdkInfoDao; +import com.jmfy.dao.ServerInfoDao; import com.jmfy.dao.UserInfoDao; import com.jmfy.dao.impl.GSUserDaoImpl; import com.jmfy.model.*; @@ -31,7 +32,19 @@ public class CdkInfoController { private GSUserDaoImpl gsUserDao; @Resource private SeqUtils seqUtils; + @Resource + private ServerInfoDao serverInfoDao; + @RequestMapping(value = "/toAddCDKGoodsPage",method = RequestMethod.GET) + public String toAddCDKGoodsPage(ModelMap map){ + try { + List allServerInfo = serverInfoDao.getAllServerInfo(); + map.addAttribute("serverInfo",allServerInfo); + } catch (Exception e) { + e.printStackTrace(); + } + return "toAddCDKGoods"; + } /** * 生成序列号 */ @@ -58,6 +71,7 @@ public class CdkInfoController { cdkInfo.setId(id); cdkInfo.setGoodsId(goodsId); cdkInfo.setStatus(0); + cdkInfo.setServerId(scdkInfo.getServerId()); cdkInfoDao.addCdkInfo(cdkInfo); } //scdkInfo.setIsAdd(1); @@ -116,6 +130,7 @@ public class CdkInfoController { cdkInfoVo.setType(String.valueOf(sCdkInfo.getUsetype())); cdkInfoVo.setPid(sCdkInfo.getPid()); cdkInfoVo.setRoleUseNum(sCdkInfo.getRoleUseNum()); + cdkInfoVo.setServerId(sCdkInfo.getServerId()); sCdkInfoListVo.add(cdkInfoVo); } map.put("sCdkInfoList",sCdkInfoListVo); @@ -160,6 +175,7 @@ public class CdkInfoController { String endTime = JsonUtil.date3TimeStamp(parameterMap.get("endTime")); String goodsInfo = parameterMap.get("goodsInfo"); String reward = JsonUtil.getInstence().getReward(request); + String serverId = parameterMap.get("serverId"); if (reward.isEmpty()){ throw new Exception("item erro !!!"); } @@ -175,6 +191,7 @@ public class CdkInfoController { sCdkInfo.setIsAdd(0); sCdkInfo.setPid(Integer.parseInt(pid)); sCdkInfo.setRoleUseNum(Integer.parseInt(roleUseNum)); + sCdkInfo.setServerId(Integer.parseInt(serverId)); cdkInfoDao.addCDKGoodsInfo(sCdkInfo); return "redirect:/toCDKBuild"; } diff --git a/src/main/java/com/jmfy/model/CdkInfo.java b/src/main/java/com/jmfy/model/CdkInfo.java index c884a29..edf1cf5 100644 --- a/src/main/java/com/jmfy/model/CdkInfo.java +++ b/src/main/java/com/jmfy/model/CdkInfo.java @@ -15,6 +15,9 @@ public class CdkInfo { @Field(value = "status") private int status; // 是否兑换 0:未兑换 1:已兑换 + @Field(value = "serverId") + private int serverId; + public String getId() { return id; } @@ -38,5 +41,13 @@ public class CdkInfo { public void setStatus(int status) { this.status = status; } + + public int getServerId() { + return serverId; + } + + public void setServerId(int serverId) { + this.serverId = serverId; + } } diff --git a/src/main/java/com/jmfy/model/SCdkInfo.java b/src/main/java/com/jmfy/model/SCdkInfo.java index 257716b..d2c9fd5 100644 --- a/src/main/java/com/jmfy/model/SCdkInfo.java +++ b/src/main/java/com/jmfy/model/SCdkInfo.java @@ -42,6 +42,9 @@ public class SCdkInfo { @Field(value = "isAdd") private int isAdd; // 1: 已生成过 ,0: 未生成过 + @Field(value = "serverId") + private int serverId; + public int getId() { return id; } @@ -129,5 +132,13 @@ public class SCdkInfo { public void setRoleUseNum(int roleUseNum) { this.roleUseNum = roleUseNum; } + + public int getServerId() { + return serverId; + } + + public void setServerId(int serverId) { + this.serverId = serverId; + } } diff --git a/src/main/java/com/jmfy/model/vo/CDKInfoVo.java b/src/main/java/com/jmfy/model/vo/CDKInfoVo.java index 23d2877..9de6bd8 100644 --- a/src/main/java/com/jmfy/model/vo/CDKInfoVo.java +++ b/src/main/java/com/jmfy/model/vo/CDKInfoVo.java @@ -22,6 +22,8 @@ public class CDKInfoVo { public int pid ; // pid + public int serverId; + public void setId(int id) { this.id = id; } @@ -61,4 +63,12 @@ public class CDKInfoVo { public void setRoleUseNum(long roleUseNum) { this.roleUseNum = roleUseNum; } + + public int getServerId() { + return serverId; + } + + public void setServerId(int serverId) { + this.serverId = serverId; + } } diff --git a/src/main/resources/templates/CDKBuild.html b/src/main/resources/templates/CDKBuild.html index 56693e3..507f7d0 100644 --- a/src/main/resources/templates/CDKBuild.html +++ b/src/main/resources/templates/CDKBuild.html @@ -34,6 +34,7 @@ 礼包名称 礼包id + 区服id pid 礼包数量 开始时间 @@ -50,6 +51,7 @@ + diff --git a/src/main/resources/templates/index.html b/src/main/resources/templates/index.html index e05f4f9..e9c99be 100644 --- a/src/main/resources/templates/index.html +++ b/src/main/resources/templates/index.html @@ -84,12 +84,12 @@
diff --git a/src/main/resources/static/html/toAddCDKGoods.html b/src/main/resources/templates/toAddCDKGoods.html similarity index 79% rename from src/main/resources/static/html/toAddCDKGoods.html rename to src/main/resources/templates/toAddCDKGoods.html index ef0f06b..13df86b 100644 --- a/src/main/resources/static/html/toAddCDKGoods.html +++ b/src/main/resources/templates/toAddCDKGoods.html @@ -1,6 +1,6 @@  - + @@ -10,18 +10,18 @@ - - - - - + + + + + + + + + + + 基本设置 @@ -50,6 +50,17 @@
+
+ +
+ +
+