管理员道具赠送修复

This commit is contained in:
tianfeng 2025-10-22 15:53:38 +08:00
parent 55fe47dd13
commit 642acf033d
2 changed files with 16 additions and 2 deletions

View File

@ -44,6 +44,7 @@ import com.red.circle.other.infra.database.rds.service.team.BusinessDevelopmentT
import com.red.circle.other.inner.asserts.user.UserErrorCode;
import com.red.circle.other.inner.endpoint.material.props.PropsBackpackClient;
import com.red.circle.other.inner.endpoint.material.props.PropsNobleVipClient;
import com.red.circle.other.inner.endpoint.user.user.UserProfileClient;
import com.red.circle.other.inner.enums.material.ConsolePropsTypeEnum;
import com.red.circle.other.inner.enums.material.PropsCommodityType;
import com.red.circle.other.inner.enums.team.TeamMemberRole;
@ -92,7 +93,7 @@ public class ManagerAuthServiceImpl implements ManagerAuthService {
private final TeamProfileService teamProfileService;
private final UserSpecialIdService userSpecialIdService;
private final PropsNobleVipGateway propsNobleVipGateway;
private final BusinessDevelopmentTeamService businessDevelopmentTeamService;
private final UserProfileClient userProfileClient;
private final OfficialNoticeClient officialNoticeClient;
private final AdministratorAuthService administratorAuthService;
private final PropsNobleVipClient propsNobleVipClient;
@ -331,6 +332,9 @@ public class ManagerAuthServiceImpl implements ManagerAuthService {
cmd.setPropsId(vipAbility.getDataCardId());
sendPropsRecord(cmd, ConsolePropsTypeEnum.DATA_CARD.getName(), 3);
}
// 使用最大等级的VIP
useMaxNobleVip(cmd.getAcceptUserId());
}
}
@ -364,6 +368,17 @@ public class ManagerAuthServiceImpl implements ManagerAuthService {
return userManagerAuths;
}
private void useMaxNobleVip(Long receiverId) {
PropsNobleVipAbilityDTO abilityDTO = propsNobleVipClient.getUserMaxAbilityDTO(receiverId).getBody();
if (Objects.isNull(abilityDTO)) {
return;
}
propsBackpackClient.switchUseProps(receiverId, abilityDTO.getId());
propsBackpackClient.switchUseProps(receiverId, abilityDTO.getAvatarFrameId());
propsBackpackClient.switchUseProps(receiverId, abilityDTO.getDataCardId());
propsBackpackClient.switchUseProps(receiverId, abilityDTO.getCarId());
userProfileClient.removeCacheAll(receiverId);
}
private void sendPropsRecord(PropsGiveAwayCmd cmd, String sourceType, Integer days) {
//开始赠送道具

View File

@ -78,7 +78,6 @@ public class PropsBackpackClientServiceImpl implements PropsBackpackClientServic
public void giveProps(GivePropsBackpackCmd cmd) {
List<PropsBackpack> list = propsBackpackService.query()
.select(PropsBackpack::getId)
.eq(PropsBackpack::getUserId, cmd.getAcceptUserId())
.eq(PropsBackpack::getType, cmd.getType())
.gt(PropsBackpack::getExpireTime, TimestampUtils.now())