From 5f193ad99a9388b5e835f3103b154b03968ce5d6 Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Thu, 6 Nov 2025 18:10:41 +0800 Subject: [PATCH] =?UTF-8?q?=E9=81=93=E5=85=B7ID=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../command/propcoupon/PropCouponGrantCmdExe.java | 13 ++++--------- .../app/command/propcoupon/PropCouponUseCmdExe.java | 7 ++++--- 2 files changed, 8 insertions(+), 12 deletions(-) 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()));