From 0f1a6dee36efe697a2a4a0203410f3dfb728520c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E6=B3=BD=E5=B8=86?= <411641460@qq.com> Date: Tue, 30 Dec 2025 19:03:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/group/controller/GroupController.java | 31 ++++++++++++----- .../group/controller/GroupLogController.java | 10 ++++-- .../com/group/service/GroupLogService.java | 18 ++++++---- .../java/com/group/service/GroupService.java | 33 ++++++++++--------- 4 files changed, 59 insertions(+), 33 deletions(-) diff --git a/web_group/src/main/java/com/group/controller/GroupController.java b/web_group/src/main/java/com/group/controller/GroupController.java index 582b55d..dbed2b7 100644 --- a/web_group/src/main/java/com/group/controller/GroupController.java +++ b/web_group/src/main/java/com/group/controller/GroupController.java @@ -2,6 +2,8 @@ package com.group.controller; import java.util.Set; +import org.eclipse.jetty.util.log.Log; + import com.data.bean.AccountBean; import com.data.bean.GroupBean; 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.redis.Redis; import com.taurus.core.routes.ActionKey; +import com.taurus.core.util.DateUtils; import com.taurus.core.util.StringUtil; import com.taurus.core.util.Utils; import com.taurus.web.Controller; @@ -120,6 +123,7 @@ public class GroupController extends Controller { | WebInterceptor.V_GROUP_MGR_OR_PARTNER) public final void getMembers_1() throws Exception { ITObject reqData = this.getParams(); + logger.info("reqData:" + reqData); int groupId = reqData.getInt("id"); String session = this.getSession(); AccountBean acc = AccountCache.getAccount(session); @@ -137,9 +141,17 @@ public class GroupController extends Controller { if (tagId == 0) { 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); //////////////////////////////////////////////////////// @@ -403,7 +415,6 @@ public class GroupController extends Controller { Integer id = Integer.parseInt(object.get("id").toString().replaceAll("\"", "")); Jedis jedis1 = Redis.use("group1_db1").getJedis(); - try { Set banDeviceList = jedis1.smembers("bandevice"); // logger.info("banDeviceList:" + banDeviceList); @@ -426,7 +437,7 @@ public class GroupController extends Controller { // } // } // } - + ITObject tem = GroupService.enterGroup(id, acc.id); if (tem == null) { throw new WebException(ErrorCode._FAILED); @@ -899,12 +910,14 @@ public class GroupController extends Controller { int groupId = reqData.getInt("id"); // 1 设置管理员 2 取消管理员 int opt = reqData.getInt("opt"); - ITObject resData = TObject.newInstance(); - if (opt == 2) { - resData = GroupService.cancelParent(groupId, acc.id, tagId); - } else { - resData = GroupService.setParent(groupId, acc.id, tagId); - } + ITObject resData = GroupService.setParent(groupId, acc.id, tagId); + +// ITObject resData = TObject.newInstance(); +// if (opt == 2) { +// resData = GroupService.cancelParent(groupId, acc.id, tagId); +// } else { +// resData = GroupService.setParent(groupId, acc.id, tagId); +// } this.sendResponse(0, resData); } diff --git a/web_group/src/main/java/com/group/controller/GroupLogController.java b/web_group/src/main/java/com/group/controller/GroupLogController.java index 318ee61..8cb4b6f 100644 --- a/web_group/src/main/java/com/group/controller/GroupLogController.java +++ b/web_group/src/main/java/com/group/controller/GroupLogController.java @@ -20,6 +20,8 @@ import redis.clients.jedis.Jedis; import java.util.List; +import org.eclipse.jetty.util.log.Log; + 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) public final void getPartnerStat() throws Exception { - ITObject reqData = this.getParams(); - + logger.info("reqData:"+reqData); String session = this.getSession(); AccountBean acc = AccountCache.getAccount(session); @@ -322,6 +323,7 @@ public class GroupLogController extends Controller{ public final void findPartnerStat() throws Exception { ITObject reqData = this.getParams(); + logger.info("GROUP_FIND_PARTNER_STAT合伙人reqData:"+reqData); String session = this.getSession(); AccountBean acc = AccountCache.getAccount(session); @@ -350,7 +352,8 @@ public class GroupLogController extends Controller{ public final void getPartnerStatMember() throws Exception { ITObject reqData = this.getParams(); - + logger.info("GROUP_GET_PARTNER_STAT_MEMBER合伙人reqData:"+reqData); + int groupId = reqData.getInt("id"); int limit = reqData.getInt("limit"); @@ -373,6 +376,7 @@ public class GroupLogController extends Controller{ public final void findPartnerStatMember() throws Exception { ITObject reqData = this.getParams(); + logger.info("GROUP_FIND_PARTNER_STAT_MEMBER合伙人reqData:"+reqData); int groupId = reqData.getInt("id"); diff --git a/web_group/src/main/java/com/group/service/GroupLogService.java b/web_group/src/main/java/com/group/service/GroupLogService.java index f290abf..4b50d67 100644 --- a/web_group/src/main/java/com/group/service/GroupLogService.java +++ b/web_group/src/main/java/com/group/service/GroupLogService.java @@ -489,7 +489,7 @@ public class GroupLogService { String limitSql = String.format("limit %s,%s", limit, num); 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", groupId, uid, uid, limitSql); @@ -510,6 +510,7 @@ public class GroupLogService { objLine.putString("nick", acc.nick); if (tagUid != uid) { + // int newBeginTime = beginTime - 86400 * 30; getMemberData(jedis9, tagUid, objLine, groupId, timeType, beginTime, endTime, false, true); } else { @@ -669,6 +670,7 @@ public class GroupLogService { if (tagUid != uid) { // int newBeginTime = beginTime - 86400 * 30; + getMemberData(jedis9, tagUid, objLine, groupId, timeType, beginTime, endTime, false, true); } else { // int newBeginTime = beginTime - 86400 * 30; @@ -795,7 +797,7 @@ public class GroupLogService { limitSql); list = DataBase.use().executeQueryByTArray(sql); - log.info("统计sql:"+sql); + log.info("统计sql:" + sql); } else { @@ -806,7 +808,7 @@ public class GroupLogService { groupId, groupId, uid, uid, limitSql); list = DataBase.use().executeQueryByTArray(sql); - log.info("统计sql:"+sql); + log.info("统计sql:" + sql); } Jedis jedis9 = Redis.use("group1_db9").getJedis(); @@ -820,10 +822,11 @@ public class GroupLogService { int tagUid = objLine.getInt("uid"); AccountBean acc = AccountCache.getAccount(tagUid); objLine.putString("nick", acc.nick); + log.info("错误时间7:" + beginTime); getMemberData(jedis9, tagUid, objLine, groupId, timeType, beginTime, endTime, true, true); } - }catch(Exception e) { + } catch (Exception e) { log.error(e); } finally { jedis9.close(); @@ -932,6 +935,9 @@ public class GroupLogService { int win_round = _getCountNumValue(jedis9, key + "valid_round", beginTime, endTime); 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); // if (beginTime==1753286400&&endTime==1753372800){ // param.putInt("total_round" , total_round+valid_round/100); @@ -1945,8 +1951,8 @@ public class GroupLogService { } 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, - tagId, reason_sql, roomId, time - 7200, time + 3600); + "WHERE gid = %s and uid =%s and reason in(%s) and roomId ='%s' and time >= %s and time <= %s and hp!=0", + groupId, tagId, reason_sql, roomId, time - 7200, time + 3600); String sql = String.format( "SELECT mgr_id,hp,reason,cur_hp,time,info,roomid " + "FROM group_hp_log %s " + "ORDER BY time desc", where_sql); diff --git a/web_group/src/main/java/com/group/service/GroupService.java b/web_group/src/main/java/com/group/service/GroupService.java index f35e293..fe38e9b 100644 --- a/web_group/src/main/java/com/group/service/GroupService.java +++ b/web_group/src/main/java/com/group/service/GroupService.java @@ -1860,15 +1860,15 @@ public class GroupService { if (count > 0) { throw new WebException(ErrorCode.GROUP_PARTNER_MEMBERS); } - - String recSql = String.format( - "select count(1) count from room_rec_log where gid =%s and uid=%s and time>%s", groupId, tagId, - System.currentTimeMillis() / 1000 - 259200); - ITArray recList = DataBase.use().executeQueryByTArray(recSql); - long recCount = recList.getTObject(0).getLong("count"); - if (recCount > 0) { - throw new WebException(ErrorCode.GROUP_NOT_PERMISSION); - } +// 三天内有战绩的不能踢 +// String recSql = String.format( +// "select count(1) count from room_rec_log where gid =%s and uid=%s and time>%s", groupId, tagId, +// System.currentTimeMillis() / 1000 - 259200); +// ITArray recList = DataBase.use().executeQueryByTArray(recSql); +// long recCount = recList.getTObject(0).getLong("count"); +// if (recCount > 0) { +// throw new WebException(ErrorCode.GROUP_NOT_PERMISSION); +// } List list = Utility.getMemberParents(jedis10, groupId, tagId, true); if (list != null) { @@ -2705,7 +2705,8 @@ public class GroupService { Jedis jedis9 = Redis.use("group1_db9").getJedis(); try { 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); } finally { jedis9.close(); @@ -2739,7 +2740,7 @@ public class GroupService { * @return * @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 { Jedis jedis10 = Redis.use("group1_db10").getJedis(); try { @@ -2823,8 +2824,9 @@ public class GroupService { Jedis jedis9 = Redis.use("group1_db9").getJedis(); try { - int endtime = DateUtils.getBeginDay() + 86400; - int begintime = endtime - 86400 * 30; +// int endtime = DateUtils.getBeginDay() + 86400; +// int begintime = endtime - 86400 * 1; + GroupLogService.getMemberData(jedis9, acc.id, obj, groupId, 0, begintime, endtime, false, false); } finally { jedis9.close(); @@ -2932,8 +2934,9 @@ public class GroupService { Jedis jedis9 = Redis.use("group1_db9").getJedis(); try { - int endtime = DateUtils.getBeginDay() + 86400; - int begintime = endtime - 86400 * 30; +// int endtime = DateUtils.getBeginDay() + 86400; +// int begintime = endtime - 86400 * 1; + GroupLogService.getMemberData(jedis9, acc.id, obj, groupId, 0, begintime, endtime, false, false); } finally { jedis9.close();