修改统计

master
李泽帆 2025-12-30 19:03:02 +08:00
parent 16e9e24894
commit 0f1a6dee36
4 changed files with 59 additions and 33 deletions

View File

@ -2,6 +2,8 @@ package com.group.controller;
import java.util.Set; import java.util.Set;
import org.eclipse.jetty.util.log.Log;
import com.data.bean.AccountBean; import com.data.bean.AccountBean;
import com.data.bean.GroupBean; import com.data.bean.GroupBean;
import com.data.bean.GroupMemberBean; import com.data.bean.GroupMemberBean;
@ -23,6 +25,7 @@ import com.taurus.core.entity.TObject;
import com.taurus.core.plugin.database.DataBase; import com.taurus.core.plugin.database.DataBase;
import com.taurus.core.plugin.redis.Redis; import com.taurus.core.plugin.redis.Redis;
import com.taurus.core.routes.ActionKey; import com.taurus.core.routes.ActionKey;
import com.taurus.core.util.DateUtils;
import com.taurus.core.util.StringUtil; import com.taurus.core.util.StringUtil;
import com.taurus.core.util.Utils; import com.taurus.core.util.Utils;
import com.taurus.web.Controller; import com.taurus.web.Controller;
@ -120,6 +123,7 @@ public class GroupController extends Controller {
| WebInterceptor.V_GROUP_MGR_OR_PARTNER) | WebInterceptor.V_GROUP_MGR_OR_PARTNER)
public final void getMembers_1() throws Exception { public final void getMembers_1() throws Exception {
ITObject reqData = this.getParams(); ITObject reqData = this.getParams();
logger.info("reqData:" + reqData);
int groupId = reqData.getInt("id"); int groupId = reqData.getInt("id");
String session = this.getSession(); String session = this.getSession();
AccountBean acc = AccountCache.getAccount(session); AccountBean acc = AccountCache.getAccount(session);
@ -137,9 +141,17 @@ public class GroupController extends Controller {
if (tagId == 0) { if (tagId == 0) {
tagId = acc.id; tagId = acc.id;
} }
int endtime = DateUtils.getBeginDay() + 86400;
int begintime = endtime - 86400 * 1;
if (reqData.getInt("bt") != null) {
begintime = reqData.getInt("bt");
}
if (reqData.getInt("et") != null) {
endtime = reqData.getInt("et");
}
//////////////////////////////////////////////////////// ////////////////////////////////////////////////////////
ITObject resData = GroupService.getMembers_1(groupId, acc.id, tagId, 0, type, limit, num); ITObject resData = GroupService.getMembers_1(groupId, acc.id, tagId, 0, type, limit, num, begintime, endtime);
sendResponse(0, resData); sendResponse(0, resData);
//////////////////////////////////////////////////////// ////////////////////////////////////////////////////////
@ -403,7 +415,6 @@ public class GroupController extends Controller {
Integer id = Integer.parseInt(object.get("id").toString().replaceAll("\"", "")); Integer id = Integer.parseInt(object.get("id").toString().replaceAll("\"", ""));
Jedis jedis1 = Redis.use("group1_db1").getJedis(); Jedis jedis1 = Redis.use("group1_db1").getJedis();
try { try {
Set<String> banDeviceList = jedis1.smembers("bandevice"); Set<String> banDeviceList = jedis1.smembers("bandevice");
// logger.info("banDeviceList:" + banDeviceList); // logger.info("banDeviceList:" + banDeviceList);
@ -899,12 +910,14 @@ public class GroupController extends Controller {
int groupId = reqData.getInt("id"); int groupId = reqData.getInt("id");
// 1 设置管理员 2 取消管理员 // 1 设置管理员 2 取消管理员
int opt = reqData.getInt("opt"); int opt = reqData.getInt("opt");
ITObject resData = TObject.newInstance(); ITObject resData = GroupService.setParent(groupId, acc.id, tagId);
if (opt == 2) {
resData = GroupService.cancelParent(groupId, acc.id, tagId); // ITObject resData = TObject.newInstance();
} else { // if (opt == 2) {
resData = GroupService.setParent(groupId, acc.id, tagId); // resData = GroupService.cancelParent(groupId, acc.id, tagId);
} // } else {
// resData = GroupService.setParent(groupId, acc.id, tagId);
// }
this.sendResponse(0, resData); this.sendResponse(0, resData);
} }

View File

@ -20,6 +20,8 @@ import redis.clients.jedis.Jedis;
import java.util.List; import java.util.List;
import org.eclipse.jetty.util.log.Log;
public class GroupLogController extends Controller{ public class GroupLogController extends Controller{
/** /**
@ -293,9 +295,8 @@ public class GroupLogController extends Controller{
@ActionKey(value = Protocol.GROUP_GET_PARTNER_STAT, validate = WebInterceptor.V_SESSION|WebInterceptor.V_GROUP|WebInterceptor.V_GROUP_MGR_OR_PARTNER) @ActionKey(value = Protocol.GROUP_GET_PARTNER_STAT, validate = WebInterceptor.V_SESSION|WebInterceptor.V_GROUP|WebInterceptor.V_GROUP_MGR_OR_PARTNER)
public final void getPartnerStat() throws Exception { public final void getPartnerStat() throws Exception {
ITObject reqData = this.getParams(); ITObject reqData = this.getParams();
logger.info("reqData:"+reqData);
String session = this.getSession(); String session = this.getSession();
AccountBean acc = AccountCache.getAccount(session); AccountBean acc = AccountCache.getAccount(session);
@ -322,6 +323,7 @@ public class GroupLogController extends Controller{
public final void findPartnerStat() throws Exception { public final void findPartnerStat() throws Exception {
ITObject reqData = this.getParams(); ITObject reqData = this.getParams();
logger.info("GROUP_FIND_PARTNER_STAT合伙人reqData:"+reqData);
String session = this.getSession(); String session = this.getSession();
AccountBean acc = AccountCache.getAccount(session); AccountBean acc = AccountCache.getAccount(session);
@ -350,6 +352,7 @@ public class GroupLogController extends Controller{
public final void getPartnerStatMember() throws Exception { public final void getPartnerStatMember() throws Exception {
ITObject reqData = this.getParams(); ITObject reqData = this.getParams();
logger.info("GROUP_GET_PARTNER_STAT_MEMBER合伙人reqData:"+reqData);
int groupId = reqData.getInt("id"); int groupId = reqData.getInt("id");
@ -373,6 +376,7 @@ public class GroupLogController extends Controller{
public final void findPartnerStatMember() throws Exception { public final void findPartnerStatMember() throws Exception {
ITObject reqData = this.getParams(); ITObject reqData = this.getParams();
logger.info("GROUP_FIND_PARTNER_STAT_MEMBER合伙人reqData:"+reqData);
int groupId = reqData.getInt("id"); int groupId = reqData.getInt("id");

View File

@ -489,7 +489,7 @@ public class GroupLogService {
String limitSql = String.format("limit %s,%s", limit, num); String limitSql = String.format("limit %s,%s", limit, num);
String sql = String.format( String sql = String.format(
"SELECT uid, partnerLev" + " FROM group_member" "SELECT uid, partnerLev,autoscore" + " FROM group_member"
+ " WHERE groupId = %s and (parentId=%s or uid = %s) and partnerLev > 0 GROUP BY uid %s", + " WHERE groupId = %s and (parentId=%s or uid = %s) and partnerLev > 0 GROUP BY uid %s",
groupId, uid, uid, limitSql); groupId, uid, uid, limitSql);
@ -510,6 +510,7 @@ public class GroupLogService {
objLine.putString("nick", acc.nick); objLine.putString("nick", acc.nick);
if (tagUid != uid) { if (tagUid != uid) {
// int newBeginTime = beginTime - 86400 * 30; // int newBeginTime = beginTime - 86400 * 30;
getMemberData(jedis9, tagUid, objLine, groupId, timeType, beginTime, endTime, false, true); getMemberData(jedis9, tagUid, objLine, groupId, timeType, beginTime, endTime, false, true);
} else { } else {
@ -669,6 +670,7 @@ public class GroupLogService {
if (tagUid != uid) { if (tagUid != uid) {
// int newBeginTime = beginTime - 86400 * 30; // int newBeginTime = beginTime - 86400 * 30;
getMemberData(jedis9, tagUid, objLine, groupId, timeType, beginTime, endTime, false, true); getMemberData(jedis9, tagUid, objLine, groupId, timeType, beginTime, endTime, false, true);
} else { } else {
// int newBeginTime = beginTime - 86400 * 30; // int newBeginTime = beginTime - 86400 * 30;
@ -820,6 +822,7 @@ public class GroupLogService {
int tagUid = objLine.getInt("uid"); int tagUid = objLine.getInt("uid");
AccountBean acc = AccountCache.getAccount(tagUid); AccountBean acc = AccountCache.getAccount(tagUid);
objLine.putString("nick", acc.nick); objLine.putString("nick", acc.nick);
log.info("错误时间7:" + beginTime);
getMemberData(jedis9, tagUid, objLine, groupId, timeType, beginTime, endTime, true, true); getMemberData(jedis9, tagUid, objLine, groupId, timeType, beginTime, endTime, true, true);
} }
@ -932,6 +935,9 @@ public class GroupLogService {
int win_round = _getCountNumValue(jedis9, key + "valid_round", beginTime, endTime); int win_round = _getCountNumValue(jedis9, key + "valid_round", beginTime, endTime);
param.putInt("win_round", win_round); param.putInt("win_round", win_round);
log.info("beginTime:" + beginTime);
log.info("endTime:" + endTime);
int total_round = _getCountValue(jedis9, key + "round_log" + self, beginTime, endTime); int total_round = _getCountValue(jedis9, key + "round_log" + self, beginTime, endTime);
// if (beginTime==1753286400&&endTime==1753372800){ // if (beginTime==1753286400&&endTime==1753372800){
// param.putInt("total_round" , total_round+valid_round/100); // param.putInt("total_round" , total_round+valid_round/100);
@ -1945,8 +1951,8 @@ public class GroupLogService {
} }
String where_sql = String.format( String where_sql = String.format(
"WHERE gid = %s and uid =%s and reason in(%s) and roomId ='%s' and time >= %s and time <= %s and hp!=0", groupId, "WHERE gid = %s and uid =%s and reason in(%s) and roomId ='%s' and time >= %s and time <= %s and hp!=0",
tagId, reason_sql, roomId, time - 7200, time + 3600); groupId, tagId, reason_sql, roomId, time - 7200, time + 3600);
String sql = String.format( String sql = String.format(
"SELECT mgr_id,hp,reason,cur_hp,time,info,roomid " + "FROM group_hp_log %s " + "ORDER BY time desc", "SELECT mgr_id,hp,reason,cur_hp,time,info,roomid " + "FROM group_hp_log %s " + "ORDER BY time desc",
where_sql); where_sql);

View File

@ -1860,15 +1860,15 @@ public class GroupService {
if (count > 0) { if (count > 0) {
throw new WebException(ErrorCode.GROUP_PARTNER_MEMBERS); throw new WebException(ErrorCode.GROUP_PARTNER_MEMBERS);
} }
// 三天内有战绩的不能踢
String recSql = String.format( // String recSql = String.format(
"select count(1) count from room_rec_log where gid =%s and uid=%s and time>%s", groupId, tagId, // "select count(1) count from room_rec_log where gid =%s and uid=%s and time>%s", groupId, tagId,
System.currentTimeMillis() / 1000 - 259200); // System.currentTimeMillis() / 1000 - 259200);
ITArray recList = DataBase.use().executeQueryByTArray(recSql); // ITArray recList = DataBase.use().executeQueryByTArray(recSql);
long recCount = recList.getTObject(0).getLong("count"); // long recCount = recList.getTObject(0).getLong("count");
if (recCount > 0) { // if (recCount > 0) {
throw new WebException(ErrorCode.GROUP_NOT_PERMISSION); // throw new WebException(ErrorCode.GROUP_NOT_PERMISSION);
} // }
List<Integer> list = Utility.getMemberParents(jedis10, groupId, tagId, true); List<Integer> list = Utility.getMemberParents(jedis10, groupId, tagId, true);
if (list != null) { if (list != null) {
@ -2705,7 +2705,8 @@ public class GroupService {
Jedis jedis9 = Redis.use("group1_db9").getJedis(); Jedis jedis9 = Redis.use("group1_db9").getJedis();
try { try {
int endtime = DateUtils.getBeginDay() + 86400; int endtime = DateUtils.getBeginDay() + 86400;
int begintime = endtime - 86400 * 30; int begintime = endtime - 86400 * 1;
GroupLogService.getMemberData(jedis9, acc.id, obj, groupId, 0, begintime, endtime, false, false); GroupLogService.getMemberData(jedis9, acc.id, obj, groupId, 0, begintime, endtime, false, false);
} finally { } finally {
jedis9.close(); jedis9.close();
@ -2739,7 +2740,7 @@ public class GroupService {
* @return * @return
* @throws Exception * @throws Exception
*/ */
public static final ITObject getMembers_1(int groupId, int uid, int tagId, int online, int type, int limit, int num) public static final ITObject getMembers_1(int groupId, int uid, int tagId, int online, int type, int limit, int num,int begintime,int endtime)
throws Exception { throws Exception {
Jedis jedis10 = Redis.use("group1_db10").getJedis(); Jedis jedis10 = Redis.use("group1_db10").getJedis();
try { try {
@ -2823,8 +2824,9 @@ public class GroupService {
Jedis jedis9 = Redis.use("group1_db9").getJedis(); Jedis jedis9 = Redis.use("group1_db9").getJedis();
try { try {
int endtime = DateUtils.getBeginDay() + 86400; // int endtime = DateUtils.getBeginDay() + 86400;
int begintime = endtime - 86400 * 30; // int begintime = endtime - 86400 * 1;
GroupLogService.getMemberData(jedis9, acc.id, obj, groupId, 0, begintime, endtime, false, false); GroupLogService.getMemberData(jedis9, acc.id, obj, groupId, 0, begintime, endtime, false, false);
} finally { } finally {
jedis9.close(); jedis9.close();
@ -2932,8 +2934,9 @@ public class GroupService {
Jedis jedis9 = Redis.use("group1_db9").getJedis(); Jedis jedis9 = Redis.use("group1_db9").getJedis();
try { try {
int endtime = DateUtils.getBeginDay() + 86400; // int endtime = DateUtils.getBeginDay() + 86400;
int begintime = endtime - 86400 * 30; // int begintime = endtime - 86400 * 1;
GroupLogService.getMemberData(jedis9, acc.id, obj, groupId, 0, begintime, endtime, false, false); GroupLogService.getMemberData(jedis9, acc.id, obj, groupId, 0, begintime, endtime, false, false);
} finally { } finally {
jedis9.close(); jedis9.close();