task 设置放重

This commit is contained in:
tianfeng 2025-11-27 10:02:38 +08:00
parent 3a2ad1d770
commit deddab999d
2 changed files with 16 additions and 8 deletions

View File

@ -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 {
// 获取所有活跃房间

View File

@ -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<TeamBillCycle> teamBillCycles = queryPendingBills(billBelong);
List<TeamBillCycle> teamBillCycles = queryPendingBills(Arrays.asList(1983879651333181442L), billBelong);
List<TeamBillCycle> teamBillCycles = queryPendingBills(billBelong);
// List<TeamBillCycle> teamBillCycles = queryPendingBills(Arrays.asList(1983799242488717313L, 1983747731737976833L, 1983799242488717313L), billBelong);
log.info("找到 {} 个待结算账单", teamBillCycles.size());
// 3. 收集所有结算结果
List<SalaryExportData> exportDataList = new ArrayList<>();
List<MemberSalaryDetail> memberDetailList = new ArrayList<>();
// 查询指定区域
// List<TeamProfile> teamProfiles = teamProfileService.listRegionAll("1958016962871214081");
// List<Long> 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);