# Conflicts:
#	yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/definition/BpmProcessDefinitionServiceImpl.java
#	yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/task/BpmProcessInstanceServiceImpl.java
This commit is contained in:
YunaiV
2025-03-30 10:55:04 +08:00
62 changed files with 3244 additions and 156 deletions

View File

@@ -67,8 +67,8 @@ public class MenuController {
}
@GetMapping({"/list-all-simple", "simple-list"})
@Operation(summary = "获取菜单精简信息列表", description = "只包含被开启的菜单,用于【角色分配菜单】功能的选项。" +
"在多租户的场景下,会只返回租户所在套餐有的菜单")
@Operation(summary = "获取菜单精简信息列表",
description = "只包含被开启的菜单,用于【角色分配菜单】功能的选项。在多租户的场景下,会只返回租户所在套餐有的菜单")
public CommonResult<List<MenuSimpleRespVO>> getSimpleMenuList() {
List<MenuDO> list = menuService.getMenuListByTenant(
new MenuListReqVO().setStatus(CommonStatusEnum.ENABLE.getStatus()));

View File

@@ -1,6 +1,7 @@
package cn.iocoder.yudao.module.system.controller.admin.tenant;
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
@@ -9,7 +10,6 @@ import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.tenant.TenantPageReqVO;
import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.tenant.TenantRespVO;
import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.tenant.TenantSaveReqVO;
import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.tenant.TenantSimpleRespVO;
import cn.iocoder.yudao.module.system.dal.dataobject.tenant.TenantDO;
import cn.iocoder.yudao.module.system.service.tenant.TenantService;
import io.swagger.v3.oas.annotations.Operation;
@@ -27,6 +27,7 @@ import java.util.List;
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
@Tag(name = "管理后台 - 租户")
@RestController
@@ -45,13 +46,25 @@ public class TenantController {
return success(tenant != null ? tenant.getId() : null);
}
@GetMapping({ "simple-list" })
@PermitAll
@Operation(summary = "获取租户精简信息列表", description = "只包含被开启的租户,用于【首页】功能的选择租户选项")
public CommonResult<List<TenantRespVO>> getTenantSimpleList() {
List<TenantDO> list = tenantService.getTenantListByStatus(CommonStatusEnum.ENABLE.getStatus());
return success(convertList(list, tenantDO ->
new TenantRespVO().setId(tenantDO.getId()).setName(tenantDO.getName())));
}
@GetMapping("/get-by-website")
@PermitAll
@Operation(summary = "使用域名,获得租户信息", description = "登录界面,根据用户的域名,获得租户信息")
@Parameter(name = "website", description = "域名", required = true, example = "www.iocoder.cn")
public CommonResult<TenantSimpleRespVO> getTenantByWebsite(@RequestParam("website") String website) {
public CommonResult<TenantRespVO> getTenantByWebsite(@RequestParam("website") String website) {
TenantDO tenant = tenantService.getTenantByWebsite(website);
return success(BeanUtils.toBean(tenant, TenantSimpleRespVO.class));
if (tenant == null || CommonStatusEnum.isDisable(tenant.getStatus())) {
return success(null);
}
return success(new TenantRespVO().setId(tenant.getId()).setName(tenant.getName()));
}
@PostMapping("/create")
@@ -99,8 +112,7 @@ public class TenantController {
@Operation(summary = "导出租户 Excel")
@PreAuthorize("@ss.hasPermission('system:tenant:export')")
@ApiAccessLog(operateType = EXPORT)
public void exportTenantExcel(@Valid TenantPageReqVO exportReqVO,
HttpServletResponse response) throws IOException {
public void exportTenantExcel(@Valid TenantPageReqVO exportReqVO, HttpServletResponse response) throws IOException {
exportReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<TenantDO> list = tenantService.getTenantPage(exportReqVO).getList();
// 导出 Excel

View File

@@ -1,16 +0,0 @@
package cn.iocoder.yudao.module.system.controller.admin.tenant.vo.tenant;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Schema(description = "管理后台 - 租户精简 Response VO")
@Data
public class TenantSimpleRespVO {
@Schema(description = "租户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
private Long id;
@Schema(description = "租户名", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道")
private String name;
}

View File

@@ -43,4 +43,8 @@ public interface TenantMapper extends BaseMapperX<TenantDO> {
return selectList(TenantDO::getPackageId, packageId);
}
default List<TenantDO> selectListByStatus(Integer status) {
return selectList(TenantDO::getStatus, status);
}
}

View File

@@ -38,7 +38,7 @@ public interface TenantService {
* 更新租户的角色菜单
*
* @param tenantId 租户编号
* @param menuIds 菜单编号数组
* @param menuIds 菜单编号数组
*/
void updateTenantRoleMenu(Long tenantId, Set<Long> menuIds);
@@ -97,6 +97,14 @@ public interface TenantService {
*/
List<TenantDO> getTenantListByPackageId(Long packageId);
/**
* 获得指定状态的租户列表
*
* @param status 状态
* @return 租户列表
*/
List<TenantDO> getTenantListByStatus(Integer status);
/**
* 进行租户的信息处理逻辑
* 其中,租户编号从 {@link TenantContextHolder} 上下文中获取

View File

@@ -265,6 +265,11 @@ public class TenantServiceImpl implements TenantService {
return tenantMapper.selectListByPackageId(packageId);
}
@Override
public List<TenantDO> getTenantListByStatus(Integer status) {
return tenantMapper.selectListByStatus(status);
}
@Override
public void handleTenantInfo(TenantInfoHandler handler) {
// 如果禁用,则不执行逻辑