diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/redpacket/SendUserRedPacketCmdExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/redpacket/SendUserRedPacketCmdExe.java index bea70c0a..73bbf0e4 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/redpacket/SendUserRedPacketCmdExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/redpacket/SendUserRedPacketCmdExe.java @@ -7,6 +7,7 @@ import com.red.circle.other.app.convertor.UserRedPacketAppConvertor; import com.red.circle.other.app.dto.clientobject.UserRedPacketCO; import com.red.circle.other.app.dto.cmd.SendUserRedPacketCmd; import com.red.circle.other.domain.gateway.UserRedPacketGateway; +import com.red.circle.other.domain.gateway.user.ability.UserRegionGateway; import com.red.circle.other.domain.redpacket.RoomRedPacketType; import com.red.circle.other.domain.redpacket.UserRedPacket; import com.red.circle.other.domain.redpacket.UserRedPacketStatus; @@ -14,6 +15,7 @@ import com.red.circle.other.infra.database.cache.service.other.UserRedPacketCach import com.red.circle.other.infra.database.rds.entity.user.user.ConsumptionLevel; import com.red.circle.other.infra.database.rds.service.user.user.ConsumptionLevelService; import com.red.circle.other.inner.asserts.OtherErrorCode; +import com.red.circle.other.inner.asserts.user.UserRelationErrorCode; import com.red.circle.tool.core.sequence.IdWorkerUtils; import com.red.circle.tool.core.tuple.PennyAmount; import com.red.circle.wallet.inner.endpoint.wallet.WalletGoldClient; @@ -43,6 +45,7 @@ public class SendUserRedPacketCmdExe { private final UserRedPacketCacheService userRedPacketCacheService; private final WalletGoldClient walletGoldClient; private final ConsumptionLevelService consumptionLevelService; + private final UserRegionGateway userRegionGateway; /** * 手续费比例:10% @@ -96,6 +99,8 @@ public class SendUserRedPacketCmdExe { Integer level = LevelUtils.getWealthLevel(SysOriginPlatformEnum.LIKEI, consumptionLevel.getConsumptionGolds().longValue()).getLevel(); ResponseAssert.isTrue(OtherErrorCode.USER_WEALTH_NEED_THAN_10, level >= 10); + boolean eqRegion = userRegionGateway.checkEqRegion(cmd.getReqUserId(), cmd.getReceiverUserId()); + ResponseAssert.isTrue(UserRelationErrorCode.UNAVAILABLE_NOT_REGION, eqRegion); } /**