diff --git a/rc-service/rc-service-wallet/wallet-application/src/main/java/com/red/circle/wallet/app/command/bank/query/UserBankSearchUserProfileQryExe.java b/rc-service/rc-service-wallet/wallet-application/src/main/java/com/red/circle/wallet/app/command/bank/query/UserBankSearchUserProfileQryExe.java index 3577f950..0c5c1a40 100644 --- a/rc-service/rc-service-wallet/wallet-application/src/main/java/com/red/circle/wallet/app/command/bank/query/UserBankSearchUserProfileQryExe.java +++ b/rc-service/rc-service-wallet/wallet-application/src/main/java/com/red/circle/wallet/app/command/bank/query/UserBankSearchUserProfileQryExe.java @@ -8,6 +8,8 @@ import com.red.circle.other.inner.model.dto.user.UserProfileDTO; import com.red.circle.other.inner.endpoint.user.user.UserProfileClient; import com.red.circle.wallet.app.dto.cmd.UserBankSearchUserProfileCmd; import java.util.Objects; + +import com.red.circle.wallet.infra.database.rds.service.freight.FreightBalanceService; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Component; @@ -24,6 +26,7 @@ public class UserBankSearchUserProfileQryExe { private final AgentTeamClient agentTeamClient; private final UserProfileClient userProfileClient; private final UserRegionClient userRegionClient; + private final FreightBalanceService freightBalanceService; public UserProfileDTO execute(UserBankSearchUserProfileCmd cmd) { @@ -57,6 +60,11 @@ public class UserBankSearchUserProfileQryExe { } if (cmd.typeEqAgent()) { + Boolean freightAgent = freightBalanceService.checkFreightAgent(userProfile.getId()); + if (freightAgent) { + return userProfile; + } + return Objects.equals( ResponseAssert.requiredSuccess(agentTeamClient.existsTeamOwn(userProfile.getId())), Boolean.TRUE)