fix
This commit is contained in:
@@ -4,7 +4,6 @@ import com.starry.admin.modules.platform.entity.SysTenantEntity;
|
||||
import com.starry.admin.modules.platform.service.ISysTenantService;
|
||||
import com.starry.admin.modules.platform.vo.SysTenantAddVo;
|
||||
import com.starry.admin.modules.platform.vo.SysTenantQueryVo;
|
||||
import com.starry.admin.utils.ExcelUtils;
|
||||
import com.starry.common.annotation.Log;
|
||||
import com.starry.common.enums.BusinessType;
|
||||
import com.starry.common.result.R;
|
||||
@@ -14,7 +13,6 @@ import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
|
||||
/**
|
||||
@@ -50,16 +48,6 @@ public class SysTenantController {
|
||||
return R.ok(sysTenantService.selectSysTenantList(vo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出租户表列表
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermission('platform:tenant:export')")
|
||||
@Log(title = "租户表", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysTenantQueryVo sysTenantEntity) {
|
||||
ExcelUtils.exportEasyExcel(response, SysTenantEntity.class, sysTenantService.selectSysTenantList(sysTenantEntity).getRecords(), "租户表数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取租户表详细信息
|
||||
*/
|
||||
|
||||
@@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.starry.admin.modules.platform.entity.SysTenantEntity;
|
||||
import com.starry.admin.modules.platform.vo.SysTenantQueryVo;
|
||||
import com.starry.admin.modules.platform.vo.TenantResultVo;
|
||||
import com.starry.common.result.R;
|
||||
|
||||
import java.util.List;
|
||||
@@ -46,7 +45,7 @@ public interface ISysTenantService extends IService<SysTenantEntity> {
|
||||
* @param sysTenantEntity 租户表
|
||||
* @return 租户表集合
|
||||
*/
|
||||
IPage<TenantResultVo> selectSysTenantList(SysTenantQueryVo sysTenantEntity);
|
||||
IPage<SysTenantEntity> selectSysTenantList(SysTenantQueryVo sysTenantEntity);
|
||||
|
||||
/**
|
||||
* 新增租户表
|
||||
|
||||
@@ -16,7 +16,6 @@ import com.starry.admin.modules.platform.mapper.SysTenantMapper;
|
||||
import com.starry.admin.modules.platform.mapper.SysTenantPackageMapper;
|
||||
import com.starry.admin.modules.platform.service.ISysTenantService;
|
||||
import com.starry.admin.modules.platform.vo.SysTenantQueryVo;
|
||||
import com.starry.admin.modules.platform.vo.TenantResultVo;
|
||||
import com.starry.admin.modules.system.entity.*;
|
||||
import com.starry.admin.modules.system.mapper.*;
|
||||
import com.starry.admin.modules.system.service.SysRoleMenuService;
|
||||
@@ -37,6 +36,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -103,21 +103,23 @@ public class SysTenantServiceImpl extends ServiceImpl<SysTenantMapper, SysTenant
|
||||
* @return 租户表
|
||||
*/
|
||||
@Override
|
||||
public IPage<TenantResultVo> selectSysTenantList(SysTenantQueryVo vo) {
|
||||
public IPage<SysTenantEntity> selectSysTenantList(SysTenantQueryVo vo) {
|
||||
LambdaQueryWrapper<SysTenantEntity> wrapper = new LambdaQueryWrapper<>();
|
||||
if (StrUtil.isNotBlank(vo.getTenantStatus())) {
|
||||
wrapper.eq(SysTenantEntity::getTenantStatus, vo.getTenantStatus());
|
||||
}
|
||||
wrapper.orderByDesc(SysTenantEntity::getTenantId);
|
||||
//if (StrUtil.isNotBlank(vo.getTenantStatus())) {
|
||||
// wrapper.eq(SysTenantEntity::getTenantStatus, vo.getTenantStatus());
|
||||
//}
|
||||
if (StrUtil.isNotBlank(vo.getTenantName())) {
|
||||
wrapper.like(SysTenantEntity::getTenantName, vo.getTenantName());
|
||||
}
|
||||
if (StrUtil.isNotBlank(vo.getBeginTime())) {
|
||||
wrapper.ge(SysTenantEntity::getTenantTime, vo.getBeginTime());
|
||||
}
|
||||
if (StrUtil.isNotBlank(vo.getEndTime())) {
|
||||
wrapper.le(SysTenantEntity::getTenantTime, vo.getEndTime());
|
||||
}
|
||||
return sysTenantMapper.selectSysTenantList(new Page<>(vo.getPageNum(), vo.getPageSize()), vo);
|
||||
//if (StrUtil.isNotBlank(vo.getBeginTime())) {
|
||||
// wrapper.ge(SysTenantEntity::getTenantTime, vo.getBeginTime());
|
||||
//}
|
||||
//if (StrUtil.isNotBlank(vo.getEndTime())) {
|
||||
// wrapper.le(SysTenantEntity::getTenantTime, vo.getEndTime());
|
||||
//}
|
||||
Page<SysTenantEntity> page = new Page<>(vo.getPageNum(), vo.getPageSize());
|
||||
return this.baseMapper.selectPage(page, wrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -195,6 +197,7 @@ public class SysTenantServiceImpl extends ServiceImpl<SysTenantMapper, SysTenant
|
||||
// 生成随机key,用来生成域名,关键!
|
||||
sysTenantEntity.setTenantKey(RandomUtil.randomString(8));
|
||||
// 创建租户
|
||||
sysTenantEntity.setCreatedTime(new Date());
|
||||
sysTenantMapper.insert(sysTenantEntity);
|
||||
// 创建默认部门--部门默认名称以租户名称
|
||||
Long deptId = createDept(sysTenantEntity);
|
||||
|
||||
@@ -23,7 +23,7 @@ public class SysTenantAddVo extends BaseEntity<SysTenantAddVo> {
|
||||
* 租户类型;0:公司;1:部门;2:个人;3:其他
|
||||
*/
|
||||
@NotBlank(message = "租户类型不能为空")
|
||||
private String tenantType;
|
||||
private String tenantType = "0";
|
||||
|
||||
/**
|
||||
* 用户状态;0:正常,1:停用
|
||||
|
||||
@@ -152,7 +152,7 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenuEntity
|
||||
for (SysMenuEntity menu : menus) {
|
||||
RouterVo router = new RouterVo();
|
||||
// 0:隐藏
|
||||
router.setHidden("0".equals(menu.getVisible()));
|
||||
router.setHidden("0".equals(menu.getVisible().toString()));
|
||||
router.setName(getRouteName(menu));
|
||||
router.setPath(getRouterPath(menu));
|
||||
router.setComponent(getComponent(menu));
|
||||
|
||||
Reference in New Issue
Block a user