Merge branch 'dh_dev_guild' into jieling

master
duhui 2021-05-25 10:23:17 +08:00
commit f456475d57
21 changed files with 1628 additions and 32 deletions

View File

@ -35,6 +35,7 @@ public class CdkInfoController {
@Resource
private ServerInfoDao serverInfoDao;
@SuppressWarnings("Duplicates")
@RequestMapping(value = "/toAddCDKGoodsPage",method = RequestMethod.GET)
public String toAddCDKGoodsPage(ModelMap map){
Map<Integer, String> itemNameMap = FileCacheUtils.itemNameMap;
@ -51,7 +52,7 @@ public class CdkInfoController {
*
*/
@RequestMapping(value = "/addCdkNumber", method = {RequestMethod.POST, RequestMethod.GET})
public @ResponseBody int addCdkNumber(HttpSession session, ModelMap map , HttpServletRequest request) throws Exception {
public @ResponseBody int addCdkNumber(HttpServletRequest request) throws Exception {
HashMap<String, String> parameterMap = JsonUtil.getInstence().getParameterMap(request);
int goodsId = Integer.parseInt(parameterMap.get("goodsId"));
SCdkInfo scdkInfo = cdkInfoDao.getScdkInfo(goodsId);
@ -59,15 +60,25 @@ public class CdkInfoController {
return 1;
}
long time = System.currentTimeMillis();
if (scdkInfo.getIsAdd() ==1){
if (scdkInfo.getIsAdd() == 1){
return 3;
}
if (scdkInfo.getStartTime() > time || scdkInfo.getEndTime() < time) {
return 2;
}
// 自定义礼包码生成
if (!"".equals(scdkInfo.getCustomGood())){
CdkInfo cdkInfo = new CdkInfo();
cdkInfo.setId(scdkInfo.getCustomGood());
cdkInfo.setGoodsId(goodsId);
cdkInfo.setStatus(0);
cdkInfo.setServerId(scdkInfo.getServerId());
cdkInfoDao.addCdkInfo(cdkInfo);
}
// 随机礼包码生成
else {
for (int i = 0; i < scdkInfo.getGoodsSum(); i++) {
long nowTime = System.currentTimeMillis();
String sdk = "JLCDK" + goodsId + nowTime + UUID.randomUUID().toString();
String sdk = "JLCDK" + goodsId + DateUtil.now() + UUID.randomUUID().toString();
String id = MD5Util.encrypByMd5(sdk);
CdkInfo cdkInfo = new CdkInfo();
cdkInfo.setId(id);
@ -76,8 +87,7 @@ public class CdkInfoController {
cdkInfo.setServerId(scdkInfo.getServerId());
cdkInfoDao.addCdkInfo(cdkInfo);
}
//scdkInfo.setIsAdd(1);
cdkInfoDao.updateCdkGoodsInfo(scdkInfo,goodsId);
}
return 0;
}
@ -85,8 +95,9 @@ public class CdkInfoController {
public @ResponseBody int deleteCdkNumber(ModelMap map,int goodsId) throws Exception {
return cdkInfoDao.deleteCdk(goodsId);
}
@RequestMapping(value = "/findCdkInfo", method = {RequestMethod.POST, RequestMethod.GET})
public String findCdkInfo (HttpSession session, ModelMap map , HttpServletRequest request) throws Exception {
public String findCdkInfo (ModelMap map , HttpServletRequest request) throws Exception {
HashMap<String, String> parameterMap = JsonUtil.getInstence().getParameterMap(request);
int serverId = Integer.parseInt(parameterMap.get("serverId"));
String cdkNum = parameterMap.get("cdkNum");
@ -119,7 +130,7 @@ public class CdkInfoController {
*
*/
@RequestMapping(value = "/toCDKBuild", method = {RequestMethod.POST, RequestMethod.GET})
public String toCDKBuild (HttpSession session, ModelMap map , HttpServletRequest request) throws Exception {
public String toCDKBuild (ModelMap map) throws Exception {
List<SCdkInfo> sCdkInfoList = cdkInfoDao.getScdkInfoList();
List<CDKInfoVo> sCdkInfoListVo = new ArrayList<>();
for (SCdkInfo sCdkInfo :sCdkInfoList){
@ -129,7 +140,6 @@ public class CdkInfoController {
cdkInfoVo.setGoodsInfo(sCdkInfo.getGoodsInfo());
cdkInfoVo.setStartTime(JsonUtil.timeStamp2Date(String.valueOf(sCdkInfo.getStartTime())));
cdkInfoVo.setEndTime(JsonUtil.timeStamp2Date(String.valueOf(sCdkInfo.getEndTime())));
// long goodsNum = cdkInfoDao.getCdkNumByGoodsId(sCdkInfo.getId());
cdkInfoVo.setGoodsNum(sCdkInfo.getGoodsSum());
long useNum = cdkInfoDao.getUseCdkNumByGoodsId(sCdkInfo.getId());
cdkInfoVo.setUseNum(useNum);
@ -146,18 +156,19 @@ public class CdkInfoController {
@RequestMapping(value = "/downloadFile", method = {RequestMethod.POST, RequestMethod.GET})
public ResponseEntity<byte[]> downloadFile (HttpSession session, HttpServletRequest request, HttpServletResponse response) throws Exception {
public ResponseEntity<byte[]> downloadFile (HttpServletRequest request) throws Exception {
HashMap<String, String> parameterMap = JsonUtil.getInstence().getParameterMap(request);
int goodsId = Integer.parseInt(parameterMap.get("goodsId"));
String osName = System.getProperty("os.name");
String path;
if (osName.matches("^(?i)Windows.*$")) {// Window 系统
if (osName.matches("^(?i)Windows.*$")) {
// Window 系统
path = "conf/txt/";
} else {// Linux 系统
path = "./config/txt/";
}
List<CdkInfo> cdkInfoList = cdkInfoDao.findCdkUseInfoByGoodsId(goodsId);
path = path + "cdk_"+goodsId + System.currentTimeMillis()+"_.txt";
path = path + "cdk_" + goodsId + "_" + DateUtil.now() +"_.txt";
List<String> cdkNumList = new ArrayList<>();
for (CdkInfo cdkInfo :cdkInfoList){
cdkNumList.add(cdkInfo.getId());
@ -171,7 +182,7 @@ public class CdkInfoController {
*
*/
@RequestMapping(value = "/addCdkGoodsInfo", method = {RequestMethod.POST, RequestMethod.GET})
public String addCdkGoodsInfo(HttpSession session, ModelMap map , HttpServletRequest request) throws Exception {
public String addCdkGoodsInfo(HttpServletRequest request) throws Exception {
HashMap<String, String> parameterMap = JsonUtil.getInstence().getParameterMap(request);
String pid = parameterMap.get("pid");
String roleUseNum = parameterMap.get("roleUseNum");
@ -181,10 +192,19 @@ public class CdkInfoController {
String startTime = JsonUtil.date3TimeStamp(parameterMap.get("startTime"));
String endTime = JsonUtil.date3TimeStamp(parameterMap.get("endTime"));
String goodsInfo = parameterMap.get("goodsInfo");
String reward = JsonUtil.getInstence().getReward(request);
String serverId = parameterMap.get("serverId");
String reward = JsonUtil.getInstence().getReward(request);
if (reward.isEmpty()){
throw new Exception("item erro !!!");
throw new Exception("item error !!!");
}
String customGood = parameterMap.get("customGood");
if (!"".equals(customGood)){
CdkInfo info = cdkInfoDao.findCdkInfoBuyId(customGood);
if (info != null){
throw new Exception("error customGood is exist !!!");
}
}
SCdkInfo sCdkInfo = new SCdkInfo();
sCdkInfo.setId(seqUtils.getSequence("cdk_goods_id"));
@ -200,6 +220,7 @@ public class CdkInfoController {
sCdkInfo.setRoleUseNum(Integer.parseInt(roleUseNum));
sCdkInfo.setServerId(Integer.parseInt(serverId));
sCdkInfo.setBuildTime(Calendar.getInstance().getTime().getTime());
sCdkInfo.setCustomGood(customGood);
cdkInfoDao.addCDKGoodsInfo(sCdkInfo);
return "redirect:/toCDKBuild";
}

View File

@ -0,0 +1,156 @@
package com.jmfy.controller;
import com.jmfy.WebSecurityConfig;
import com.jmfy.dao.CUserDao;
import com.jmfy.dao.GSUserDao;
import com.jmfy.dao.GsGuildDao;
import com.jmfy.dao.ServerInfoDao;
import com.jmfy.dao.impl.GsGuildDaoImpl;
import com.jmfy.model.CAdmin;
import com.jmfy.model.GsGuildInfoBean;
import com.jmfy.model.ServerInfo;
import com.jmfy.model.vo.GsGuildInfoBeanVo;
import com.jmfy.model.vo.GuildMemberVo;
import com.jmfy.model.vo.PowersEnum;
import com.jmfy.utils.DateUtil;
import com.jmfy.utils.JsonUtil;
import com.jmfy.utils.RPCClient;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.*;
/**
* @Author hj
* @Date 2021/5/20 10:13
* @Description:
* @Version 1.0
*/
@Controller
public class GuildController {
@Resource
private GsGuildDao gsGuildDao;
@Resource
private ServerInfoDao serverInfoDao;
@Resource
private CUserDao cUserDao;
@RequestMapping(value = "/initGuildList",method = {RequestMethod.POST, RequestMethod.GET})
public String initGuildList(ModelMap map){
try {
List<ServerInfo> serverInfo = serverInfoDao.getAllServerInfo();
map.addAttribute("serverInfo",serverInfo);
}
catch (Exception e) {
e.printStackTrace();
}
return "guildListManager";
}
/***
*
* @param map
* @param serverId
* @return
*/
@RequestMapping(value = "/guildListManager",method = {RequestMethod.POST, RequestMethod.GET})
public String guildListManager(ModelMap map,String serverId){
long start = DateUtil.now();
try {
List<ServerInfo> serverInfo = serverInfoDao.getAllServerInfo();
List<GsGuildInfoBeanVo> guildList = new ArrayList<>();
// 参数
String[] split = serverId.split(",");
for (String s : split) {
List<GsGuildInfoBeanVo> guildVoList = gsGuildDao.getGuildVoList(Integer.parseInt(s),2);
guildList.addAll(guildVoList);
}
map.addAttribute("serverInfo",serverInfo);
map.addAttribute("guildList",guildList);
}
catch (Exception e) {
e.printStackTrace();
}
long end = DateUtil.now();
System.out.printf("获取公会列表耗时:{%d}ms \n",end-start);
return "guildListManager";
}
/**
*
* type:
* 1:
* 2:
* 3:
* @param request
* @return
* 0:
* 1:
* 2:
* 3:
* @throws Exception
*/
@RequestMapping(value = "/updateGuildInfo",method = {RequestMethod.POST, RequestMethod.GET})
public @ResponseBody
int updateGuildInfo(HttpServletRequest request) throws Exception {
String userName = (String) request.getSession().getAttribute(WebSecurityConfig.SESSION_KEY);
// 权限查询
CAdmin admin = cUserDao.findAdmin(userName);
if (!admin.getPowers().contains(PowersEnum.GUILD_OPERATE_PERMISSIONS.getId())){
return 3;
}
HashMap<String, String> parameterMap = JsonUtil.getInstence().getParameterMap(request);
// 参数
int guildId = Integer.valueOf(parameterMap.get("guildId"));
int type = Integer.valueOf(parameterMap.get("type"));
int serverId = Integer.valueOf(parameterMap.get("serverId"));
String content = parameterMap.get("content");
// 拼接消息
String cmd;
String head = "updateguild "+guildId;
int send;
switch (type){
case 1:
// 修改公会名称
cmd = head + " name " + content;
send = RPCClient.sendWithServerId(serverId, cmd);
if (send != 0){
System.out.printf("修改公会名称报错,错误id:{%d} \n",send);
return 4;
}
break;
case 2:
// 修改公会宣言
cmd = head + " announce " + content;
send = RPCClient.sendWithServerId(serverId, cmd);
if (send != 0){
System.out.printf("修改公会宣言报错,错误id:{%d} \n",send);
return 4;
}
break;
case 3:
// 解散公会
cmd = head + " dissolution";
send = RPCClient.sendWithServerId(serverId, cmd);
if (send != 0){
System.out.printf("删除报错,错误id:{%d} \n",send);
return 4;
}
break;
default:
System.out.printf("公会操作失败,传递参数为: guildId:{%d}, type:{%d}, serverId{%d}, content{%s}",guildId,type,serverId,content);
return 2;
}
return 1;
}
}

View File

@ -0,0 +1,43 @@
package com.jmfy.dao;
import com.jmfy.model.GsGuildInfoBean;
import com.jmfy.model.vo.GsGuildInfoBeanVo;
import java.util.List;
/**
* @Author hj
* @Date 2021/5/20 10:32
* @Description:
* @Version 1.0
*/
public interface GsGuildDao {
/**
*
* @return
* @param serverId
* @throws Exception
*/
List<GsGuildInfoBean> getGuildList(int serverId) throws Exception;
/**
*
* @param serverId
* @param timely
* 1:
* 2:
* @return
* @throws Exception
*/
List<GsGuildInfoBeanVo> getGuildVoList(int serverId,int timely) throws Exception;
/**
*
* @param serverId
* @param guildId
* @return
* @throws Exception
*/
GsGuildInfoBean findGuildInfo(int serverId, int guildId) throws Exception;
}

View File

@ -0,0 +1,109 @@
package com.jmfy.dao.impl;
import com.jmfy.dao.GSUserDao;
import com.jmfy.dao.GsGuildDao;
import com.jmfy.model.GSPlayerManagerBean;
import com.jmfy.model.GSUser;
import com.jmfy.model.GsGuildInfoBean;
import com.jmfy.model.vo.GsGuildInfoBeanVo;
import com.jmfy.model.vo.GuildMemberVo;
import com.jmfy.model.vo.GuildPositionEnum;
import com.jmfy.utils.Connect;
import com.jmfy.utils.DateUtil;
import com.jmfy.utils.MongoName;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.data.mongodb.core.query.Update;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* @Author hj
* @Date 2021/5/20 10:48
* @Description:
* @Version 1.0
*/
@Component
public class GsGuildDaoImpl implements GsGuildDao {
@Resource
private Connect connect;
@Resource
private GSUserDao gsUserDao;
public static Map<Integer,Map<Integer,GsGuildInfoBeanVo>> guildVoMap = new HashMap<>();
private static Map<Integer,Long> guildVoByTime = new HashMap<>();
@Override
public List<GsGuildInfoBean> getGuildList(int serverId) throws Exception {
String dbName = MongoName.getMongoDBName(serverId);
MongoTemplate mongoTemplate = connect.getMongoTemplete(dbName);
Query query = new Query();
return mongoTemplate.find(query, GsGuildInfoBean.class);
}
@Override
public List<GsGuildInfoBeanVo> getGuildVoList(int serverId, int timely) throws Exception {
// 立即获取
String dbName = MongoName.getMongoDBName(serverId);
MongoTemplate mongoTemplate = connect.getMongoTemplete(dbName);
List<GsGuildInfoBean> beans = mongoTemplate.findAll(GsGuildInfoBean.class,GsGuildInfoBean._COLLECTION_NAME);
// 封装
HashMap<Integer, GsGuildInfoBeanVo> map = new HashMap<>(beans.size());
for (GsGuildInfoBean bean : beans) {
GsGuildInfoBeanVo beanVo = new GsGuildInfoBeanVo(bean, serverId);
// 群员信息封装
getGuildMember(beanVo);
map.put(beanVo.getId(),beanVo);
}
return new ArrayList<>(map.values());
}
@Override
public GsGuildInfoBean findGuildInfo(int serverId, int guildId) throws Exception {
String dbName = MongoName.getMongoDBName(serverId);
MongoTemplate mongoTemplate = connect.getMongoTemplete(dbName);
Query query = new Query(Criteria.where("_id").is(guildId));
return mongoTemplate.findOne(query, GsGuildInfoBean.class);
}
/**
*
* @param beanVo
*/
private void getGuildMember(GsGuildInfoBeanVo beanVo){
ArrayList<GuildMemberVo> list = new ArrayList<>();
Map<Integer, Set<Integer>> members = beanVo.getMembers();
members.forEach((k,v)-> v.forEach(v2->{
GuildMemberVo vo = new GuildMemberVo();
try {
// 查找玩家
GSUser gsUser = gsUserDao.findUserInfo(beanVo.getServerId(), v2);
if (gsUser != null){
// 赋值
vo.setUserId(v2);
String name = Optional.ofNullable(gsUser.getPlayerManager()).map(GSPlayerManagerBean::getNickName).orElse("玩家信息错误");
vo.setUserName(name);
vo.setPosition(k);
String positionName = Optional.ofNullable(GuildPositionEnum.positionMap.get(k)).map(GuildPositionEnum::getName).orElse("职位信息错误");
vo.setPositionName(positionName);
}
} catch (Exception e) {
e.printStackTrace();
}
list.add(vo);
}));
List<GuildMemberVo> collect = list.stream()
.sorted(Comparator.comparing(GuildMemberVo::getPosition)).collect(Collectors.toList());
beanVo.setGuildMemberVoList(collect);
}
}

View File

@ -0,0 +1,63 @@
package com.jmfy.model;
public class GsGuildHelpLogBean {
public static final String _COLLECTION_NAME = "guildhelplog";
private int helpId;
private int targetId;
private String helperName;
private String targetName;
private int logTime; // time
private int type; // 援助类型
public static String getCollectionName() {
return _COLLECTION_NAME;
}
public int getHelpId() {
return helpId;
}
public int getTargetId() {
return targetId;
}
public String getHelperName() {
return helperName;
}
public String getTargetName() {
return targetName;
}
public int getLogTime() {
return logTime;
}
public int getType() {
return type;
}
public void setHelpId(int helpId) {
this.helpId = helpId;
}
public void setTargetId(int targetId) {
this.targetId = targetId;
}
public void setHelperName(String helperName) {
this.helperName = helperName;
}
public void setTargetName(String targetName) {
this.targetName = targetName;
}
public void setLogTime(int logTime) {
this.logTime = logTime;
}
public void setType(int type) {
this.type = type;
}
}

View File

@ -0,0 +1,296 @@
package com.jmfy.model;
import com.jmfy.utils.DateUtil;
import java.util.*;
public class GsGuildInfoBean{
public static final String _COLLECTION_NAME = "guildInfo";
private int id;
private String name;
private String announce;
/**
* 1: 2: 3:
*/
private int joinType ;
private Map<Integer, Set<Integer>> members;
private int levelTime;
private long createTime;
private int level;
private int exp;
private int totalMembers;
private Map<Integer,Integer> defendInfo = new HashMap<>();
private Map<Integer,Integer> fightResult = new HashMap<>();
/**
* :
*/
private int continueCount;
private int icon;
private int intoLevel;
/**
*
*/
private int fete;
private Map<Integer,Integer> carFightSb = new HashMap<>();
public List<GsGuildHelpLogBean> guildHelpLogInfoMap = new LinkedList<>();
private int currBossId;
private long bossHpRemain;
private int buffIndex;
private int buffOverTime;
private int nextChallengeMessageTime;
private int guildSheJiScore;
public GsGuildInfoBean() {
}
public GsGuildInfoBean(GsGuildInfoBean bean) {
this.id = bean.id;
this.name = bean.name;
this.announce = bean.announce;
this.joinType = bean.joinType;
this.members = bean.members;
this.levelTime = bean.levelTime;
this.createTime = bean.createTime;
this.level = bean.level;
this.exp = bean.exp;
this.totalMembers = bean.totalMembers;
this.defendInfo = bean.defendInfo;
this.fightResult = bean.fightResult;
this.continueCount = bean.continueCount;
this.icon = bean.icon;
this.intoLevel = bean.intoLevel;
this.fete = bean.fete;
this.carFightSb = bean.carFightSb;
this.guildHelpLogInfoMap = bean.guildHelpLogInfoMap;
this.currBossId = bean.currBossId;
this.bossHpRemain = bean.bossHpRemain;
this.buffIndex = bean.buffIndex;
this.buffOverTime = bean.buffOverTime;
this.nextChallengeMessageTime = bean.nextChallengeMessageTime;
this.guildSheJiScore = bean.guildSheJiScore;
}
public static String getCollectionName() {
return _COLLECTION_NAME;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getAnnounce() {
return announce;
}
public void setAnnounce(String announce) {
this.announce = announce;
}
public int getJoinType() {
return joinType;
}
public void setJoinType(int joinType) {
this.joinType = joinType;
}
public Map<Integer, Set<Integer>> getMembers() {
return members;
}
public void setMembers(Map<Integer, Set<Integer>> members) {
this.members = members;
}
public int getLevelTime() {
return levelTime;
}
public void setLevelTime(int levelTime) {
this.levelTime = levelTime;
}
public long getCreateTime() {
return createTime;
}
public String getCreateTimeStr() {
return DateUtil.stampToTime(createTime);
}
public void setCreateTime(long createTime) {
this.createTime = createTime;
}
public int getLevel() {
return level;
}
public void setLevel(int level) {
this.level = level;
}
public int getExp() {
return exp;
}
public void setExp(int exp) {
this.exp = exp;
}
public int getTotalMembers() {
return totalMembers;
}
public void setTotalMembers(int totalMembers) {
this.totalMembers = totalMembers;
}
public Map<Integer, Integer> getDefendInfo() {
return defendInfo;
}
public void setDefendInfo(Map<Integer, Integer> defendInfo) {
this.defendInfo = defendInfo;
}
public Map<Integer, Integer> getFightResult() {
return fightResult;
}
public void setFightResult(Map<Integer, Integer> fightResult) {
this.fightResult = fightResult;
}
public int getContinueCount() {
return continueCount;
}
public void setContinueCount(int continueCount) {
this.continueCount = continueCount;
}
public int getIcon() {
return icon;
}
public void setIcon(int icon) {
this.icon = icon;
}
public int getIntoLevel() {
return intoLevel;
}
public void setIntoLevel(int intoLevel) {
this.intoLevel = intoLevel;
}
public int getFete() {
return fete;
}
public void setFete(int fete) {
this.fete = fete;
}
public Map<Integer, Integer> getCarFightSb() {
return carFightSb;
}
public void setCarFightSb(Map<Integer, Integer> carFightSb) {
this.carFightSb = carFightSb;
}
public List<GsGuildHelpLogBean> getGuildHelpLogInfoMap() {
return guildHelpLogInfoMap;
}
public void setGuildHelpLogInfoMap(List<GsGuildHelpLogBean> guildHelpLogInfoMap) {
this.guildHelpLogInfoMap = guildHelpLogInfoMap;
}
public int getCurrBossId() {
return currBossId;
}
public void setCurrBossId(int currBossId) {
this.currBossId = currBossId;
}
public long getBossHpRemain() {
return bossHpRemain;
}
public void setBossHpRemain(long bossHpRemain) {
this.bossHpRemain = bossHpRemain;
}
public int getBuffIndex() {
return buffIndex;
}
public void setBuffIndex(int buffIndex) {
this.buffIndex = buffIndex;
}
public int getBuffOverTime() {
return buffOverTime;
}
public void setBuffOverTime(int buffOverTime) {
this.buffOverTime = buffOverTime;
}
public int getNextChallengeMessageTime() {
return nextChallengeMessageTime;
}
public void setNextChallengeMessageTime(int nextChallengeMessageTime) {
this.nextChallengeMessageTime = nextChallengeMessageTime;
}
public int getGuildSheJiScore() {
return guildSheJiScore;
}
public void setGuildSheJiScore(int guildSheJiScore) {
this.guildSheJiScore = guildSheJiScore;
}
}

View File

@ -0,0 +1,50 @@
package com.jmfy.model;
public class GsGuildLogBean {
public static final String _COLLECTION_NAME = "guildLog";
private String id;
private int guildId; // 所属公会id
private int logTime; // 记录日志时间
private String name; // 记录人
private String info; // 记录信息
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public int getGuildId() {
return guildId;
}
public void setGuildId(int guildId) {
this.guildId = guildId;
}
public int getLogTime() {
return logTime;
}
public void setLogTime(int logTime) {
this.logTime = logTime;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getInfo() {
return info;
}
public void setInfo(String info) {
this.info = info;
}
}

View File

@ -0,0 +1,34 @@
package com.jmfy.model;
import java.util.*;
public class GsGuildManagerBean {
public static Map<Integer,GsGuildInfoBean> guildInfoMap = new HashMap<>();
public static Map<String,GsGuildInfoBean> guildNameInfoMap = new HashMap<>();
public static Map<Integer,List<GsGuildLogBean>> guildLogInfoMap = new HashMap<>();
public static Map<Integer, GsGuildInfoBean> getGuildInfoMap() {
return guildInfoMap;
}
public static void setGuildInfoMap(Map<Integer, GsGuildInfoBean> guildInfoMap) {
GsGuildManagerBean.guildInfoMap = guildInfoMap;
}
public static Map<String, GsGuildInfoBean> getGuildNameInfoMap() {
return guildNameInfoMap;
}
public static void setGuildNameInfoMap(Map<String, GsGuildInfoBean> guildNameInfoMap) {
GsGuildManagerBean.guildNameInfoMap = guildNameInfoMap;
}
public static Map<Integer, List<GsGuildLogBean>> getGuildLogInfoMap() {
return guildLogInfoMap;
}
public static void setGuildLogInfoMap(Map<Integer, List<GsGuildLogBean>> guildLogInfoMap) {
GsGuildManagerBean.guildLogInfoMap = guildLogInfoMap;
}
}

View File

@ -8,8 +8,11 @@ import java.util.Date;
@Document(collection = "cdk_add_info")
public class SCdkInfo {
/**
* id
*/
@Id
private int id; //所属的商品id
private int id;
/**
* 0:
* 1:
@ -41,13 +44,19 @@ public class SCdkInfo {
@Field(value = "goods_sum")
private int goodsSum;
/**
* 1: ,0:
*/
@Field(value = "isAdd")
private int isAdd; // 1: 已生成过 ,0: 未生成过
private int isAdd;
@Field(value = "serverId")
private int serverId;
@Field(value = "buildTime")
private long buildTime;
@Field(value = "customGood")
private String customGood;
public int getId() {
return id;
}
@ -151,5 +160,13 @@ public class SCdkInfo {
public void setBuildTime(long buildTime) {
this.buildTime = buildTime;
}
public String getCustomGood() {
return customGood;
}
public void setCustomGood(String customGood) {
this.customGood = customGood;
}
}

View File

@ -0,0 +1,41 @@
package com.jmfy.model.vo;
import com.jmfy.model.GsGuildInfoBean;
import java.util.*;
public class GsGuildInfoBeanVo extends GsGuildInfoBean {
private int serverId;
private List<GuildMemberVo> guildMemberVoList;
public GsGuildInfoBeanVo(GsGuildInfoBean bean) {
super(bean);
}
public GsGuildInfoBeanVo() {
}
public GsGuildInfoBeanVo(GsGuildInfoBean bean,int serverId) {
super(bean);
this.serverId = serverId;
}
public int getServerId() {
return serverId;
}
public void setServerId(int serverId) {
this.serverId = serverId;
}
public List<GuildMemberVo> getGuildMemberVoList() {
return guildMemberVoList;
}
public void setGuildMemberVoList(List<GuildMemberVo> guildMemberVoList) {
this.guildMemberVoList = guildMemberVoList;
}
}

View File

@ -0,0 +1,58 @@
package com.jmfy.model.vo;
/**
* @Author hj
* @Date 2021/5/20 15:02
* @Description:
* @Version 1.0
*/
public class GuildMemberVo {
/**
* id
*/
private int userId;
/**
*
*/
private String userName;
/**
* id
*/
private int position;
/**
*
*/
private String positionName;
public int getUserId() {
return userId;
}
public void setUserId(int userId) {
this.userId = userId;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public int getPosition() {
return position;
}
public void setPosition(int position) {
this.position = position;
}
public String getPositionName() {
return positionName;
}
public void setPositionName(String positionName) {
this.positionName = positionName;
}
}

View File

@ -0,0 +1,50 @@
package com.jmfy.model.vo;
import java.util.Arrays;
import java.util.Map;
import java.util.TreeMap;
/**
* @author hj
*
*/
public enum GuildPositionEnum {
// 身份
SYSTEM_ADMIN(1,"会长"),
GENERAL_ADMIN(2,"管理员"),
GENERAL_ACCOUNT(3,"一般成员"),
;
private int id;
private String name;
public static Map<Integer,GuildPositionEnum> positionMap = new TreeMap<>();
static {
Arrays.stream(GuildPositionEnum.values()).forEach(v->positionMap.putIfAbsent(v.id,v));
}
GuildPositionEnum(int id, String name) {
this.id = id;
this.name = name;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

View File

@ -39,6 +39,8 @@ public enum PowersEnum {
PACKAGE_NAME_MANAGER(410,"频道管理",400),
ADD_PACKAGE_NAME(411,"权限: 添加频道",400),
DELETE_PACKAGE_NAME(412,"权限: 删除频道",400),
GUILD_LIST_MANAGER(413,"公会列表管理",400),
GUILD_OPERATE_PERMISSIONS(414,"权限: 操作公会",400),
// 流水日志管理500-599
BILL_LOG(500,"流水日志管理",500),

View File

@ -10,6 +10,28 @@ import java.util.Date;
* @author hj
*/
public class DateUtil {
/**
*
*/
public static final long ONE_MILLSECOND = 1L;
/**
*
*/
public static final long ONE_SECOND = ONE_MILLSECOND * 1000;
/**
*
*/
public static final long ONE_MINUTE = ONE_SECOND * 60;
/**
*
*/
public static final long ONE_HOUR = ONE_MINUTE * 60;
/**
*
*/
public static final long ONE_DAY = ONE_HOUR * 24;
/**
*
* @param stamp

View File

@ -0,0 +1,65 @@
body{
font-family: Arial, Helvetica, sans-serif;
font-size: 17px;
line-height: 1.6;
}
.button{
border: 0; /* 去除原button边框样式 */
background-color: coral;
color: #fff;
padding: 1em 2em;
}
.button:hover{
background-color: #333;
}
.modal{
display: none;
position: fixed;
z-index: 1;
left: 0;
top: 0;
height: 100%;
width: 100%;
overflow: hidden;
background-color: rgba(0, 0, 0,0.5);
}
.modal-content{
background-color: #f4f4f4;
margin: 15% auto;
width: 80%;
box-shadow: 0 5px 8px 0 rgba(0, 0, 0,0.2), 0 7px 20px 0 rgba(0, 0, 0,0.2);
animation-name: modalopen;
animation-duration: 1s;
}
.modal-header h2,.modal-footer h3{
margin: 0;
}
.modal-header{
background-color: coral;
padding: 5px;
color: #fff;
}
.closeBtn{
color: #fff;
float: right;
font-size: 30px;
}
.closeBtn:hover,.closeBtn:focus{
color: #000;
text-decoration: none;
cursor: pointer;
}
.modal-body{
/*padding:10px 20px;*/
margin: 5px 0 30px 0;
}
.modal-footer{
color: #fff;
background-color: coral;
padding: 5px;
text-align: center;
}
@keyframes modalopen{
from {opacity: 0}
to {opacity: 1}
}

View File

@ -0,0 +1,194 @@
function Map(linkItems) {
this.current = undefined;
this._size = 0;
if(linkItems === false){
this.disableLinking();
}
}
/**
* 获取当前map
* @return 当前对象
*/
Map.noop = function() {
return this;
};
/**
* 非法操作
* @return
*/
Map.illegal = function() {
throw new Error("非法操作Map已经被禁用");
};
/**
*
* @param obj
* @param foreignKeys
* @return
*/
Map.from = function(obj, foreignKeys) {
var map = new Map;
for(var prop in obj) {
if(foreignKeys || obj.hasOwnProperty(prop)){
map.put(prop, obj[prop]);
}
}
return map;
};
/**
* 禁用map
* @return
*/
Map.prototype.disableLinking = function() {
this.link = Map.noop;
this.unlink = Map.noop;
this.disableLinking = Map.noop;
this.next = Map.illegal;
this.key = Map.illegal;
this.value = Map.illegal;
this.clear = Map.illegal;
return this;
};
/**
* 返回hash值 例如number 123
* @param value key/value
* @return
*/
Map.prototype.hash = function(value) {
return (typeof value) + ' ' + (value instanceof Object ? (value.__hash || (value.__hash = ++arguments.callee.current)) : value.toString());
};
/**
* 返回map的长度
* @return
*/
Map.prototype.size = function() {
return this._size;
};
Map.prototype.hash.current = 0;
/**
* 通过key获取value
* @param key
* @return
*/
Map.prototype.get = function(key) {
var item = this[this.hash(key)];
return item === undefined ? undefined : item.value;
};
/**
* 向map中添加数据
* @param key
* @param value
* @return
*/
Map.prototype.put = function(key, value) {
var hash = this.hash(key);
if(this[hash] === undefined) {
var item = { key : key, value : value };
this[hash] = item;
this.link(item);
++this._size;
}else{
this[hash].value = value;
}
return this;
};
/**
* 通过key删除数据
* @param key
* @return
*/
Map.prototype.remove = function(key) {
var hash = this.hash(key);
var item = this[hash];
if(item !== undefined) {
--this._size;
this.unlink(item);
delete this[hash];
}
return this;
};
/**
* 清除map
* @return
*/
Map.prototype.clear = function() {
while(this._size){
this.remove(this.key());
}
return this;
};
/**
* 处理队列
* @param item
* @return
*/
Map.prototype.link = function(item) {
if(this._size == 0) {
item.prev = item;
item.next = item;
this.current = item;
}else {
item.prev = this.current.prev;
item.prev.next = item;
item.next = this.current;
this.current.prev = item;
}
};
Map.prototype.unlink = function(item) {
if(this._size == 0){
this.current = undefined;
}else {
item.prev.next = item.next;
item.next.prev = item.prev;
if(item === this.current){
this.current = item.next;
}
}
};
/**
* 获取下一个
* @return
*/
Map.prototype.next = function() {
this.current = this.current.next;
return this;
};
/**
* 获取key
* @return
*/
Map.prototype.key = function() {
return this.current.key;
};
/**
* 获取value
* @return
*/
Map.prototype.value = function() {
return this.current.value;
};
/**
* map转换成字符串
* @return
*/
Map.prototype.toString = function() {
var str = "";
for(var i=0;i<this._size;i++){
str += this.current.key + ":" + this.current.value + ",";
this.current = this.current.next;
}
if (str.lastIndexOf(",") > 0) {
str = str.substring(0, str.length - 1);
}
return str;
};
// 测试
// var map=new Map();
// map.put("key", "value");
// var str = map.toString();

View File

@ -0,0 +1,29 @@
$(function () {
// 模糊搜素
$('#InputsWrapper select').searchableSelect();
// 下拉框多选
init();
function init() {
initInfo();
}
function initInfo() {
$(window).on('load', function () {
$('.selectpicker').selectpicker({
// 'selectedText': 'cat',
noneSelectedText: '请选择',
noneResultsText: '没有找到匹配的组织 {0}'
});
$('.selectpicker').selectpicker('refresh');
// 检测浏览器的方法由用户自行决定
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)) {
$('.selectpicker').selectpicker('mobile');
}
});
}
});

View File

@ -0,0 +1,315 @@
<!DOCTYPE HTML>
<!--suppress ALL -->
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8"/>
<meta name="renderer" content="webkit|ie-comp|ie-stand"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
<meta name="viewport"
content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
<meta http-equiv="Cache-Control" content="no-siteapp"/>
<script type="text/javascript" src="lib/html5shiv.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<![endif]-->
<link rel="stylesheet" type="text/css" href="h-ui/css/H-ui.min.css"/>
<link rel="stylesheet" type="text/css" href="h-ui.admin/css/H-ui.admin.css"/>
<link rel="stylesheet" type="text/css" href="lib/Hui-iconfont/1.0.8/iconfont.css"/>
<link rel="stylesheet" type="text/css" href="h-ui.admin/skin/default/skin.css" id="skin"/>
<link rel="stylesheet" type="text/css" href="h-ui.admin/css/style.css"/>
<link rel="stylesheet" type="text/css" href="bulletFrame/css/bullet.css"/>
<!-- 多选框 -->
<link href="../static/searchableSelect/css/jquery.searchableSelect.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="http://www.jq22.com/jquery/bootstrap-3.3.4.css">
<link href="../static/bootstrap/css/bootstrap-select.css" rel="stylesheet">
<script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js"></script>
<script>DD_belatedPNG.fix('*');</script>
<title>公会列表管理</title>
</head>
<body>
<nav class="breadcrumb" style="height: 50px;">
<i class="Hui-iconfont">&#xe67f;</i> 首页
<span class="c-gray en">&gt;</span> gm管理
<span class="c-gray en">&gt;</span> 公会列表管理
<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px"
href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a>
</nav>
<h2 class="mt-20" style="text-align: center"><span style="color:red;">公会列表管理</span></h2>
<div class="page-container" style="text-align: center;v">
<div class="text-c">
<div style="text-align: left;">
<!--多选服务器-->
<select name="serverId" class="selectpicker" id="serverId" multiple
data-live-search="true"
data-width="300px"
data-actions-box="true">
<option th:each="server:${serverInfo}" th:value="${server.server_id}"
th:text="${server.name}"></option>
</select>
<button class="btn btn-primary" type="button" onclick="selectGuilds()">搜索</button>
</div>
<!-- 表单 -->
<div class="mt-20">
<!-- <a class="btn btn-success radius" href="/guildListManager?timely=1" style="float: right;margin-left: 5px;">立即更新</a>-->
<table id="lawtable" class="table table-border table-bordered table-bg table-hover table-sort table-responsive">
<thead>
<tr class="text-c">
<!--<th width="25"><input type="checkbox" name="" value=""/></th>-->
<th width="50">公会id</th>
<th width="50">服务器</th>
<th width="100">公会名称</th>
<th width="200">公会宣言</th>
<th width="200">创建时间</th>
<th width="300">操作</th>
</tr>
</thead>
<tbody>
<tr th:each="obj:${guildList}">
<!--<td><input type="checkbox" value="" name=""/></td>-->
<td th:text="${obj.id}" style="text-align: center;padding-top: 16px"></td>
<td th:text="${obj.serverId}" style="text-align: center;padding-top: 16px"></td>
<td th:text="${obj.name}" style="text-align: center;padding-top: 16px"></td>
<td th:text="${obj.announce}" style="text-align: center;padding-top: 16px"></td>
<td th:text="${obj.getCreateTimeStr()}" style="text-align: center;padding-top: 16px"></td>
<td style="text-align: center;">
<button type="button" th:name="${obj.id}" th:id="'modalBtn_'+${obj.id}" class="btn btn-success"
onclick="memberInfo(this.name)">
<i class="Hui-iconfont"></i> 成员信息
</button>
<button type="button" th:id="${obj.id}" class="btn btn-primary"
onclick="return updateGuildInfo2(this.id,3)">
<i class="Hui-iconfont"></i> 解散公会
</button>
<button type="button" th:id="${obj.id}" class="btn btn-success"
onclick="return updateGuildInfo(this.id,1)">
<i class="Hui-iconfont"></i> 修改公会名称
</button>
<button type="button" th:id="${obj.id}" class="btn btn-success"
onclick="return updateGuildInfo(this.id,2)">
<i class="Hui-iconfont"></i> 修改公会宣言
</button>
<!-- 弹窗 -->
<div th:id="'simpleModal_'+${obj.id}" class="modal">
<div class="modal-content">
<div class="modal-header">
<span th:id="'closeBtn_'+${obj.id}" class="closeBtn">&times;</span>
<h2 th:text="${obj.name}"></h2>
</div>
<div class="modal-body">
<table id="memberTable" class="table table-border table-bordered table-bg table-hover table-sort2 table-responsive">
<thead>
<tr class="text-c">
<!--<th width="25"><input type="checkbox" name="" value=""/></th>-->
<th width="25">职位id</th>
<th width="200">职位</th>
<th width="200">玩家id</th>
<th width="200">玩家姓名</th>
</tr>
</thead>
<tbody>
<tr th:each="mem:${obj.getGuildMemberVoList()}">
<!--<td><input type="checkbox" value="" name=""/></td>-->
<td th:text="${mem.position}" style="text-align: center;"></td>
<td th:text="${mem.positionName}" style="text-align: center;"></td>
<td th:text="${mem.userId}" style="text-align: center;"></td>
<td th:text="${mem.userName}" style="text-align: center;"></td>
</tr>
</tbody>
</table>
</div>
<div class="modal-footer">
<h3>成员信息</h3>
</div>
</div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="h-ui.admin/js/H-ui.admin.js"></script> <!--/_footer 作为公共模版分离出去-->
<script type="text/javascript" src="bulletFrame/js/map.js"></script>
<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="lib/laypage/1.2/laypage.js"></script>
<!-- 多选框 -->
<script src="../static/bootstrap/js/bootstrap-select.js"></script>
<script type="text/javascript" src="../static/searchableSelect/js/jquery.searchableSelect.js"></script>
<script src="searchableSelect/js/initBootstrap.js"></script>
<script type="text/javascript">
$('.table-sort').dataTable({
"aaSorting": [[4, "desc"]],//默认第几个排序
"bStateSave": true,//状态保存
"pading": false,
"aoColumnDefs": [
//{"bVisible": false, "aTargets": [ 3 ]} //控制列的隐藏显示
{"orderable": false, "aTargets": [2,3]}// 不参与排序的列
]
});
$('.table-sort2').dataTable({
"aaSorting": [[0, "esc"]],//默认第几个排序
"bStateSave": true,//状态保存
"pading": false,
"aoColumnDefs": [
//{"bVisible": false, "aTargets": [ 3 ]} //控制列的隐藏显示
{"orderable": false, "aTargets": []}// 不参与排序的列
]
});
// 查询公会
function selectGuilds() {
var serverId = $("#serverId").val().toString();
if (serverId === '' || serverId == null) {
alert("服务器id不能为空");
return false;
}
window.location.href = '/guildListManager?serverId='+serverId;
}
// 成员信息
function memberInfo(id){
// 获取弹窗元素
var modal = document.getElementById("simpleModal_"+id);
// 获取按钮元素
var modalBtn = document.getElementById("modalBtn_"+id);
// 获取关闭弹窗按钮元素
var closeBtn = document.getElementById("closeBtn_"+id);
// 监听打开弹窗事件
modalBtn.addEventListener("click", openModal);
// 监听关闭弹窗事件
closeBtn.addEventListener("click", closeModal);
// 监听window关闭弹窗事件
window.addEventListener("click", outsideClick);
// 弹窗事件
function openModal() {
modal.style.display = "block";
}
// 关闭弹框事件
function closeModal() {
modal.style.display = "none";
}
// outsideClick
function outsideClick(e) {
if (e.target == modal) {
modal.style.display = "none";
}
}
}
// 存储所有表格信息
var lawtableMap = new Map();
// 页面启动时加载
window.onload = function () {
//获取所有的table
var lawtable = document.getElementById("lawtable");
//获取所有行
var rows = lawtable.rows;
for (var i = 1; i < rows.length; i++) {
let row = rows[i];
var id = row.cells[0].innerText;
// 存储到map,方便之后调用
lawtableMap.put(id,row);
// 加载监听
memberInfo(id);
}
}
/**
* 修改公会信息
* @param obj
* @param type
*/
function updateGuildInfo(id, type) {
// var pattern = new RegExp("[`~!@#$^&*()=|{}':;',\\[\\].<>/?~@#¥……&*()——|{}【】‘;:”“'。,、? ]");
// alert(id);
var content = prompt("请输入");
if (content != null && content != "") {
if (type == 1){
if (content.length < 2 || content.length > 7){
alert("公会名字长度需要在2-7之间");
return;
}
} else if (type == 2){
if (content.length <= 0 || content.length > 32){
alert("公会宣言长度需要在1-32之间");
return;
}
}
// 从map获取数据
let newVar = lawtableMap.get(id);
var serverId = newVar.cells[1].innerText;
// 发送ajax
send(id, type, serverId, content);
}
}
// 解散
function updateGuildInfo2(id, type) {
// alert(id);
var content = confirm("是否确认解散公会?");
if (content == true) {
// 从map获取数据
let newVar = lawtableMap.get(id);
var serverId = newVar.cells[1].innerText;
// 发送ajax
send(id, type, serverId, content);
}
}
function send(id, type, serverId, content) {
// alert(id);
$.ajax({
type: "POST",
data: {
"guildId": id,
"type": type,
"serverId": serverId,
"content": content
},
url: "/updateGuildInfo",
success: function (data) {
if (data === 1) {
layer.msg('操作成功!', {icon: 6, time: 3000});
setTimeout(window.location.reload(),1000);
}
if (data === 0) {
layer.msg('操作失败!', {icon: 6, time: 1000});
}
if (data === 2) {
layer.msg('参数错误!', {icon: 6, time: 1000});
}
if (data === 3) {
layer.msg('没有权限!', {icon: 6, time: 1000});
}
if (data === 4) {
layer.msg('游戏服修改报错!', {icon: 6, time: 1000});
}
}
}
)
}
</script>
</body>
</html>

View File

@ -62,7 +62,9 @@
class="Hui-iconfont menu_dropdown-arrow">&#xe6d5;</i></dt>
<dd>
<ul>
<li th:if="${#lists.contains(pos.powers,101)}"><a data-href="findMemberList" data-title="会员列表" href="javascript:;">用户列表</a></li>
<li th:if="${#lists.contains(pos.powers,101)}">
<a data-href="findMemberList" data-title="会员列表" href="javascript:;">用户列表</a>
</li>
</ul>
</dd>
</dl>
@ -130,6 +132,8 @@
href="javascript:;">添加白名单账号英雄</a></li>
<li th:if="${#lists.contains(pos.powers,410)} "><a data-href="packageInfoList" data-title="频道管理"
href="javascript:;">频道管理</a></li>
<li th:if="${#lists.contains(pos.powers,413)} "><a data-href="initGuildList" data-title="公会列表管理"
href="javascript:;">公会列表管理</a></li>
</ul>
</dd>
</dl>

View File

@ -1,5 +1,6 @@
<!--_meta 作为公共模版分离出去-->
<!DOCTYPE HTML>
<!--suppress EqualityComparisonWithCoercionJS -->
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8"/>
@ -42,6 +43,15 @@
</div>
<div class="tabCon">
<div class="row cl">
<label class="form-label col-xs-4 col-sm-2">
<span class="c-red">*</span>
自定义礼包码:</label>
<div class="formControls col-xs-8 col-sm-9">
<input type="text" name="customGood" placeholder="不填写默认随机生成" value="" class="input-text"/>
<span class="CUSTOMGOOD"></span>
</div>
</div>
<div class="row cl">
<label class="form-label col-xs-4 col-sm-2">
<span class="c-red">*</span>
@ -117,6 +127,7 @@
开始时间:</label>
<div class="formControls col-xs-8 col-sm-9">
<input type="text" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd HH:mm:ss',minDate:'#F{$dp.$D(\'datemin\')}' })" id="datemin" class="input-text Wdate" style="width:180px;" name="startTime">
<span class="STARTTIME"></span>
</div>
</div>
<div class="row cl">
@ -125,6 +136,7 @@
结束时间:</label>
<div class="formControls col-xs-8 col-sm-9">
<input type="text" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd HH:mm:ss',minDate:'#F{$dp.$D(\'datemin\')}' })" id="datemax" class="input-text Wdate" style="width:180px;" name="endTime">
<span class="ENDTIME"></span>
</div>
</div>
@ -235,6 +247,7 @@ $(document).ready(function() {
})
});
function toaddCDKInfo() {
var erroCode = $('.GOODSNAME');
var goodsName = $("input[name='goodsName']").val();
@ -242,9 +255,25 @@ function toaddCDKInfo() {
var startTime = $("input[name='startTime']").val();
var endTime = $("input[name='endTime']").val();
var goodsInfo = $("input[name='goodsInfo']").val();
var serverId = $("input[name='serverId']").val();
var pid = $("input[name='pid']").val();
var customGood = $("input[name='customGood']").val();
var roleUseNum = $("input[name='roleUseNum']").val();
if (customGood != "" && customGood.length < 6) {
erroCode = $('.CUSTOMGOOD');
erroCode.html('<span style="color: red; ">自定义礼包码长度不能小于6!</span>');
return false;
}
if (customGood != "" && goodsNum != 1) {
erroCode = $('.CUSTOMGOOD');
erroCode.html('<span style="color: red; ">创建自定义礼包码,礼包码数量之只能为1!</span>');
return false;
}
if (customGood != "" && roleUseNum != 1) {
erroCode = $('.CUSTOMGOOD');
erroCode.html('<span style="color: red; ">创建自定义礼包码,单个玩家使用次数必须为1</span>');
return false;
}
if (goodsName === '' || goodsName == null) {
erroCode.html('<span style="color: red; ">商品名称不能为空!</span>');
return false;
@ -254,7 +283,7 @@ function toaddCDKInfo() {
return false;
}
if (startTime === '' || startTime == null) {
erroCode = $('.GOODSNUM');
erroCode = $('.STARTTIME');
erroCode.html('<span style="color: red; ">开始时间不能为空!</span>');
return false;
}

View File

@ -25,14 +25,12 @@
<div class="page-container">
<h1><p class="f-20 text-success">戒灵后台管理台</p></h1>
</div>
<div style="margin-left: 20px;">
<p style="color: red">更新日志[2021-5-20]</p>
<p>1、扶持功能->审核扶持: 一键审核功能完善</p>
<p>2、扶持功能->申请扶持: 锁定申请道具数量,默认为1,不可修改</p>
<p>3、扶持功能->申请扶持: 更新礼包展示,加上金额</p>
<p>4、更新充值礼包配置表</p>
<p>4、扶持功能->审核扶持: 修复bug</p>
<p>ps: root主账号拥有全部账号的操作权限,所以批量审批时如果不加参数会审批全部订单信息(如邮件,扶持)</p>
<div style="margin-left: 20px;font-size: 18px">
<p style="color: red">更新日志[2021-5-21]</p>
<p>1、序列号管理->礼包码生成: 添加自定义礼包码</p>
<p>ps: 自定义礼包码的"单角色使用数量"和"CDK数量"必须为1</p>
<p>2、gm管理->公会列表管理: 添加公会信息查看和修改</p>
<p>ps: 公会列表强烈不建议一次性获取多个服务器,那将会很慢很慢!</p>
</div>
<footer class="footer mt-20">
</footer>