账号id查询改为用户id 查询

master
gaojie 2019-05-05 18:20:15 +08:00
parent f535a1ab85
commit 652a9c4286
7 changed files with 52 additions and 42 deletions

View File

@ -4,6 +4,7 @@ import com.jmfy.dao.FamilyDao;
import com.jmfy.dao.UserInfoDao; import com.jmfy.dao.UserInfoDao;
import com.jmfy.model.CArena; import com.jmfy.model.CArena;
import com.jmfy.model.CUser; import com.jmfy.model.CUser;
import com.jmfy.model.CUserInfo;
import com.jmfy.model.CUserPrivilegeInfo; import com.jmfy.model.CUserPrivilegeInfo;
import com.jmfy.model.vo.ArenaInfoVo; import com.jmfy.model.vo.ArenaInfoVo;
import com.jmfy.model.vo.FamilyInfoVo; import com.jmfy.model.vo.FamilyInfoVo;
@ -34,26 +35,32 @@ public class ArenaInfoController {
@RequestMapping(value = "/getArenaInfo", method = {RequestMethod.POST, RequestMethod.GET}) @RequestMapping(value = "/getArenaInfo", method = {RequestMethod.POST, RequestMethod.GET})
public String getFamilyInfo(HttpSession session, ModelMap map , HttpServletRequest request) throws Exception { public String getFamilyInfo(HttpSession session, ModelMap map , HttpServletRequest request) throws Exception {
HashMap<String, String> parameterMap = JsonUtil.getInstence().getParameterMap(request); HashMap<String, String> parameterMap = JsonUtil.getInstence().getParameterMap(request);
int serverId = Integer.parseInt(parameterMap.get("serverId")); // int serverId = Integer.parseInt(parameterMap.get("serverId"));
int userId = Integer.parseInt(parameterMap.get("userId")); int userId = Integer.parseInt(parameterMap.get("userId"));
ArenaInfoVo arenaInfoVo = new ArenaInfoVo(); ArenaInfoVo arenaInfoVo = new ArenaInfoVo();
CUser cUser = userInfoDao.findCuserInfo(serverId, userId); CUserInfo cUserInfo = userInfoDao.findUserInfoByUserId(userId);
if (cUser != null){ if (cUserInfo ==null){
arenaInfoVo.setIsData(1);
arenaInfoVo.setId(cUser.getId());
arenaInfoVo.setName(cUser.getUserName());
CUserPrivilegeInfo cUserPrivilegeInfo = userInfoDao.getCUserPrivilegeInfo(serverId, userId);
if (cUserPrivilegeInfo != null){
arenaInfoVo.setSave_amt(cUserPrivilegeInfo.getSave_amt());
}else{
arenaInfoVo.setSave_amt(0);
}
arenaInfoVo.setLevel(cUser.getLevel());
CArena cArena = familyDao.getCArena(serverId,userId);
arenaInfoVo.setAttackForces(cArena.getAttackForces());
arenaInfoVo.setDefenceForces(cArena.getDefenceForces());
}else{
arenaInfoVo.setIsData(0); arenaInfoVo.setIsData(0);
}else{
int serverId = cUserInfo.getServerid();
CUser cUser = userInfoDao.findCuserInfo(serverId, userId);
if (cUser != null){
arenaInfoVo.setIsData(1);
arenaInfoVo.setId(cUser.getId());
arenaInfoVo.setName(cUser.getUserName());
CUserPrivilegeInfo cUserPrivilegeInfo = userInfoDao.getCUserPrivilegeInfo(serverId, userId);
if (cUserPrivilegeInfo != null){
arenaInfoVo.setSave_amt(cUserPrivilegeInfo.getSave_amt());
}else{
arenaInfoVo.setSave_amt(0);
}
arenaInfoVo.setLevel(cUser.getLevel());
CArena cArena = familyDao.getCArena(serverId,userId);
arenaInfoVo.setAttackForces(cArena.getAttackForces());
arenaInfoVo.setDefenceForces(cArena.getDefenceForces());
}else{
arenaInfoVo.setIsData(0);
}
} }
map.put("arenaInfoVo",arenaInfoVo); map.put("arenaInfoVo",arenaInfoVo);
return "arenaInfo"; return "arenaInfo";

View File

@ -54,22 +54,24 @@ public class GameTitleController {
} }
boolean isSuccess = false; boolean isSuccess = false;
for (String userId : userIds) { for (String userId : userIds) {
if(serverId ==0){ CUserInfo cUserInfo = userInfoDao.findUserInfoByUserId(Integer.parseInt(userId));
List<CUserInfo> roleList = userInfoDao.findRoleList(userId); isSuccess = isSuccess(serverId, type, banTime, banReason, sendTime, isSuccess, banEndTime, cUserInfo);
for (CUserInfo cUserInfo :roleList){ // if(serverId ==0){
isSuccess = isSuccess(serverId, type, banTime, banReason, sendTime, isSuccess, banEndTime, cUserInfo); // List<CUserInfo> roleList = userInfoDao.findRoleList(userId);
if (isSuccess){ // for (CUserInfo cUserInfo :roleList){
break; // isSuccess = isSuccess(serverId, type, banTime, banReason, sendTime, isSuccess, banEndTime, cUserInfo);
} // if (isSuccess){
} // break;
}else { // }
CUserInfo userInfo = userInfoDao.findUserInfo(serverId, userId, ""); // }
if (userInfo == null) { // }else {
isSuccess = true; // CUserInfo userInfo = userInfoDao.findUserInfo(serverId, userId, "");
break; // if (userInfo == null) {
} // isSuccess = true;
isSuccess = isSuccess(serverId, type, banTime, banReason, sendTime, isSuccess, banEndTime, userInfo); // break;
} // }
// isSuccess = isSuccess(serverId, type, banTime, banReason, sendTime, isSuccess, banEndTime, userInfo);
// }
} }
if (isSuccess){ if (isSuccess){
return 1; return 1;

View File

@ -33,17 +33,18 @@ public class UserInfoController {
int serverId = Integer.parseInt(parameterMap.get("serverId")); int serverId = Integer.parseInt(parameterMap.get("serverId"));
String openId = parameterMap.get("userId"); String openId = parameterMap.get("userId");
String plat = parameterMap.get("plat"); String plat = parameterMap.get("plat");
CUserInfo cUserInfo = userInfoDao.findUserInfo(serverId,openId,plat); CUserInfo cUserInfo = userInfoDao.findUserInfoByUserId(Integer.parseInt(openId));
CUserVo cUserVo = getcUserVo(serverId, cUserInfo); CUserVo cUserVo = getcUserVo(cUserInfo);
map.put("cUserVo",cUserVo); map.put("cUserVo",cUserVo);
return "userInfo"; return "userInfo";
} }
private CUserVo getcUserVo(int serverId, CUserInfo cUserInfo) throws Exception { private CUserVo getcUserVo(CUserInfo cUserInfo) throws Exception {
CUserVo cUserVo = new CUserVo(); CUserVo cUserVo = new CUserVo();
if (cUserInfo == null){ if (cUserInfo == null){
cUserVo.setIsData(0); cUserVo.setIsData(0);
}else{ }else{
int serverId = cUserInfo.getServerid();
int userId = cUserInfo.getUserId(); int userId = cUserInfo.getUserId();
CUser cUser = userInfoDao.findCuserInfo(serverId,userId); CUser cUser = userInfoDao.findCuserInfo(serverId,userId);
if (cUser == null){ if (cUser == null){
@ -79,7 +80,7 @@ public class UserInfoController {
cUserVo.setSave_amt(cUserPrivilegeInfo.getSave_amt()); cUserVo.setSave_amt(cUserPrivilegeInfo.getSave_amt());
cUserVo.setCreateTime(JsonUtil.timeStamp2Date(String.valueOf(cUser.getCreateTime()))); cUserVo.setCreateTime(JsonUtil.timeStamp2Date(String.valueOf(cUser.getCreateTime())));
cUserVo.setOutLineTime(JsonUtil.timeStamp2Date(String.valueOf(cUser.getOutLineTime()))); cUserVo.setOutLineTime(JsonUtil.timeStamp2Date(String.valueOf(cUser.getOutLineTime())));
cUserVo.setCumulativeOnlineTime(cUser.getCumulativeOnlineTime() +"(毫秒)"); cUserVo.setCumulativeOnlineTime(cUser.getCumulativeOnlineTime()/1000/60 +"(分)");
cUserVo.setFinishDiffFightCount(cUser.getMission().getCumulationData().getFinishDiffFightCount()); cUserVo.setFinishDiffFightCount(cUser.getMission().getCumulationData().getFinishDiffFightCount());
cUserVo.setFinishGeneralFightCount(cUser.getMission().getCumulationData().getFinishGeneralFightCount()); cUserVo.setFinishGeneralFightCount(cUser.getMission().getCumulationData().getFinishGeneralFightCount());
cUserVo.setExpeditionFinght(userInfoDao.getCExpedition(serverId,userId)); cUserVo.setExpeditionFinght(userInfoDao.getCExpedition(serverId,userId));

View File

@ -48,7 +48,7 @@ public class CUserVo implements java.io.Serializable {
public String cumulativeOnlineTime; //总累计时间 public String cumulativeOnlineTime; //总累计时间
public int finishGeneralFightCount ; //通关困难关卡 public int finishGeneralFightCount ; //通关普通关卡
public int finishDiffFightCount ; //通关困难关卡 public int finishDiffFightCount ; //通关困难关卡

View File

@ -53,9 +53,9 @@
<div class="row cl"> <div class="row cl">
<label class="form-label col-xs-4 col-sm-2"> <label class="form-label col-xs-4 col-sm-2">
<span class="c-red">*</span> <span class="c-red">*</span>
账号id</label> 用户id</label>
<div class="formControls col-xs-8 col-sm-9"> <div class="formControls col-xs-8 col-sm-9">
<textarea class="textarea" name="userIds" placeholder="单人:账号id,多人:账号id#账号id..."></textarea> <textarea class="textarea" name="userIds" placeholder="单人:用户id,多人:用户id#用户id..."></textarea>
<span class="USERIDS"></span> <span class="USERIDS"></span>
</div> </div>
</div> </div>

View File

@ -38,7 +38,7 @@
<div class="row cl"> <div class="row cl">
<label class="form-label col-xs-4 col-sm-2"> <label class="form-label col-xs-4 col-sm-2">
<span class="c-red">*</span> <span class="c-red">*</span>
&nbsp;&nbsp;ID</label> &nbsp;&nbsp;ID</label>
<div class="formControls col-xs-8 col-sm-9"> <div class="formControls col-xs-8 col-sm-9">
<input type="text" name="userId" placeholder="" value="" class="input-text"/> <input type="text" name="userId" placeholder="" value="" class="input-text"/>
<span class="USERID"></span> <span class="USERID"></span>

View File

@ -55,7 +55,7 @@
<th width="1000">創角時間</th> <th width="1000">創角時間</th>
<th width="800">最近登出時間</th> <th width="800">最近登出時間</th>
<th width="800">遊戲時長</th> <th width="800">遊戲時長</th>
<th width="500">副本停留關卡</th> <th width="500">普通副本停留關卡</th>
<th width="500">困難副本停留關卡</th> <th width="500">困難副本停留關卡</th>
<th width="500">遠征進度</th> <th width="500">遠征進度</th>
<th width="500">前塵幻境進度</th> <th width="500">前塵幻境進度</th>