xuhy
2025-01-22 e78da8ca397fbfca8d57ab518e1778dd57e0dd90
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TTenantServiceImpl.java
@@ -1,12 +1,15 @@
package com.ruoyi.system.service.impl;
import com.ruoyi.common.basic.PageInfo;
import com.ruoyi.common.constant.DictConstants;
import com.ruoyi.common.utils.DictUtils;
import com.ruoyi.system.mapper.TTenantMapper;
import com.ruoyi.system.model.TTenant;
import com.ruoyi.system.query.TTenantQuery;
import com.ruoyi.system.service.TTenantService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.system.vo.SysUserVO;
import com.ruoyi.system.vo.TenantVO;
import org.springframework.stereotype.Service;
import java.util.List;
@@ -23,9 +26,13 @@
public class TTenantServiceImpl extends ServiceImpl<TTenantMapper, TTenant> implements TTenantService {
    @Override
    public PageInfo<TTenant> pageList(TTenantQuery query) {
        PageInfo<TTenant> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize());
        List<TTenant> list = this.baseMapper.pageList(query,pageInfo);
    public PageInfo<TenantVO> pageList(TTenantQuery query) {
        PageInfo<TenantVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize());
        List<TenantVO> list = this.baseMapper.pageList(query,pageInfo);
        for (TenantVO tenantVO : list) {
            tenantVO.setTenantAttributesName(DictUtils.getDictLabel(DictConstants.DICT_TYPE_TENANT_ATTRIBUTE,tenantVO.getTenantAttributes()));
            tenantVO.setTenantTypeName(DictUtils.getDictLabel(DictConstants.DICT_TYPE_TENANT_TYPE,tenantVO.getTenantType()));
        }
        pageInfo.setRecords(list);
        return pageInfo;
    }