道具ID修复

This commit is contained in:
tianfeng 2025-11-06 18:10:41 +08:00
parent b1721cf894
commit 5f193ad99a
2 changed files with 8 additions and 12 deletions

View File

@ -61,18 +61,13 @@ public class PropCouponGrantCmdExe {
Set<Long> userIds = Set.copyOf(cmd.getUserIds());
Map<Long, UserProfileDTO> userMap = validateUsers(userIds);
// 4. 批量生成券
PropsCommodityStore commodityStore = propsCommodityStoreService.getById(cmd.getPropId());
ResponseAssert.notNull(OtherErrorCode.PROP_COUPON_PROP_NOT_FOUND, commodityStore);
ResponseAssert.isTrue(OtherErrorCode.PROP_COUPON_OFF, commodityStore.getShelfStatus());
PropCouponType couponType = PropCouponType.getByName(commodityStore.getPropsType());
ResponseAssert.notNull(OtherErrorCode.PROP_COUPON_TYPE_NOT_SUPPORT, couponType);
PropsResourcesDTO propsResourcesDTO = ResponseAssert.requiredSuccess(
propsSourceClient.getById(commodityStore.getSourceId()));
propsSourceClient.getById(cmd.getPropId()));
ResponseAssert.notNull(OtherErrorCode.PROP_COUPON_PROP_NOT_FOUND, propsResourcesDTO);
PropCouponType couponType = PropCouponType.getByName(propsResourcesDTO.getType());
ResponseAssert.notNull(OtherErrorCode.PROP_COUPON_TYPE_NOT_SUPPORT, couponType);
cmd.setPropIcon(propsResourcesDTO.getCover());
cmd.setPropName(propsResourcesDTO.getName());
cmd.setCouponType(couponType.getCode());

View File

@ -12,6 +12,8 @@ import com.red.circle.other.domain.propcoupon.PropCouponStatus;
import com.red.circle.other.domain.propcoupon.PropCouponType;
import com.red.circle.other.infra.database.rds.dao.props.PropCouponUseRecordDAO;
import com.red.circle.other.infra.database.rds.entity.props.PropCouponUseRecordDO;
import com.red.circle.other.infra.database.rds.entity.props.PropsCommodityStore;
import com.red.circle.other.infra.database.rds.service.props.PropsCommodityStoreService;
import com.red.circle.other.inner.asserts.OtherErrorCode;
import com.red.circle.other.inner.asserts.user.UserErrorCode;
import com.red.circle.other.inner.endpoint.live.RoomManagerClient;
@ -50,6 +52,7 @@ public class PropCouponUseCmdExe {
private final RoomThemeBackpackClient roomThemeBackpackClient;
private final PropCouponUseRecordDAO propCouponUseRecordDAO;
private final PropsCommodityStoreClient propsCommodityStoreClient;
private final PropsCommodityStoreService propsCommodityStoreService;
private final PropsNobleVipClient propsNobleVipClient;
private final RoomManagerClient roomManagerClient;
@ -258,9 +261,7 @@ public class PropCouponUseCmdExe {
private PropsNobleVipAbilityDTO getVipAbilityBySysOriginSourceId(Long propId,
String sysOrigin) {
PropsCommodityStoreDTO commodityStore = ResponseAssert.requiredSuccess(
propsCommodityStoreClient.getPropsCommodityStore(sysOrigin, propId));
PropsCommodityStore commodityStore = propsCommodityStoreService.getById(propId);
ResponseAssert.notNull(OtherErrorCode.PROP_COUPON_PROP_NOT_FOUND, commodityStore);
PropsNobleVipAbilityDTO nobleVipAbility = ResponseAssert.requiredSuccess(
propsNobleVipClient.getAbilityDTO(commodityStore.getSourceId()));