新增是否首充字段
This commit is contained in:
parent
69b8185421
commit
882666245e
@ -207,6 +207,16 @@ public class UserProfileDTO implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private Boolean isSuperFreightAgent;
|
private Boolean isSuperFreightAgent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否未完成首充
|
||||||
|
*/
|
||||||
|
private Boolean firstRecharge;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 首充结束时间
|
||||||
|
*/
|
||||||
|
private Timestamp firstRechargeEndTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户使用的徽章.
|
* 用户使用的徽章.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -162,6 +162,16 @@ public class UserProfile implements Serializable {
|
|||||||
|
|
||||||
private String checkStatus;
|
private String checkStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否未完成首充
|
||||||
|
*/
|
||||||
|
private Boolean firstRecharge;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 首充结束时间
|
||||||
|
*/
|
||||||
|
private Timestamp firstRechargeEndTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 覆盖get,过滤已过期靓号.
|
* 覆盖get,过滤已过期靓号.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -164,6 +164,17 @@ public class UserRunProfile implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private List<UseBadgeDTO> wearHonor;
|
private List<UseBadgeDTO> wearHonor;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否未完成首充
|
||||||
|
*/
|
||||||
|
private Boolean firstRecharge;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 首充结束时间
|
||||||
|
*/
|
||||||
|
private Timestamp firstRechargeEndTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加使用道具.
|
* 添加使用道具.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -241,6 +241,12 @@ public class UserRunProfileServiceImpl implements UserRunProfileService {
|
|||||||
if (Objects.nonNull(userRunProfile.getWearHonor())) {
|
if (Objects.nonNull(userRunProfile.getWearHonor())) {
|
||||||
update.set("wearHonor", userRunProfile.getWearHonor());
|
update.set("wearHonor", userRunProfile.getWearHonor());
|
||||||
}
|
}
|
||||||
|
if (Objects.nonNull(userRunProfile.getFirstRecharge())) {
|
||||||
|
update.set("firstRecharge", userRunProfile.getFirstRecharge());
|
||||||
|
}
|
||||||
|
if (Objects.nonNull(userRunProfile.getFirstRechargeEndTime())) {
|
||||||
|
update.set("firstRechargeEndTime", userRunProfile.getFirstRechargeEndTime());
|
||||||
|
}
|
||||||
|
|
||||||
return update;
|
return update;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,9 @@ package com.red.circle.other.infra.gateway.user;
|
|||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
|
import com.red.circle.framework.dto.ResultResponse;
|
||||||
|
import com.red.circle.order.inner.endpoint.TotalRechargeClient;
|
||||||
|
import com.red.circle.order.inner.model.dto.UserTotalRechargeDTO;
|
||||||
import com.red.circle.other.domain.gateway.props.PropsNobleVipGateway;
|
import com.red.circle.other.domain.gateway.props.PropsNobleVipGateway;
|
||||||
import com.red.circle.other.domain.gateway.user.UserRunProfileTransportGateway;
|
import com.red.circle.other.domain.gateway.user.UserRunProfileTransportGateway;
|
||||||
import com.red.circle.other.domain.model.user.UserProfile;
|
import com.red.circle.other.domain.model.user.UserProfile;
|
||||||
@ -25,6 +28,7 @@ import com.red.circle.other.infra.database.rds.service.props.PropsSourceRecordSe
|
|||||||
import com.red.circle.other.infra.database.rds.service.props.RoomThemeUserBackpackService;
|
import com.red.circle.other.infra.database.rds.service.props.RoomThemeUserBackpackService;
|
||||||
import com.red.circle.other.infra.database.rds.service.props.RoomThemeUserCustomizeService;
|
import com.red.circle.other.infra.database.rds.service.props.RoomThemeUserCustomizeService;
|
||||||
import com.red.circle.other.infra.database.rds.service.user.user.BaseInfoService;
|
import com.red.circle.other.infra.database.rds.service.user.user.BaseInfoService;
|
||||||
|
import com.red.circle.other.infra.utils.ZonedDateTimeUtils;
|
||||||
import com.red.circle.other.inner.enums.material.BadgeBackpackExpireType;
|
import com.red.circle.other.inner.enums.material.BadgeBackpackExpireType;
|
||||||
import com.red.circle.other.inner.enums.material.BadgeConfigTypeEnum;
|
import com.red.circle.other.inner.enums.material.BadgeConfigTypeEnum;
|
||||||
import com.red.circle.other.inner.enums.material.PropsCommodityType;
|
import com.red.circle.other.inner.enums.material.PropsCommodityType;
|
||||||
@ -39,17 +43,18 @@ import com.red.circle.other.inner.model.dto.material.UseBadgeDTO;
|
|||||||
import com.red.circle.other.inner.model.dto.material.UsePropsDTO;
|
import com.red.circle.other.inner.model.dto.material.UsePropsDTO;
|
||||||
import com.red.circle.other.inner.model.dto.material.props.PropsNobleVipAbilityDTO;
|
import com.red.circle.other.inner.model.dto.material.props.PropsNobleVipAbilityDTO;
|
||||||
import com.red.circle.tool.core.collection.CollectionUtils;
|
import com.red.circle.tool.core.collection.CollectionUtils;
|
||||||
|
import com.red.circle.tool.core.date.DateUtils;
|
||||||
import com.red.circle.tool.core.date.TimestampUtils;
|
import com.red.circle.tool.core.date.TimestampUtils;
|
||||||
|
import com.red.circle.tool.core.date.ZonedDateTimeAsiaRiyadhUtils;
|
||||||
import com.red.circle.tool.core.json.JacksonUtils;
|
import com.red.circle.tool.core.json.JacksonUtils;
|
||||||
|
|
||||||
import java.sql.Timestamp;
|
import java.sql.Timestamp;
|
||||||
import java.util.Collection;
|
import java.time.Duration;
|
||||||
import java.util.Collections;
|
import java.time.LocalDateTime;
|
||||||
import java.util.List;
|
import java.time.ZonedDateTime;
|
||||||
import java.util.Map;
|
import java.time.temporal.TemporalUnit;
|
||||||
import java.util.Objects;
|
import java.util.*;
|
||||||
import java.util.Optional;
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.Set;
|
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
@ -83,6 +88,7 @@ public class UserRunProfileTransportGatewayImpl implements UserRunProfileTranspo
|
|||||||
private final RoomThemeUserBackpackService roomThemeUserBackpackService;
|
private final RoomThemeUserBackpackService roomThemeUserBackpackService;
|
||||||
private final PropsResourcesInfraConvertor propsResourcesInfraConvertor;
|
private final PropsResourcesInfraConvertor propsResourcesInfraConvertor;
|
||||||
private final RoomThemeUserCustomizeService roomThemeUserCustomizeService;
|
private final RoomThemeUserCustomizeService roomThemeUserCustomizeService;
|
||||||
|
private final TotalRechargeClient totalRechargeClient;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public UserProfile getByUserId(Long userId) {
|
public UserProfile getByUserId(Long userId) {
|
||||||
@ -240,8 +246,7 @@ public class UserRunProfileTransportGatewayImpl implements UserRunProfileTranspo
|
|||||||
userBaseInfos.stream().map(BaseInfo::getId).collect(Collectors.toSet()));
|
userBaseInfos.stream().map(BaseInfo::getId).collect(Collectors.toSet()));
|
||||||
|
|
||||||
return userBaseInfos.stream().map(userBaseInfo -> {
|
return userBaseInfos.stream().map(userBaseInfo -> {
|
||||||
UserRunProfile newUserRunProfile = userProfileInfraConvertor.toUserRunProfile(
|
UserRunProfile newUserRunProfile = userProfileInfraConvertor.toUserRunProfile(userBaseInfo);
|
||||||
userBaseInfo);
|
|
||||||
|
|
||||||
List<UseBadgeDTO> useBadgeDTOS = userUseBadgeEntities.get(userBaseInfo.getId());
|
List<UseBadgeDTO> useBadgeDTOS = userUseBadgeEntities.get(userBaseInfo.getId());
|
||||||
if (!CollectionUtils.isEmpty(useBadgeDTOS)) {
|
if (!CollectionUtils.isEmpty(useBadgeDTOS)) {
|
||||||
@ -251,6 +256,18 @@ public class UserRunProfileTransportGatewayImpl implements UserRunProfileTranspo
|
|||||||
.filter(e -> BadgeConfigTypeEnum.isHonorType(e.getType())).toList());
|
.filter(e -> BadgeConfigTypeEnum.isHonorType(e.getType())).toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LocalDateTime createTime = newUserRunProfile.getCreateTime().toLocalDateTime();
|
||||||
|
Duration duration = Duration.between(createTime, LocalDateTime.now());
|
||||||
|
if (duration.toDays() < 7) {
|
||||||
|
ResultResponse<Map<Long, List<UserTotalRechargeDTO>>> response = totalRechargeClient.mapGroup(Set.of(newUserRunProfile.getId()));
|
||||||
|
if (response.getStatus()) {
|
||||||
|
List<UserTotalRechargeDTO> dtos = response.getBody().get(newUserRunProfile.getId());
|
||||||
|
newUserRunProfile.setFirstRecharge(CollectionUtils.isEmpty(dtos));
|
||||||
|
newUserRunProfile.setFirstRechargeEndTime(ZonedDateTimeUtils.toTimestamp(createTime.plusDays(7)));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
newUserRunProfile.addUseProps(userUsePropsEntityMap.get(userBaseInfo.getId()));
|
newUserRunProfile.addUseProps(userUsePropsEntityMap.get(userBaseInfo.getId()));
|
||||||
newUserRunProfile.addUseProps(userUseRoomTheme.get(userBaseInfo.getId()));
|
newUserRunProfile.addUseProps(userUseRoomTheme.get(userBaseInfo.getId()));
|
||||||
newUserRunProfile.setOwnSpecialId(userSpecialIdMap.get(userBaseInfo.getId()));
|
newUserRunProfile.setOwnSpecialId(userSpecialIdMap.get(userBaseInfo.getId()));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user