generated from root/miduo_server
查询11星英雄
parent
b10d41d6e4
commit
78ab35311f
|
@ -5,6 +5,7 @@ import com.jmfy.dao.UserInfoDao;
|
|||
import com.jmfy.dao.impl.GSUserDaoImpl;
|
||||
import com.jmfy.model.*;
|
||||
import com.jmfy.model.vo.CUserVo;
|
||||
import com.jmfy.model.vo.Hero;
|
||||
import com.jmfy.utils.JsonUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
@ -21,6 +22,7 @@ import javax.servlet.http.HttpSession;
|
|||
import java.io.PrintWriter;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
|
@ -48,6 +50,13 @@ public class UserInfoController {
|
|||
}
|
||||
return "getuserInfo";
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = "/toGetHeroInfoPage", method = RequestMethod.GET)
|
||||
public String toGetHeroInfoPage(ModelMap map){
|
||||
return "getHeroInfo";
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/getAllUserId", method = {RequestMethod.POST, RequestMethod.GET})
|
||||
public String getAllUserId(HttpSession session, ModelMap map, HttpServletRequest request) throws Exception {
|
||||
HashMap<String, String> parameterMap = JsonUtil.getInstence().getParameterMap(request);
|
||||
|
@ -110,7 +119,7 @@ public class UserInfoController {
|
|||
|
||||
GSUser gsUser = gsUserDao.findUserInfoQuick(userInfoById.getServerid(), roleId);
|
||||
CUserVo cUserVo = getcUserVo(gsUser);
|
||||
|
||||
GSHeroMap gsHeroMap = gsUserDao.findHeroMap(userInfoById.getServerid(), roleId);
|
||||
if(cUserVo.isData==1){
|
||||
cUserVo.setServerId(String.valueOf(userInfoById.getServerid()));
|
||||
}
|
||||
|
@ -118,6 +127,37 @@ public class UserInfoController {
|
|||
return "userInfo";
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = "/getHeroInfo", method = {RequestMethod.POST, RequestMethod.GET})
|
||||
@ResponseBody
|
||||
public String getHeroInfo(ModelMap map, HttpServletRequest request) throws Exception {
|
||||
HashMap<String, String> parameterMap = JsonUtil.getInstence().getParameterMap(request);
|
||||
String roleIds = parameterMap.get("roleId");
|
||||
String[] split = roleIds.split("#");
|
||||
for (int i = 0; i < split.length; i++) {
|
||||
int uid = Integer.parseInt(split[i]);
|
||||
CUserInfo userInfoById = userInfoDao.findUserInfoById(split[i]);
|
||||
GSHeroMap gsUser = gsUserDao.findHeroMap(userInfoById.getServerid(), uid);
|
||||
int has11 = 0;
|
||||
for (Map.Entry<String, Hero> stringHeroEntry : gsUser.getHeroManager().getHeroMap().entrySet()) {
|
||||
Hero value = stringHeroEntry.getValue();
|
||||
if (value.getStar() == 11) {
|
||||
has11 ++;
|
||||
}
|
||||
}
|
||||
LOGGER.info("===============> getHeroInfo uid={} has11={} reward={}", uid, has11, (12059 + "#" + has11 * 40));
|
||||
}
|
||||
return "暂无展示信息";
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = "/sendAppointMail", method = {RequestMethod.POST, RequestMethod.GET})
|
||||
@ResponseBody
|
||||
public String sendAppointMail(ModelMap map, HttpServletRequest request) throws Exception {
|
||||
|
||||
return "暂无展示信息";
|
||||
}
|
||||
|
||||
private CUserVo getcUserVo(GSUser gsUser) throws Exception {
|
||||
CUserVo cUserVo = new CUserVo();
|
||||
if (gsUser == null) {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.jmfy.dao;
|
||||
|
||||
import com.jmfy.model.GSHeroMap;
|
||||
import com.jmfy.model.GSUser;
|
||||
import com.jmfy.model.GSUserFinal;
|
||||
import com.jmfy.model.vo.MarkedVo;
|
||||
|
@ -13,6 +14,8 @@ public interface GSUserDao {
|
|||
|
||||
GSUser findUserInfoQuick(int serverId, int userId) throws Exception;
|
||||
|
||||
GSHeroMap findHeroMap(int serverId, int userId) throws Exception;
|
||||
|
||||
void updateUserInfo(MarkedVo marked, Update update, int id) throws Exception;
|
||||
|
||||
String getThriftIpPort(MarkedVo marked, int userId);
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.jmfy.dao.impl;
|
||||
|
||||
import com.jmfy.dao.GSUserDao;
|
||||
import com.jmfy.model.GSHeroMap;
|
||||
import com.jmfy.model.GSUser;
|
||||
import com.jmfy.model.GSUserFinal;
|
||||
import com.jmfy.model.vo.MarkedVo;
|
||||
|
@ -70,6 +71,15 @@ public class GSUserDaoImpl implements GSUserDao {
|
|||
return mongoTemplate.findOne(query, GSUser.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GSHeroMap findHeroMap(int serverId, int userId) throws Exception {
|
||||
// 读库
|
||||
String dbName = MongoName.getMongoDBName(serverId);
|
||||
MongoTemplate mongoTemplate = connect.getMongoTemplete(dbName);
|
||||
Query query = new Query(Criteria.where("_id").is(userId));
|
||||
return mongoTemplate.findOne(query, GSHeroMap.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateUserInfo(MarkedVo marked, Update update, int id) throws Exception {
|
||||
// String dbName = MongoName.getMongoDBName(marked);
|
||||
|
|
|
@ -83,6 +83,23 @@ public class MailDaoImpl implements MailDao {
|
|||
}
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public void sendToPersonalMail(ServerMail mail) {
|
||||
// String[] uid = mail.getUserId().split("#");
|
||||
// String sb = getItemStr(mail);
|
||||
// for (String s : uid) {
|
||||
//// LOGGER.info("sendMail uid=>{},reward=>{}", s.trim(), sb);
|
||||
// MailPersonalCache mailPersonalCache = new MailPersonalCache();
|
||||
// mailPersonalCache.setTitle(mail.getMailTitle());
|
||||
// mailPersonalCache.setContent(mail.getMailContent());
|
||||
// mailPersonalCache.setReward(sb);
|
||||
// int sendTime = (int) (DateUtil.timeToStamp(mail.getSendTime()) / 1000);
|
||||
// mailPersonalCache.setTime(sendTime);
|
||||
// mailPersonalCache.setValidTime(mail.getEffectTime());
|
||||
// RedisUtil.getInstence().putMapEntry(mail.getServerId(), RedisUserKey.READY_TO_USER_MAIL + RedisUserKey.Delimiter_colon, s.trim(), mailPersonalCache, 240);
|
||||
// }
|
||||
// }
|
||||
|
||||
private String getItemStr(ServerMail mail){
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for(int i = 0 ; i <mail.getItemIds().size();i++){
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
package com.jmfy.model;
|
||||
|
||||
import com.jmfy.model.vo.HeroManager;
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.mongodb.core.mapping.Document;
|
||||
import org.springframework.data.mongodb.core.mapping.Field;
|
||||
|
||||
@Document(collection = "user")
|
||||
public class GSHeroMap {
|
||||
|
||||
@Id
|
||||
private int id;
|
||||
|
||||
@Field(value = "heroManager")
|
||||
private HeroManager heroManager;
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public HeroManager getHeroManager() {
|
||||
return heroManager;
|
||||
}
|
||||
|
||||
public void setHeroManager(HeroManager heroManager) {
|
||||
this.heroManager = heroManager;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,213 @@
|
|||
package com.jmfy.model.vo;
|
||||
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class Hero {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(Hero.class);
|
||||
private String id;
|
||||
|
||||
private int templateId; //模板ID
|
||||
|
||||
|
||||
private int level;//等级
|
||||
|
||||
private int star;
|
||||
|
||||
private Map<Integer,Integer> equipByPositionMap = new HashMap<>();
|
||||
|
||||
private Map<Integer,Integer> soulEquipByPositionMap = new HashMap<>();
|
||||
|
||||
private int breakId;
|
||||
|
||||
private int starBreakId;
|
||||
|
||||
private int createTime;
|
||||
|
||||
private int lastUpdateEnergyTime;
|
||||
|
||||
private int speed;
|
||||
|
||||
private int especialEquipLevel;
|
||||
|
||||
private int isLock;
|
||||
|
||||
private int createType;
|
||||
private int changeId;
|
||||
private Set<String> jewelInfo = new HashSet<>();
|
||||
|
||||
private int skin;
|
||||
|
||||
///神魂绑定英雄 神魂等级:<hero动态id>
|
||||
private Map<Integer,List<String>>godSoulBindMap=new HashMap<>();
|
||||
|
||||
private int godSoulLv;
|
||||
|
||||
//被神魂绑定英雄 英雄动态id:英雄神魂等级(反绑)
|
||||
private Map<String,Integer>godSoulBeBindMap=new HashMap<>();
|
||||
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getTemplateId() {
|
||||
return templateId;
|
||||
}
|
||||
|
||||
public void setTemplateId(int templateId) {
|
||||
this.templateId = templateId;
|
||||
}
|
||||
|
||||
public int getLevel() {
|
||||
return level;
|
||||
}
|
||||
|
||||
public void setLevel(int level) {
|
||||
this.level = level;
|
||||
}
|
||||
|
||||
public int getStar() {
|
||||
return star;
|
||||
}
|
||||
|
||||
public void setStar(int star) {
|
||||
this.star = star;
|
||||
}
|
||||
|
||||
public Map<Integer, Integer> getEquipByPositionMap() {
|
||||
return equipByPositionMap;
|
||||
}
|
||||
|
||||
public void setEquipByPositionMap(Map<Integer, Integer> equipByPositionMap) {
|
||||
this.equipByPositionMap = equipByPositionMap;
|
||||
}
|
||||
|
||||
public Map<Integer, Integer> getSoulEquipByPositionMap() {
|
||||
return soulEquipByPositionMap;
|
||||
}
|
||||
|
||||
public void setSoulEquipByPositionMap(Map<Integer, Integer> soulEquipByPositionMap) {
|
||||
this.soulEquipByPositionMap = soulEquipByPositionMap;
|
||||
}
|
||||
|
||||
public int getBreakId() {
|
||||
return breakId;
|
||||
}
|
||||
|
||||
public void setBreakId(int breakId) {
|
||||
this.breakId = breakId;
|
||||
}
|
||||
|
||||
public int getStarBreakId() {
|
||||
return starBreakId;
|
||||
}
|
||||
|
||||
public void setStarBreakId(int starBreakId) {
|
||||
this.starBreakId = starBreakId;
|
||||
}
|
||||
|
||||
public int getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(int createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public int getLastUpdateEnergyTime() {
|
||||
return lastUpdateEnergyTime;
|
||||
}
|
||||
|
||||
public void setLastUpdateEnergyTime(int lastUpdateEnergyTime) {
|
||||
this.lastUpdateEnergyTime = lastUpdateEnergyTime;
|
||||
}
|
||||
|
||||
public int getSpeed() {
|
||||
return speed;
|
||||
}
|
||||
|
||||
public void setSpeed(int speed) {
|
||||
this.speed = speed;
|
||||
}
|
||||
|
||||
public int getEspecialEquipLevel() {
|
||||
return especialEquipLevel;
|
||||
}
|
||||
|
||||
public void setEspecialEquipLevel(int especialEquipLevel) {
|
||||
this.especialEquipLevel = especialEquipLevel;
|
||||
}
|
||||
|
||||
public int getIsLock() {
|
||||
return isLock;
|
||||
}
|
||||
|
||||
public void setIsLock(int isLock) {
|
||||
this.isLock = isLock;
|
||||
}
|
||||
|
||||
public int getCreateType() {
|
||||
return createType;
|
||||
}
|
||||
|
||||
public void setCreateType(int createType) {
|
||||
this.createType = createType;
|
||||
}
|
||||
|
||||
public int getChangeId() {
|
||||
return changeId;
|
||||
}
|
||||
|
||||
public void setChangeId(int changeId) {
|
||||
this.changeId = changeId;
|
||||
}
|
||||
|
||||
public Set<String> getJewelInfo() {
|
||||
return jewelInfo;
|
||||
}
|
||||
|
||||
public void setJewelInfo(Set<String> jewelInfo) {
|
||||
this.jewelInfo = jewelInfo;
|
||||
}
|
||||
|
||||
public int getSkin() {
|
||||
return skin;
|
||||
}
|
||||
|
||||
public void setSkin(int skin) {
|
||||
this.skin = skin;
|
||||
}
|
||||
|
||||
public Map<Integer, List<String>> getGodSoulBindMap() {
|
||||
return godSoulBindMap;
|
||||
}
|
||||
|
||||
public void setGodSoulBindMap(Map<Integer, List<String>> godSoulBindMap) {
|
||||
this.godSoulBindMap = godSoulBindMap;
|
||||
}
|
||||
|
||||
public int getGodSoulLv() {
|
||||
return godSoulLv;
|
||||
}
|
||||
|
||||
public void setGodSoulLv(int godSoulLv) {
|
||||
this.godSoulLv = godSoulLv;
|
||||
}
|
||||
|
||||
public Map<String, Integer> getGodSoulBeBindMap() {
|
||||
return godSoulBeBindMap;
|
||||
}
|
||||
|
||||
public void setGodSoulBeBindMap(Map<String, Integer> godSoulBeBindMap) {
|
||||
this.godSoulBeBindMap = godSoulBeBindMap;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
package com.jmfy.model.vo;
|
||||
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class HeroManager {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(HeroManager.class);
|
||||
/**
|
||||
* 玩家英雄列表
|
||||
*/
|
||||
private Map<String, Hero> heroMap= new HashMap<>();
|
||||
|
||||
public Map<String, Hero> getHeroMap() {
|
||||
return heroMap;
|
||||
}
|
||||
}
|
||||
|
|
@ -43,6 +43,7 @@ public enum PowersEnum {
|
|||
|
||||
GUILD_LIST_MANAGER(410,"公会列表管理",400,1,"initGuildList"),
|
||||
GUILD_OPERATE_PERMISSIONS(411,"权限: 操作公会",400,1,""),
|
||||
USER_INFO_QUERY1(412,"角色神将查询",400,1,"toGetHeroInfoPage"),
|
||||
|
||||
// 流水日志管理500-599
|
||||
BILL_LOG(500,"流水日志管理",500,1,""),
|
||||
|
|
|
@ -0,0 +1,70 @@
|
|||
<!DOCTYPE HTML>
|
||||
<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" />
|
||||
<!--[if lt IE 9]>
|
||||
<script type="text/javascript" src="../static/lib/html5shiv.js"></script>
|
||||
<script type="text/javascript" src="../static/lib/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
<link rel="stylesheet" type="text/css" href="../static/h-ui/css/H-ui.min.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../static/h-ui.admin/css/H-ui.admin.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../static/lib/Hui-iconfont/1.0.8/iconfont.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../static/h-ui.admin/skin/default/skin.css" id="skin" />
|
||||
<link rel="stylesheet" type="text/css" href="../static/h-ui.admin/css/style.css" />
|
||||
<!--[if IE 6]>
|
||||
<script type="text/javascript" src="../static/lib/DD_belatedPNG_0.0.8a-min.js"></script>
|
||||
<script>DD_belatedPNG.fix('*');</script>
|
||||
<![endif]-->
|
||||
<title>个人神将查询</title>
|
||||
</head>
|
||||
<body>
|
||||
<nav class="breadcrumb"><i class="Hui-iconfont"></i> 首页 <span class="c-gray en">></span> 个人神将管理 <span class="c-gray en">></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"></i></a></nav>
|
||||
<div class="page-container" style="text-align: center">
|
||||
<h1><span style="color: red">查询个人神将</span></h1>
|
||||
<form class="form form-horizontal" id="form-article-add" action="/getHeroInfo" method="post" onsubmit="return getUserInfo()">
|
||||
|
||||
<div class="row cl">
|
||||
<label class="form-label col-xs-4 col-sm-2">
|
||||
<span class="c-red">*</span>
|
||||
角 色 ID:</label>
|
||||
<div class="formControls col-xs-8 col-sm-9">
|
||||
<input type="text" name="roleId" placeholder="" value="" class="input-text"/>
|
||||
<span class="ROLEID"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row cl" style="text-align: center" >
|
||||
<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
|
||||
<button class="btn btn-primary radius" type="submit" style="font-size: 15px"><i class="Hui-iconfont"></i> 个人神将查询</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<script type="text/javascript" src="../static/lib/jquery/1.9.1/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="../static/lib/layer/2.4/layer.js"></script>
|
||||
<script type="text/javascript" src="../static/h-ui/js/H-ui.min.js"></script>
|
||||
<script type="text/javascript" src="../static/h-ui.admin/js/H-ui.admin.js"></script> <!--/_footer 作为公共模版分离出去-->
|
||||
|
||||
<script type="text/javascript" src="../static/lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
function getUserInfo() {
|
||||
var serverId = $("#serverId").val();
|
||||
var roleId = $("input[name='roleId']").val();
|
||||
var erroCode = $('.SERVERID');
|
||||
if (roleId === '' || roleId == null) {
|
||||
erroCode = $('.ROLEID');
|
||||
erroCode.html('<span style="color: red; ">角色id不能为空!</span>');
|
||||
return false;
|
||||
}else {
|
||||
erroCode = $('.ROLEID');
|
||||
erroCode.html('<span style="color: red; "></span>');
|
||||
}
|
||||
return true
|
||||
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue