diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/propcoupon/PropCouponGrantCmdExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/propcoupon/PropCouponGrantCmdExe.java index 98474c8d..0e9a5b90 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/propcoupon/PropCouponGrantCmdExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/propcoupon/PropCouponGrantCmdExe.java @@ -61,18 +61,13 @@ public class PropCouponGrantCmdExe { Set userIds = Set.copyOf(cmd.getUserIds()); Map 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()); diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/propcoupon/PropCouponUseCmdExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/propcoupon/PropCouponUseCmdExe.java index c7ea3423..0c0fb41c 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/propcoupon/PropCouponUseCmdExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/propcoupon/PropCouponUseCmdExe.java @@ -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()));