📄 statvarsservice.java
字号:
}else if("sub".equals(tempS)){
tempM_I_SS = forums.get(fuptemp.get(temp_fup));
if(tempM_I_SS == null){
tempM_I_SS = new HashMap<Integer, Map<String,String>>();
forums.put(fuptemp.get(temp_fup), tempM_I_SS);
}
tempM_I_SS.put(temp_fid, forum);
tempI = fuptemp.get(temp_fup);
}
if(moderators.get(temp_fid)!=null){
tempM_SS = categories.get(tempI);
if(tempM_SS!=null){
tempM_SS.put("moderating", "1");
}
}
}
}
List<Integer> removeKL = new ArrayList<Integer>();
for(Entry<Integer,Map<String,String>> tempEntry : categories.entrySet()){
tempM_SS = tempEntry.getValue();
if(tempM_SS.get("moderating")==null){
removeKL.add(tempEntry.getKey());
}
}
for(Integer fid : removeKL){
categories.remove(fid);
}
tempI = members.size();
avgoffdays = (double)totaloffdays/tempI;
avgthismonthposts = (double)totalthismonthposts / tempI;
avgtotalol = (double)totalol/tempI;
avgthismonthol = (double)totalthismonthol/tempI;
avgmodactions = (double)totalmodactions/tempI;
team.put("categories", categories);
team.put("forums", forums);
team.put("admins", admins);
team.put("moderators", moderators);
team.put("members", members);
team.put("avgoffdays", avgoffdays);
team.put("avgthismonthposts", avgthismonthposts);
team.put("avgtotalol", avgtotalol);
team.put("avgthismonthol", avgthismonthol);
team.put("avgmodactions", avgmodactions);
newstatvars.add("'team', 'team', '"+dataParse.combinationChar(team)+"'");
}
Stats_manageTeamVO stats_manageTeamVO = new Stats_manageTeamVO();
List<ForumTableGroup> forumTableGroupList = stats_manageTeamVO.getForumTableGroupList();
boolean beingAdmin = false;
List<Map<String,Object>> manageTeamMapList = stats_manageTeamVO.getManageTeamMapList();
dateFormat.applyPattern("dd/MM/yyyy HH:mm");
double avgthismonthposts_2 = avgthismonthposts /2;
double avgthismonthol_2 = avgthismonthol / 2;
double avgtotalol_2 = avgtotalol /2;
double avgmodactions_2 = avgmodactions/2;
Map<String,String> member = null;
String lastactivity = null;
String adminid = null;
Map<String,Object> finalMap_members = null;
Map<String,String> usernameMap = null;
Map<String,String> map_thisMonthManage = null;
for(Entry<Integer,Map<String,String>> tempM : members.entrySet()){
member = tempM.getValue();
tempS = member.get("lastactivity");
tempS = tempS == null ? "0" : tempS;
lastactivity = Common.gmdate(dateFormat, Integer.parseInt(tempS), timeoffset);
adminid = member.get("adminid");
finalMap_members = new HashMap<String, Object>();
usernameMap = new HashMap<String, String>();
usernameMap.put("uid", member.get("uid"));
usernameMap.put("username", member.get("username"));
finalMap_members.put("用户名", usernameMap);
finalMap_members.put("上次访问", lastactivity);
tempS = member.get("offdays");
tempS = tempS==null?"0":tempS;
finalMap_members.put("离开天数", Integer.valueOf(tempS)>avgoffdays?"<b><i>"+tempS+"</i></b>":tempS);
finalMap_members.put("积分", member.get("credits"));
finalMap_members.put("帖子", member.get("posts"));
tempS = member.get("thismonthposts");
tempS = tempS==null?"0":tempS;
finalMap_members.put("最近 30 天发帖", Integer.valueOf(tempS)<avgthismonthposts_2?"<b><i>"+tempS+"</i></b>":tempS);
if(modworkstatus){
map_thisMonthManage = new HashMap<String,String>();
map_thisMonthManage.put("uid", member.get("uid"));
tempS = member.get("modactions");
tempS = tempS == null ? "0" : tempS;
map_thisMonthManage.put("thisMonthManage", tempS);
finalMap_members.put("本月管理", map_thisMonthManage);
}
if(oltimespan){
tempS = member.get("totalol");
tempS = tempS==null?"0":tempS;
finalMap_members.put("总计在线", Double.parseDouble(tempS)<avgtotalol_2?"<b><i>"+tempS+"</i></b>":tempS);
tempS = member.get("thismonthol");
tempS = tempS==null?"0":tempS;
finalMap_members.put("本月在线", Double.parseDouble(tempS)<avgthismonthol_2?"<b><i>"+tempS+"</i></b>":tempS);
}
if(adminid.equals("1")){
beingAdmin = true;
finalMap_members.put("管理头衔", "论坛管理员");
manageTeamMapList.add(finalMap_members);
}else if(adminid.equals("2")){
finalMap_members.put("管理头衔", "超级版主");
manageTeamMapList.add(finalMap_members);
}
}
manageTeamMapList = null;
finalMap_members = null;
usernameMap = null;
map_thisMonthManage = null;
ForumTableGroup forumTableGroup = null;
Integer fid = null;
Map<String,String> mapTemp_categories = null;
Map<Integer, Map<String, String>> mapTemp_forumTemp = null;
Map<Integer,String> mapTemp_moderators = null;
Map<String, String> mapIn_forum = null;
List<Forum> forumList = null;
tempI = 0;
Forum forum = null;
for (Entry<Integer,Map<String,String>> tempEntry : categories.entrySet()) {
forumTableGroup = stats_manageTeamVO.new ForumTableGroup();
mapTemp_categories = tempEntry.getValue();
fid = Integer.valueOf(mapTemp_categories.get("fid"));
mapTemp_forumTemp = forums.get(fid);
for (Entry<Integer, Map<String, String>> tempEntry2 : mapTemp_forumTemp.entrySet()) {
for (Entry<Integer,Map<Integer,String>> tempEntry3 : moderators.entrySet()) {
if (tempEntry2.getKey().intValue() == tempEntry3.getKey().intValue()) {
mapTemp_moderators = tempEntry3.getValue();
mapIn_forum = tempEntry2.getValue();
forumTableGroup.setGroupName((String) mapTemp_categories.get("name"));
forumTableGroup.setGroupId(fid + "");
forumList = forumTableGroup.getForumList();
tempI = mapTemp_moderators.size();
for (int i = 0; i < tempI; i++) {
forum = forumTableGroup.new Forum();
forum.setShowOnline(oltimespan);
if(mapTemp_moderators.get(i) == null){
continue;
}
member = members.get(Integer.valueOf(mapTemp_moderators.get(i)));
if(member==null){
continue;
}
adminid = (String) member.get("adminid");
lastactivity = Common.gmdate(dateFormat, Integer.parseInt(member.get("lastactivity")), timeoffset);
forum.setSelectFroumName(i==0);
forum.setFroumName(mapIn_forum.get("name"));
if (mapIn_forum.get("type").equals("group")) {
forum.setUri("index.jsp?gid=" + fid);
} else {
forum.setUri("forumdisplay.jsp?fid=" + mapIn_forum.get("fid"));
}
tempS = member.get("username");
if (Integer.valueOf(mapIn_forum.get("inheritedmod")) > 0) {
tempS = "<b>" + tempS + "</b>";
}
forum.setUid(member.get("uid"));
forum.setUsername(tempS);
forum.setLastAccessTime(lastactivity);
tempS = member.get("offdays");
tempS = tempS == null?"0":tempS;
forum.setOffDays(Integer.valueOf(tempS)>avgoffdays?"<b><i>"+tempS+"</i></b>":tempS);
forum.setCredits(member.get("credits"));
forum.setPosts(member.get("posts"));
tempS = member.get("thismonthposts");
tempS = tempS == null?"0":tempS;
forum.setThisMonthPosts(Integer.valueOf(tempS)<avgthismonthposts_2?"<b><i>"+tempS+"</i></b>":tempS);
if (modworkstatus) {
tempS = member.get("modactions");
tempS = tempS == null ? "0" : tempS;
forum.setThisMonthManage( Integer.parseInt(tempS)< avgmodactions_2 ? "<b><i>"+tempS+"</i></b>" : tempS );
} else {
forum.setThisMonthManage("N/A");
}
if (oltimespan) {
tempS = member.get("totalol");
tempS = tempS == null?"0":tempS;
forum.setAllTimeOnline(Double.parseDouble(tempS)<avgtotalol_2?"<b><i>"+tempS+"</i></b>":tempS);
tempS = member.get("thismonthol");
tempS = tempS == null?"0":tempS;
forum.setThisMonthTimeOnline(Double.parseDouble(tempS)<avgthismonthol_2?"<b><i>"+tempS+"</i></b>":tempS);
}
if (adminid.equals("1")) {
beingAdmin = true;
forum.setManagerName("论坛管理员");
} else if (adminid.equals("2")) {
forum.setManagerName("超级版主");
} else if (adminid.equals("3")) {
forum.setManagerName("版主");
}
forum.setRowspan(mapIn_forum.get("moderators"));
forumList.add(forum);
}
}
}
}
forumTableGroupList.add(forumTableGroup);
}
forumTableGroup = null;
fid = null;
mapTemp_categories = null;
mapTemp_forumTemp = null;
mapTemp_moderators = null;
mapIn_forum = null;
forumList = null;
forum = null;
tempS = null;
member = null;
lastactivity = null;
adminid = null;
String[] adminTableTitleArray = null;
if(beingAdmin){
if(modworkstatus&&oltimespan){
adminTableTitleArray = new String[]{"用户名",
"管理头衔","上次访问","离开天数","积分",
"帖子","最近 30 天发帖","本月管理","总计在线","本月在线"};
}else if(modworkstatus&&!oltimespan){
adminTableTitleArray = new String[]{"用户名",
"管理头衔","上次访问","离开天数","积分",
"帖子","最近 30 天发帖","本月管理"};
}else if(!modworkstatus&&oltimespan){
adminTableTitleArray = new String[]{"用户名",
"管理头衔","上次访问","离开天数","积分",
"帖子","最近 30 天发帖","总计在线","本月在线"};
}else{
adminTableTitleArray = new String[]{"用户名",
"管理头衔","上次访问","离开天数","积分",
"帖子","最近 30 天发帖"};
}
}
List<String> adminTableTitleList = stats_manageTeamVO.getAdminTableTitleList();
if(adminTableTitleArray!=null){
for(int i = 0;i<adminTableTitleArray.length;i++){
adminTableTitleList.add(adminTableTitleArray[i]);
}
}
adminTableTitleList = null;
adminTableTitleArray = null;
String[] forumTableTitleArray = null;
if(oltimespan){
forumTableTitleArray = new String[]{"版块",
"用户名", "管理头衔", "上次访问", "离开天数",
"积分", "帖子", "最近 30 天发帖", "本月管理","总计在线","本月在线"};
}else{
forumTableTitleArray = new String[]{"版块",
"用户名", "管理头衔", "上次访问", "离开天数",
"积分", "帖子", "最近 30 天发帖", "本月管理"};
}
List<String> forumTableTitleList = stats_manageTeamVO.getForumTableTitleList();
for(int i = 0;i<forumTableTitleArray.length;i++){
forumTableTitleList.add(forumTableTitleArray[i]);
}
forumTableTitleList = null;
forumTableTitleArray = null;
dateFormat.applyPattern("yyyy-MM-dd HH:mm");
tempI = Integer.parseInt(statvars.get("lastupdate"));
stats_manageTeamVO.setLastTime(Common.gmdate(dateFormat, tempI, timeoffset));
stats_manageTeamVO.setNextTime(Common.gmdate(dateFormat, (tempI+statscachelife.intValue()), timeoffset));
setNavbarVO(stats_manageTeamVO.getNavbar(), statstatus, modworkstatus, "team");
updateNewStatvars(newstatvars, dataBaseDao);
return stats_manageTeamVO;
}
public Stats_tradeCompositorVO getFinalStats_tradeCompositorVO(Map<String, String> settingMap,int timestamp,float timeoffset){
Double statscachelife = Double.valueOf(settingMap.get("statscachelife"));
statscachelife = statscachelife * 60;
String tempS = settingMap.get("statstatus");
boolean statstatus = tempS!=null && !tempS.equals("0")&& !tempS.equals("");
tempS = settingMap.get("modworkstatus");
boolean modworkstatus = tempS!=null && !tempS.equals("") && !tempS.equals("0");
DataBaseDao dataBaseDao = (DataBaseDao)BeanFactory.getBean("dataBaseDao");
List<String> newstatvars = new ArrayList<String>();
DataParse dataParse = ((DataParse)BeanFactory.getBean("dataParse"));
Map<String,String> statvars = getFinalMap("trade",dataBaseDao);
tempS = statvars.get("lastupdate");
int lastupdate = tempS == null ? 0 : Integer.parseInt(tempS);
if(timestamp - lastupdate > statscachelife){
statvars.clear();
statvars.put("lastupdate", timestamp+"");
newstatvars.add("'trade', 'lastupdate', '"+timestamp+"'");
}
Map<Integer,Map<String,String>> tradesums = null;
List<Map<String,String>> tempML = null;
tempS = statvars.get("tradesum");
int tempI = 0;
if(tempS != null){
tradesums = dataParse.characterParse(tempS, false);
}else{
tempML = dataBaseDao.executeQuery("SELECT subject, tid, pid, seller, sellerid, sum(tradesum) as tradesum FROM "+tableprefix+"trades WHERE tradesum>0 GROUP BY selle
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -