diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/family/FamilyCreateExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/family/FamilyCreateExe.java index eb4fb90c..540bc940 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/family/FamilyCreateExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/family/FamilyCreateExe.java @@ -12,6 +12,7 @@ import com.red.circle.framework.core.response.ResponseErrorCode; import com.red.circle.other.app.common.account.FamilyAccountShortProduction; import com.red.circle.other.app.dto.cmd.family.FamilyCreateCmd; import com.red.circle.other.domain.gateway.user.UserProfileGateway; +import com.red.circle.other.domain.gateway.user.ability.UserRegionGateway; import com.red.circle.other.domain.model.user.OwnSpecialId; import com.red.circle.other.domain.model.user.UserProfile; import com.red.circle.other.infra.common.family.FamilyCommon; @@ -64,6 +65,7 @@ public class FamilyCreateExe { private final FamilyLevelConfigService familyLevelConfigService; private final ApprovalUserSettingDataService approvalUserSettingDataService; private final FamilyMessageService familyMessageService; + private final UserRegionGateway userRegionGateway; @Transactional(rollbackFor = Exception.class) public Long execute(FamilyCreateCmd cmd) { @@ -148,6 +150,7 @@ public class FamilyCreateExe { ossServiceClient .processImgSaveAsCompressZoom(cmd.getFamilyAvatar(), ImageSizeConst.COVER_HEIGHT) )) + .setRegionId(userRegionGateway.getRegionId(cmd.getReqUserId())) .setFamilyName(cmd.getFamilyName()) .setFamilyIntro(cmd.getFamilyIntro()) .setFamilyStatus(FamilyStatusEnum.NORMAL.name()) diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/family/FamilyListExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/family/FamilyListExe.java index c93a1a8a..31933690 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/family/FamilyListExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/family/FamilyListExe.java @@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.red.circle.framework.dto.PageResult; import com.red.circle.other.app.dto.clientobject.family.FamilyListCO; import com.red.circle.other.app.dto.cmd.family.FamilyListCmd; +import com.red.circle.other.domain.gateway.user.ability.UserRegionGateway; import com.red.circle.other.infra.database.rds.dao.family.FamilyBaseInfoDAO; import com.red.circle.other.infra.database.rds.dto.family.FamilyWithLevelDTO; import com.red.circle.other.infra.database.rds.entity.family.FamilyLevelConfig; @@ -30,6 +31,7 @@ public class FamilyListExe { private final FamilyLevelConfigService familyLevelConfigService; private final FamilyMemberInfoService familyMemberInfoService; private final FamilyBaseInfoDAO familyBaseInfoDAO; + private final UserRegionGateway userRegionGateway; public PageResult execute(FamilyListCmd cmd) { Page page = new Page<>(cmd.getCurrent(), cmd.getSize()); @@ -42,8 +44,8 @@ public class FamilyListExe { return PageResult.newPageResult(0); } } - - IPage familyPage = familyBaseInfoDAO.pageWithLevel(page, familyAccount); + + IPage familyPage = familyBaseInfoDAO.pageWithLevel(page, familyAccount, userRegionGateway.getRegionId(cmd.getReqUserId())); PageResult pageResult = new PageResult<>(); pageResult.setCurrent(familyPage.getCurrent()); diff --git a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/dao/family/FamilyBaseInfoDAO.java b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/dao/family/FamilyBaseInfoDAO.java index 90621a41..a5a84ac8 100644 --- a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/dao/family/FamilyBaseInfoDAO.java +++ b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/dao/family/FamilyBaseInfoDAO.java @@ -27,6 +27,6 @@ public interface FamilyBaseInfoDAO extends BaseDAO { * @param familyAccount 家族账号(可选) * @return 家族信息列表 */ - IPage pageWithLevel(Page page, @Param("familyAccount") Long familyAccount); + IPage pageWithLevel(Page page, @Param("familyAccount") Long familyAccount, @Param("regionId") String regionId); } diff --git a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/entity/family/FamilyBaseInfo.java b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/entity/family/FamilyBaseInfo.java index 036a660c..b1d09178 100644 --- a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/entity/family/FamilyBaseInfo.java +++ b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/entity/family/FamilyBaseInfo.java @@ -39,6 +39,12 @@ public class FamilyBaseInfo extends TimestampBaseEntity { @TableField("sys_origin") private String sysOrigin; + /** + * + */ + @TableField("region_id") + private String regionId; + /** * 家族账号. */ diff --git a/rc-service/rc-service-other/other-infrastructure/src/main/resources/dao/family/FamilyBaseInfoDAO.xml b/rc-service/rc-service-other/other-infrastructure/src/main/resources/dao/family/FamilyBaseInfoDAO.xml index 72980638..e9544e69 100644 --- a/rc-service/rc-service-other/other-infrastructure/src/main/resources/dao/family/FamilyBaseInfoDAO.xml +++ b/rc-service/rc-service-other/other-infrastructure/src/main/resources/dao/family/FamilyBaseInfoDAO.xml @@ -30,6 +30,9 @@ AND fbi.family_account = #{familyAccount} + + AND fbi.region_id = #{regionId} + ORDER BY IFNULL(fle.exp, 0) DESC, fbi.create_time DESC