From 25693c7f90e3d7ebcd9f06e6a2af238fe79d0ca6 Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Mon, 20 Oct 2025 18:47:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E5=88=97=E8=A1=A8=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=AD=97=E6=AE=B5=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/service/task/TaskServiceImpl.java | 30 +++++++++++++++++-- .../circle/other/app/dto/task/TaskDTO.java | 5 ++++ 2 files changed, 32 insertions(+), 3 deletions(-) diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/task/TaskServiceImpl.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/task/TaskServiceImpl.java index 45d3d38a..c609b6a7 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/task/TaskServiceImpl.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/task/TaskServiceImpl.java @@ -21,6 +21,7 @@ import com.red.circle.other.infra.database.rds.service.user.user.CpRelationshipS import com.red.circle.other.inner.endpoint.activity.PropsActivityClient; import com.red.circle.other.inner.model.cmd.activity.SendActivityRewardCmd; import com.red.circle.other.inner.model.dto.activity.props.ActivityPropsGroup; +import com.red.circle.other.inner.model.dto.activity.props.ActivityRewardProps; import com.red.circle.tool.core.date.TimestampUtils; import com.red.circle.tool.core.sequence.IdWorkerUtils; import lombok.RequiredArgsConstructor; @@ -289,16 +290,19 @@ public class TaskServiceImpl implements TaskService { .isRewardCollected(item.getIsRewardCollected()) .taskIcon(taskMapByIds.get(item.getTaskId()).getTaskIcon()) .taskStatus(item.getTaskStatus()) - .conditionType(activity.getActivityRewardProps().get(0).getType()) - .cover(activity.getActivityRewardProps().get(0).getCover()) + .conditionType(getConditionType(activity.getActivityRewardProps())) + .conditionValue(getConditionValue(activity.getActivityRewardProps())) .quantity(activity.getActivityRewardProps().get(0).getQuantity()) .build(); if (item.getTaskId() == 1) { String redisKey = "mic:heartbeat:" + userId; String inc = redisService.getString(redisKey); - build.setConditionValue(inc); + build.setCompletedValue(inc); + } else { + build.setCompletedValue(item.getTaskStatus().toString()); } + resultList.add(build); } }); @@ -306,6 +310,26 @@ public class TaskServiceImpl implements TaskService { return resultList; } + private String getConditionType(List activityRewardProps) { + StringBuilder conditionType = new StringBuilder(); + for (ActivityRewardProps activityRewardProp : activityRewardProps) { + conditionType.append(activityRewardProp.getType()); + conditionType.append("-"); + } + conditionType.deleteCharAt(conditionType.length() - 1); + return conditionType.toString(); + } + + private String getConditionValue(List activityRewardProps) { + StringBuilder conditionValue = new StringBuilder(); + for (ActivityRewardProps activityRewardProp : activityRewardProps) { + conditionValue.append(activityRewardProp.getQuantity()); + conditionValue.append("-"); + } + conditionValue.deleteCharAt(conditionValue.length() - 1); + return conditionValue.toString(); + } + /** * 创建每日任务 * diff --git a/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/task/TaskDTO.java b/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/task/TaskDTO.java index f624e0ed..6e8a5568 100644 --- a/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/task/TaskDTO.java +++ b/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/task/TaskDTO.java @@ -24,6 +24,11 @@ public class TaskDTO { */ private String conditionValue; + /** + * 完成值 + */ + private String completedValue; + private Integer sortOrder; private Long taskId; //0进行中 1 已完成