From deddab999d5c7628d46fbd34178aa5881140d332 Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Thu, 27 Nov 2025 10:02:38 +0800 Subject: [PATCH] =?UTF-8?q?task=20=E8=AE=BE=E7=BD=AE=E6=94=BE=E9=87=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/scheduler/EmptyRoomCleanTask.java | 2 ++ .../src/test/java/TeamSalaryExportTest.java | 22 ++++++++++++------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/scheduler/EmptyRoomCleanTask.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/scheduler/EmptyRoomCleanTask.java index fa19afdf..906f509b 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/scheduler/EmptyRoomCleanTask.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/scheduler/EmptyRoomCleanTask.java @@ -3,6 +3,7 @@ package com.red.circle.other.app.scheduler; import com.alibaba.nacos.client.naming.utils.CollectionUtils; import com.red.circle.common.business.core.enums.SysOriginPlatformEnum; +import com.red.circle.component.redis.annotation.TaskCacheLock; import com.red.circle.live.inner.endpoint.LiveMicClient; import com.red.circle.other.infra.database.mongo.entity.live.ActiveVoiceRoom; import com.red.circle.other.infra.database.mongo.service.live.ActiveVoiceRoomService; @@ -30,6 +31,7 @@ public class EmptyRoomCleanTask { * 每2分钟清理一次空房间 */ @Scheduled(cron = "0 */2 * * * ?") + @TaskCacheLock(key = "EMPTY_ROOM_CLEAN_TASK", expireSecond = 59 * 2) public void cleanEmptyRooms() { try { // 获取所有活跃房间 diff --git a/rc-service/rc-service-other/other-start/src/test/java/TeamSalaryExportTest.java b/rc-service/rc-service-other/other-start/src/test/java/TeamSalaryExportTest.java index 1526ee04..f43b5c56 100644 --- a/rc-service/rc-service-other/other-start/src/test/java/TeamSalaryExportTest.java +++ b/rc-service/rc-service-other/other-start/src/test/java/TeamSalaryExportTest.java @@ -14,6 +14,7 @@ import com.red.circle.other.infra.database.mongo.service.team.team.TeamPolicyMan import com.red.circle.other.infra.database.mongo.service.team.team.TeamProfileService; import com.red.circle.other.infra.database.mongo.service.user.region.SysRegionConfigService; import com.red.circle.other.inner.enums.team.TeamBillCycleStatus; +import com.red.circle.other.inner.model.dto.agency.agency.TeamCountry; import com.red.circle.tool.core.collection.CollectionUtils; import lombok.Data; import lombok.extern.slf4j.Slf4j; @@ -74,18 +75,23 @@ public class TeamSalaryExportTest { log.info("当前账单: {}", billBelong); // 2. 查询所有待结算的账单 -// List teamBillCycles = queryPendingBills(billBelong); - List teamBillCycles = queryPendingBills(Arrays.asList(1983879651333181442L), billBelong); + List teamBillCycles = queryPendingBills(billBelong); +// List teamBillCycles = queryPendingBills(Arrays.asList(1983799242488717313L, 1983747731737976833L, 1983799242488717313L), billBelong); log.info("找到 {} 个待结算账单", teamBillCycles.size()); // 3. 收集所有结算结果 List exportDataList = new ArrayList<>(); List memberDetailList = new ArrayList<>(); - + + // 查询指定区域 +// List teamProfiles = teamProfileService.listRegionAll("1958016962871214081"); +// List teamIdList = teamProfiles.stream().map(TeamProfile::getId).toList(); + for (TeamBillCycle teamBillCycle : teamBillCycles) { - if (teamBillCycle.getTeamId() != 1983879651333181442L) { - continue; - } + +// if (!teamIdList.contains(teamBillCycle.getTeamId())) { +// continue; +// } try { // 获取团队信息 @@ -340,7 +346,7 @@ public class TeamSalaryExportTest { Row headerRow = sheet.createRow(0); String[] headers = { "团队ID", "用户ID", "区域名称", "国家名称", "账单周期", - "总在线时长(分钟)", "收礼物值", "送礼物值", "房间流水", + "总在线时长(分钟)", "收礼物值", "送礼物值", "等级", "是否达标", "成员工资", "团长工资", "总工资" }; @@ -369,7 +375,7 @@ public class TeamSalaryExportTest { // 礼物和流水 createCell(row, colIndex++, detail.getAcceptGiftValue() != null ? detail.getAcceptGiftValue().doubleValue() : 0, numberStyle); createCell(row, colIndex++, detail.getGiveGiftValue() != null ? detail.getGiveGiftValue().doubleValue() : 0, numberStyle); - createCell(row, colIndex++, detail.getRoomValue() != null ? detail.getRoomValue().doubleValue() : 0, numberStyle); +// createCell(row, colIndex++, detail.getRoomValue() != null ? detail.getRoomValue().doubleValue() : 0, numberStyle); // 等级和达标 createCell(row, colIndex++, String.valueOf(detail.getLevel() != null ? detail.getLevel() : 0), dataStyle);