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 已完成