独联体-个人中心菜单分区

This commit is contained in:
2025-09-22 16:15:16 +08:00
parent 87dc61ae91
commit db5c90ea63
4 changed files with 16 additions and 5 deletions

View File

@@ -19,12 +19,15 @@ public class PersonalCenterAdminService {
@Autowired
private PersonalCenterMapper personalCenterMapper;
public IPage getList(Integer pageNum, Integer pageSize, Integer centerId){
public IPage getList(Integer pageNum, Integer pageSize, Integer centerId, Integer partitionId){
Page page = new Page<>(pageNum, pageSize);
QueryWrapper<PersonalCenter> wrapper = new QueryWrapper<>();
if(centerId != null){
wrapper.lambda().eq(PersonalCenter :: getCenterId, centerId);
}
if (partitionId != null && partitionId != 0) {
wrapper.lambda().eq(PersonalCenter :: getPartitionId, partitionId);
}
// 我的房间不可更改
wrapper.lambda().ne(PersonalCenter::getCenterId,1).orderByAsc(PersonalCenter :: getCenterSeq);
return personalCenterMapper.selectPage(page,wrapper);

View File

@@ -23,9 +23,9 @@ public class PersonalCenterAdminController extends BaseController {
@ApiOperation("个人中心功能列表")
@GetMapping(value = "/list")
@ResponseBody
public BusiResult getList(Integer pageNum, Integer pageSize, Integer centerId){
public BusiResult getList(Integer pageNum, Integer pageSize, Integer centerId, Integer partitionId){
JSONObject jsonObject = new JSONObject();
IPage pageInfo = personalCenterAdminService.getList(pageNum, pageSize, centerId);
IPage pageInfo = personalCenterAdminService.getList(pageNum, pageSize, centerId, partitionId);
jsonObject.put("total",pageInfo.getTotal());
jsonObject.put("rows", pageInfo.getRecords());
return new BusiResult(jsonObject);

View File

@@ -17,6 +17,10 @@ public class PersonalCenter {
@TableId(value = "center_id", type = IdType.AUTO)
private Integer centerId;
@ApiModelProperty("分区")
@TableField("partition_id")
private Integer partitionId;
/**
* 个人中心功能编码
*/

View File

@@ -14,6 +14,7 @@ import com.accompany.business.vo.personalcenter.PersonalCenterVo;
import com.accompany.common.constant.Constant;
import com.accompany.common.device.DeviceInfo;
import com.accompany.common.utils.AppVersionUtil;
import com.accompany.core.enumeration.PartitionEnum;
import com.accompany.core.model.Users;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import lombok.extern.slf4j.Slf4j;
@@ -24,7 +25,6 @@ import org.springframework.util.StringUtils;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@Service
@Slf4j
@@ -59,8 +59,12 @@ public class PersonalCenterService {
Users user = usersService.getUsersByUid(uid);
if(user == null || !checkUserInExpect(uid)){
wrapper.lambda().ne(PersonalCenter :: getShowPermission, Constant.ShowPermission.CLAN_OR_HALL);
wrapper.lambda().eq(PersonalCenter :: getPartitionId, PartitionEnum.ARAB.getId());
}
if(! checkUserClanStatus(uid)){
if (user != null) {
wrapper.lambda().eq(PersonalCenter :: getPartitionId, user.getPartitionId());
}
if(!checkUserClanStatus(uid)){
wrapper.lambda().ne(PersonalCenter :: getShowPermission, Constant.ShowPermission.CLAN_ASSOCIATE);
}
List<PersonalCenter> dbList = personalCenterMapper.selectList(wrapper);