From 7aa395f3fceba0966dedb38eb5796d850ee93c6d Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Tue, 11 Nov 2025 12:14:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9EhostSalaryToAgent=E4=B8=BB?= =?UTF-8?q?=E6=92=AD=E8=96=AA=E8=B5=84=E8=BD=AC=E7=BB=99=E4=BB=A3=E7=90=86?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../model/dto/agency/agency/TeamSetting.java | 7 +++++++ .../command/team/BdInviteMessageProcessExe.java | 8 +++++++- .../listener/team/TeamBillSettleListener.java | 16 ++++++++++------ .../team/team/impl/TeamProfileServiceImpl.java | 3 +++ 4 files changed, 27 insertions(+), 7 deletions(-) diff --git a/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/model/dto/agency/agency/TeamSetting.java b/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/model/dto/agency/agency/TeamSetting.java index d9adeaf7..a81da6e6 100644 --- a/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/model/dto/agency/agency/TeamSetting.java +++ b/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/model/dto/agency/agency/TeamSetting.java @@ -18,4 +18,11 @@ public class TeamSetting implements Serializable { */ private Integer maxMember; + /** + * 主播工资是否给代理. + * true: 主播工资给代理 + * false: 主播工资直接给主播 + */ + private Boolean hostSalaryToAgent; + } diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/team/BdInviteMessageProcessExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/team/BdInviteMessageProcessExe.java index c49c8080..d8ac10de 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/team/BdInviteMessageProcessExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/team/BdInviteMessageProcessExe.java @@ -11,6 +11,7 @@ import com.red.circle.other.app.convertor.user.UserProfileAppConvertor; import com.red.circle.other.app.dto.cmd.team.DbInviteMessageProcessCmd; import com.red.circle.other.app.util.OfficialNoticeUtils; import com.red.circle.other.domain.gateway.user.UserProfileGateway; +import com.red.circle.other.domain.gateway.user.ability.RegisterDeviceGateway; import com.red.circle.other.infra.database.mongo.entity.team.bd.BdInviteAgentMessage; import com.red.circle.other.infra.database.mongo.entity.team.bd.MessageInviteGroup; import com.red.circle.other.infra.database.mongo.entity.team.team.TeamMember; @@ -60,7 +61,7 @@ public class BdInviteMessageProcessExe { private final TeamMemberService teamMemberService; private final UserProfileGateway userProfileGateway; private final TeamProfileService teamProfileService; - private final OfficialNoticeClient officialNoticeClient; + private final RegisterDeviceGateway registerDeviceGateway; private final TeamBillCycleService teamBillCycleService; private final UserProfileAppConvertor userProfileAppConvertor; private final UserHistoryIdentityService userHistoryIdentityService; @@ -118,6 +119,11 @@ public class BdInviteMessageProcessExe { message.getUserId()); ResponseAssert.notNull(TeamErrorCode.USER_IS_NOT_BD, bdBaseInfo); + // 主播设备指纹校验 + Boolean hasAnchorWithSameDevice = registerDeviceGateway.checkDeviceFingerprintHasAnchor( + message.getInviteUserId()); + ResponseAssert.isFalse(TeamErrorCode.DEVICE_FINGERPRINT_USED_BY_ANCHOR, hasAnchorWithSameDevice); + UserProfileDTO userProfile = userProfileAppConvertor.toUserProfileDTO( userProfileGateway.getByUserId(message.getInviteUserId())); TeamProfile teamProfile = new TeamProfile() diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/listener/team/TeamBillSettleListener.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/listener/team/TeamBillSettleListener.java index a35edf38..a50c46a5 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/listener/team/TeamBillSettleListener.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/listener/team/TeamBillSettleListener.java @@ -24,6 +24,7 @@ import com.red.circle.other.inner.endpoint.team.target.TeamProfileClient; import com.red.circle.other.inner.enums.team.*; import com.red.circle.other.inner.model.dto.agency.agency.TeamMemberDTO; import com.red.circle.other.inner.model.dto.agency.agency.TeamRemark; +import com.red.circle.other.inner.model.dto.agency.agency.TeamSetting; import com.red.circle.tool.core.collection.CollectionUtils; import com.red.circle.tool.core.date.LocalDateTimeUtils; import com.red.circle.tool.core.date.TimestampUtils; @@ -238,8 +239,11 @@ public class TeamBillSettleListener implements MessageListener { return CollectionUtils.isNotEmpty(teamMemberTargets) ? teamMemberTargets.size() : 0; } - private boolean isHostSalaryToAgent(Map metadata) { - return Objects.equals(metadata.get("hostSalaryToAgent"), "true"); + private boolean isHostSalaryToAgent(TeamProfile teamProfile) { + return Optional.ofNullable(teamProfile) + .map(TeamProfile::getSetting) + .map(TeamSetting::getHostSalaryToAgent) + .orElse(false); } /** @@ -259,7 +263,7 @@ public class TeamBillSettleListener implements MessageListener { Map metadata = getMetadata(regionConfig); boolean isOpenDailyAutoSalary = isOpenDailyAutoSalary(metadata); - boolean isHostSalaryToAgent = isHostSalaryToAgent(metadata); + boolean isHostSalaryToAgent = isHostSalaryToAgent(teamProfile); for (TeamMemberTarget memberTarget : teamMemberTargets) { ResultResponse body = userBankRunningWaterClient.existsTrackId(memberTarget.getId()); @@ -364,7 +368,7 @@ public class TeamBillSettleListener implements MessageListener { Map metadata = getMetadata(regionConfig); boolean isOpenDailyAutoSalary = isOpenDailyAutoSalary(metadata); - boolean isHostSalaryToAgent = isHostSalaryToAgent(metadata); + boolean isHostSalaryToAgent = isHostSalaryToAgent(teamProfile); for (TeamMemberTarget memberTarget : teamMemberTargets) { ResultResponse body = salaryDiamondRunningWaterClient.existsTrackId(memberTarget.getId()); @@ -508,7 +512,7 @@ public class TeamBillSettleListener implements MessageListener { Map metadata = getMetadata(regionConfig); - if (!isHostSalaryToAgent(metadata)) { + if (!isHostSalaryToAgent(teamProfile)) { return; } @@ -658,7 +662,7 @@ public class TeamBillSettleListener implements MessageListener { Map metadata = getMetadata(regionConfig); - if (!isHostSalaryToAgent(metadata)) { + if (!isHostSalaryToAgent(teamProfile)) { return; } diff --git a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/mongo/service/team/team/impl/TeamProfileServiceImpl.java b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/mongo/service/team/team/impl/TeamProfileServiceImpl.java index 61ec6bdb..9f0de909 100644 --- a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/mongo/service/team/team/impl/TeamProfileServiceImpl.java +++ b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/mongo/service/team/team/impl/TeamProfileServiceImpl.java @@ -83,6 +83,9 @@ public class TeamProfileServiceImpl implements TeamProfileService { if (Objects.nonNull(setting.getMaxMember())) { update.set("setting.maxMember", setting.getMaxMember()); } + if (Objects.nonNull(setting.getHostSalaryToAgent())) { + update.set("setting.hostSalaryToAgent", setting.getHostSalaryToAgent()); + } } if (Objects.nonNull(teamProfile.getCountry())) {