家族列表增加等级排序 按区域查询

This commit is contained in:
tianfeng 2025-12-29 20:14:38 +08:00
parent fc92197004
commit fee6a3fbb2
5 changed files with 17 additions and 3 deletions

View File

@ -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())

View File

@ -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<FamilyListCO> execute(FamilyListCmd cmd) {
Page<FamilyWithLevelDTO> page = new Page<>(cmd.getCurrent(), cmd.getSize());
@ -42,8 +44,8 @@ public class FamilyListExe {
return PageResult.newPageResult(0);
}
}
IPage<FamilyWithLevelDTO> familyPage = familyBaseInfoDAO.pageWithLevel(page, familyAccount);
IPage<FamilyWithLevelDTO> familyPage = familyBaseInfoDAO.pageWithLevel(page, familyAccount, userRegionGateway.getRegionId(cmd.getReqUserId()));
PageResult<FamilyListCO> pageResult = new PageResult<>();
pageResult.setCurrent(familyPage.getCurrent());

View File

@ -27,6 +27,6 @@ public interface FamilyBaseInfoDAO extends BaseDAO<FamilyBaseInfo> {
* @param familyAccount 家族账号可选
* @return 家族信息列表
*/
IPage<FamilyWithLevelDTO> pageWithLevel(Page<FamilyWithLevelDTO> page, @Param("familyAccount") Long familyAccount);
IPage<FamilyWithLevelDTO> pageWithLevel(Page<FamilyWithLevelDTO> page, @Param("familyAccount") Long familyAccount, @Param("regionId") String regionId);
}

View File

@ -39,6 +39,12 @@ public class FamilyBaseInfo extends TimestampBaseEntity {
@TableField("sys_origin")
private String sysOrigin;
/**
*
*/
@TableField("region_id")
private String regionId;
/**
* 家族账号.
*/

View File

@ -30,6 +30,9 @@
<if test="familyAccount != null">
AND fbi.family_account = #{familyAccount}
</if>
<if test="regionId != null">
AND fbi.region_id = #{regionId}
</if>
</where>
ORDER BY IFNULL(fle.exp, 0) DESC, fbi.create_time DESC
</select>