任务列表新增字段处理
This commit is contained in:
parent
2fe407eb60
commit
25693c7f90
@ -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> 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> activityRewardProps) {
|
||||
StringBuilder conditionValue = new StringBuilder();
|
||||
for (ActivityRewardProps activityRewardProp : activityRewardProps) {
|
||||
conditionValue.append(activityRewardProp.getQuantity());
|
||||
conditionValue.append("-");
|
||||
}
|
||||
conditionValue.deleteCharAt(conditionValue.length() - 1);
|
||||
return conditionValue.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建每日任务
|
||||
*
|
||||
|
||||
@ -24,6 +24,11 @@ public class TaskDTO {
|
||||
*/
|
||||
private String conditionValue;
|
||||
|
||||
/**
|
||||
* 完成值
|
||||
*/
|
||||
private String completedValue;
|
||||
|
||||
private Integer sortOrder;
|
||||
private Long taskId;
|
||||
//0进行中 1 已完成
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user