接收道具使用原道具佩戴状态

This commit is contained in:
tianfeng 2026-02-11 15:12:28 +08:00
parent dc47209d4a
commit 6128d3c607
2 changed files with 14 additions and 3 deletions

View File

@ -196,7 +196,7 @@ public class LotteryPrizeGrantServiceImpl implements LotteryPrizeGrantService {
propsBackpackClient.giveProps(cmd);
// 发送通知
// propsBackpackClient.givePropsNotify(userId, "PROPS", days, prize.getPropsId());
propsBackpackClient.givePropsNotify(userId, "PROPS", days, prize.getPropsId());
log.info("Props granted, userId: {}, propsId: {}, days: {}, recordNo: {}",
userId, prize.getPropsId(), days, recordNo);
@ -227,7 +227,7 @@ public class LotteryPrizeGrantServiceImpl implements LotteryPrizeGrantService {
propsBackpackClient.giveProps(cmd);
// 发送通知
// propsBackpackClient.givePropsNotify(userId, type, days, prize.getPropsId());
propsBackpackClient.givePropsNotify(userId, type, days, prize.getPropsId());
log.info("Backpack props granted, userId: {}, type: {}, propsId: {}, days: {}, recordNo: {}",
userId, type, prize.getPropsId(), days, recordNo);
@ -256,6 +256,8 @@ public class LotteryPrizeGrantServiceImpl implements LotteryPrizeGrantService {
.setDays(days)
.setBadgeType(SysBadgeConfigTypeEnum.ACTIVITY)
);
propsBackpackClient.givePropsNotify(userId, prize.getPrizeType(), days, prize.getPropsId());
}
/**

View File

@ -102,13 +102,15 @@ public class PropsBackpackClientServiceImpl implements PropsBackpackClientServic
Timestamp timestamp = getTimestamp(cmd, oldpropsBackpack);
boolean useProps = getUseProps(cmd, oldpropsBackpack);
propsBackpackService.addPropsBackpack(
new PropsBackpack()
.setUserId(cmd.getAcceptUserId())
.setPropsId(cmd.getPropsId())
.setType(cmd.getType())
.setExpireTime(timestamp)
.setUseProps(cmd.getUseProps())
.setUseProps(useProps)
.setAllowGive(cmd.getAllowGive())
);
@ -125,6 +127,13 @@ public class PropsBackpackClientServiceImpl implements PropsBackpackClientServic
userProfileGateway.removeCacheAll(cmd.getAcceptUserId());
}
private static Boolean getUseProps(GivePropsBackpackCmd cmd, PropsBackpack oldpropsBackpack) {
if (oldpropsBackpack == null) {
return cmd.getUseProps();
}
return oldpropsBackpack.getPropsId().equals(cmd.getPropsId()) ? oldpropsBackpack.getUseProps() : cmd.getUseProps();
}
@NotNull
private static Timestamp getTimestamp(GivePropsBackpackCmd cmd, PropsBackpack oldpropsBackpack) {
Timestamp timestamp = null;