From 7ea07d45c9b629310fb04eb969e64409344a8123 Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Fri, 28 Nov 2025 11:14:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E5=88=97=E8=A1=A8=E9=A1=BA?= =?UTF-8?q?=E5=BA=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../command/admintask/AdminTaskQueryCmdExe.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/admintask/AdminTaskQueryCmdExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/admintask/AdminTaskQueryCmdExe.java index 39164463..55af35b7 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/admintask/AdminTaskQueryCmdExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/admintask/AdminTaskQueryCmdExe.java @@ -1,6 +1,7 @@ package com.red.circle.other.app.command.admintask; import com.red.circle.other.domain.admintask.AdminTaskRecord; +import com.red.circle.other.domain.admintask.AdminTaskType; import com.red.circle.other.domain.gateway.AdminTaskGateway; import com.red.circle.other.app.dto.cmd.AdminTaskQueryCmd; import com.red.circle.other.infra.database.mongo.service.team.TeamBillCycleUtils; @@ -9,7 +10,10 @@ import org.springframework.stereotype.Component; import java.time.LocalDate; import java.time.format.DateTimeFormatter; +import java.util.ArrayList; import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; /** * 管理员任务查询执行器 @@ -26,7 +30,17 @@ public class AdminTaskQueryCmdExe { public List execute(AdminTaskQueryCmd cmd) { LocalDate cycleStartDate = cmd.getCycleStartDate() != null ? cmd.getCycleStartDate() : LocalDate.parse(TeamBillCycleUtils.getCalcBillBelong().toString(), DateTimeFormatter.ofPattern("yyyyMMdd")); - return adminTaskGateway.findByUserIdAndCycle(cmd.getUserId(), cycleStartDate); + List records = adminTaskGateway.findByUserIdAndCycle(cmd.getUserId(), cycleStartDate); + Map taskRecordMap = records.stream().collect(Collectors.toMap(AdminTaskRecord::getTaskType, e -> e)); + + List recordList = new ArrayList<>(); + for (AdminTaskType value : AdminTaskType.values()) { + AdminTaskRecord record = taskRecordMap.get(value.getCode()); + if (record != null) { + recordList.add(record); + } + } + return recordList; } /**