1、关闭多租户功能
2、新增企业管理模块
This commit is contained in:
		
							parent
							
								
									2928ee4c3e
								
							
						
					
					
						commit
						702e8b0427
					
				| @ -30,6 +30,14 @@ | |||||||
|             <artifactId>yudao-spring-boot-starter-web</artifactId> |             <artifactId>yudao-spring-boot-starter-web</artifactId> | ||||||
|         </dependency> |         </dependency> | ||||||
| 
 | 
 | ||||||
|  |         <!-- 工作流相关 --> | ||||||
|  |         <dependency> | ||||||
|  |             <groupId>cn.iocoder.boot</groupId> | ||||||
|  |             <artifactId>yudao-module-bpm-api</artifactId> | ||||||
|  |             <version>${revision}</version> | ||||||
|  |         </dependency> | ||||||
|  | 
 | ||||||
|  |         <!-- 权限校验相关 --> | ||||||
|         <dependency> |         <dependency> | ||||||
|             <groupId>cn.iocoder.boot</groupId> |             <groupId>cn.iocoder.boot</groupId> | ||||||
|             <artifactId>yudao-spring-boot-starter-security</artifactId> |             <artifactId>yudao-spring-boot-starter-security</artifactId> | ||||||
|  | |||||||
| @ -1,30 +0,0 @@ | |||||||
| package cn.iocoder.yudao.module.fta.controller.admin; |  | ||||||
| 
 |  | ||||||
| import cn.iocoder.yudao.framework.common.pojo.CommonResult; |  | ||||||
| import io.swagger.v3.oas.annotations.Operation; |  | ||||||
| import io.swagger.v3.oas.annotations.tags.Tag; |  | ||||||
| import org.springframework.validation.annotation.Validated; |  | ||||||
| import org.springframework.web.bind.annotation.GetMapping; |  | ||||||
| import org.springframework.web.bind.annotation.RequestMapping; |  | ||||||
| import org.springframework.web.bind.annotation.RestController; |  | ||||||
| 
 |  | ||||||
| import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |  | ||||||
| 
 |  | ||||||
| /** |  | ||||||
|  * @Author wss |  | ||||||
|  * @Date 2024.04.26 10:28 |  | ||||||
|  **/ |  | ||||||
| 
 |  | ||||||
| @Tag(name = "管理后台 - 自贸区") |  | ||||||
| @RestController |  | ||||||
| @RequestMapping("/fta/test") |  | ||||||
| @Validated |  | ||||||
| public class FtaTestController { |  | ||||||
| 
 |  | ||||||
|     @GetMapping("/get") |  | ||||||
|     @Operation(summary = "获取 test 信息") |  | ||||||
|     public CommonResult<String> get() { |  | ||||||
|         return success("true"); |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
| } |  | ||||||
| @ -70,4 +70,8 @@ public class EnterpriseInformationSaveReqVO { | |||||||
|     @NotEmpty(message = "经营许可范围不能为空") |     @NotEmpty(message = "经营许可范围不能为空") | ||||||
|     private String operatePermitRange; |     private String operatePermitRange; | ||||||
| 
 | 
 | ||||||
|  |     @Schema(description = "发起人自选审批人 Map", example = "{taskKey1: [1, 2]}", requiredMode = Schema.RequiredMode.REQUIRED) | ||||||
|  |     @NotEmpty(message = "审批人不能为空") | ||||||
|  |     private Map<String, List<Long>> startUserSelectAssignees; | ||||||
|  | 
 | ||||||
| } | } | ||||||
|  | |||||||
| @ -1,29 +0,0 @@ | |||||||
| package cn.iocoder.yudao.module.fta.controller.app; |  | ||||||
| 
 |  | ||||||
| import cn.iocoder.yudao.framework.common.pojo.CommonResult; |  | ||||||
| import io.swagger.v3.oas.annotations.Operation; |  | ||||||
| import io.swagger.v3.oas.annotations.tags.Tag; |  | ||||||
| import org.springframework.validation.annotation.Validated; |  | ||||||
| import org.springframework.web.bind.annotation.GetMapping; |  | ||||||
| import org.springframework.web.bind.annotation.RequestMapping; |  | ||||||
| import org.springframework.web.bind.annotation.RestController; |  | ||||||
| 
 |  | ||||||
| import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |  | ||||||
| 
 |  | ||||||
| /** |  | ||||||
|  * @Author wss |  | ||||||
|  * @Date 2024.04.26 10:33 |  | ||||||
|  **/ |  | ||||||
| @Tag(name = "用户 App - 自贸区") |  | ||||||
| @RestController |  | ||||||
| @RequestMapping("/demo/test") |  | ||||||
| @Validated |  | ||||||
| public class AppFtaTestController { |  | ||||||
| 
 |  | ||||||
|     @GetMapping("/get") |  | ||||||
|     @Operation(summary = "获取 test 信息") |  | ||||||
|     public CommonResult<String> get() { |  | ||||||
|         return success("true"); |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
| } |  | ||||||
| @ -1,5 +1,6 @@ | |||||||
| package cn.iocoder.yudao.module.fta.dal.dataobject.enterpriseinformation; | package cn.iocoder.yudao.module.fta.dal.dataobject.enterpriseinformation; | ||||||
| 
 | 
 | ||||||
|  | import cn.iocoder.yudao.module.bpm.enums.task.BpmTaskStatusEnum; | ||||||
| import lombok.*; | import lombok.*; | ||||||
| 
 | 
 | ||||||
| import java.time.LocalDate; | import java.time.LocalDate; | ||||||
| @ -89,5 +90,19 @@ public class EnterpriseInformationDO extends BaseDO { | |||||||
|      * 经营许可范围 |      * 经营许可范围 | ||||||
|      */ |      */ | ||||||
|     private String operatePermitRange; |     private String operatePermitRange; | ||||||
|  |     /** | ||||||
|  |      * 审批结果 | ||||||
|  |      * | ||||||
|  |      * 枚举 {@link BpmTaskStatusEnum} | ||||||
|  |      * 考虑到简单,所以直接复用了 BpmProcessInstanceStatusEnum 枚举,也可以自己定义一个枚举哈 | ||||||
|  |      */ | ||||||
|  |     private Integer status; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 对应的流程编号 | ||||||
|  |      * | ||||||
|  |      * 关联 ProcessInstance 的 id 属性 | ||||||
|  |      */ | ||||||
|  |     private String processInstanceId; | ||||||
| 
 | 
 | ||||||
| } | } | ||||||
|  | |||||||
| @ -1,5 +1,8 @@ | |||||||
| package cn.iocoder.yudao.module.fta.service.enterpriseinformation; | package cn.iocoder.yudao.module.fta.service.enterpriseinformation; | ||||||
| 
 | 
 | ||||||
|  | import cn.iocoder.yudao.module.bpm.api.task.BpmProcessInstanceApi; | ||||||
|  | import cn.iocoder.yudao.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO; | ||||||
|  | import cn.iocoder.yudao.module.bpm.enums.task.BpmTaskStatusEnum; | ||||||
| import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||||
| import javax.annotation.Resource; | import javax.annotation.Resource; | ||||||
| import org.springframework.validation.annotation.Validated; | import org.springframework.validation.annotation.Validated; | ||||||
| @ -15,6 +18,7 @@ import cn.iocoder.yudao.framework.common.util.object.BeanUtils; | |||||||
| import cn.iocoder.yudao.module.fta.dal.mysql.enterpriseinformation.EnterpriseInformationMapper; | import cn.iocoder.yudao.module.fta.dal.mysql.enterpriseinformation.EnterpriseInformationMapper; | ||||||
| 
 | 
 | ||||||
| import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; | import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; | ||||||
|  | import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; | ||||||
| import static cn.iocoder.yudao.module.fta.enums.ErrorCodeConstants.*; | import static cn.iocoder.yudao.module.fta.enums.ErrorCodeConstants.*; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
| @ -26,14 +30,34 @@ import static cn.iocoder.yudao.module.fta.enums.ErrorCodeConstants.*; | |||||||
| @Validated | @Validated | ||||||
| public class EnterpriseInformationServiceImpl implements EnterpriseInformationService { | public class EnterpriseInformationServiceImpl implements EnterpriseInformationService { | ||||||
| 
 | 
 | ||||||
|  |     /** | ||||||
|  |      * FTA 企业基础信息对应的流程定义 KEY | ||||||
|  |      */ | ||||||
|  |     public static final String PROCESS_KEY = "fta_enterprise"; | ||||||
|  | 
 | ||||||
|     @Resource |     @Resource | ||||||
|     private EnterpriseInformationMapper enterpriseInformationMapper; |     private EnterpriseInformationMapper enterpriseInformationMapper; | ||||||
| 
 | 
 | ||||||
|  |     @Resource | ||||||
|  |     private BpmProcessInstanceApi processInstanceApi; | ||||||
|  | 
 | ||||||
|     @Override |     @Override | ||||||
|     public Long createEnterpriseInformation(EnterpriseInformationSaveReqVO createReqVO) { |     public Long createEnterpriseInformation(EnterpriseInformationSaveReqVO createReqVO) { | ||||||
|         // 插入 |         // 插入 企业基础信息填报 | ||||||
|         EnterpriseInformationDO enterpriseInformation = BeanUtils.toBean(createReqVO, EnterpriseInformationDO.class); |         EnterpriseInformationDO enterpriseInformation = BeanUtils.toBean(createReqVO, EnterpriseInformationDO.class) | ||||||
|  |                 .setStatus(BpmTaskStatusEnum.RUNNING.getStatus()); | ||||||
|         enterpriseInformationMapper.insert(enterpriseInformation); |         enterpriseInformationMapper.insert(enterpriseInformation); | ||||||
|  | 
 | ||||||
|  |         // 发起 BPM 流程 | ||||||
|  |         Map<String, Object> processInstanceVariables = new HashMap<>(); | ||||||
|  |         String processInstanceId = processInstanceApi.createProcessInstance(getLoginUserId(), | ||||||
|  |                 new BpmProcessInstanceCreateReqDTO().setProcessDefinitionKey(PROCESS_KEY) | ||||||
|  |                         .setVariables(processInstanceVariables).setBusinessKey(String.valueOf(enterpriseInformation.getId())) | ||||||
|  |                         .setStartUserSelectAssignees(createReqVO.getStartUserSelectAssignees())); | ||||||
|  | 
 | ||||||
|  |         // 将工作流的编号,更新到企业基础信息填报 | ||||||
|  |         enterpriseInformationMapper.updateById(new EnterpriseInformationDO().setId(enterpriseInformation.getId()).setProcessInstanceId(processInstanceId)); | ||||||
|  | 
 | ||||||
|         // 返回 |         // 返回 | ||||||
|         return enterpriseInformation.getId(); |         return enterpriseInformation.getId(); | ||||||
|     } |     } | ||||||
|  | |||||||
| @ -51,11 +51,11 @@ | |||||||
| <!--            <version>${revision}</version>--> | <!--            <version>${revision}</version>--> | ||||||
| <!--        </dependency>--> | <!--        </dependency>--> | ||||||
|         <!-- 工作流。默认注释,保证编译速度 --> |         <!-- 工作流。默认注释,保证编译速度 --> | ||||||
| <!--        <dependency>--> |         <dependency> | ||||||
| <!--            <groupId>cn.iocoder.boot</groupId>--> |             <groupId>cn.iocoder.boot</groupId> | ||||||
| <!--            <artifactId>yudao-module-bpm-biz</artifactId>--> |             <artifactId>yudao-module-bpm-biz</artifactId> | ||||||
| <!--            <version>${revision}</version>--> |             <version>${revision}</version> | ||||||
| <!--        </dependency>--> |         </dependency> | ||||||
|         <!-- 支付服务。默认注释,保证编译速度 --> |         <!-- 支付服务。默认注释,保证编译速度 --> | ||||||
| <!--        <dependency>--> | <!--        <dependency>--> | ||||||
| <!--            <groupId>cn.iocoder.boot</groupId>--> | <!--            <groupId>cn.iocoder.boot</groupId>--> | ||||||
|  | |||||||
| @ -182,7 +182,7 @@ yudao: | |||||||
|     db-schemas: ${spring.datasource.dynamic.datasource.master.name} |     db-schemas: ${spring.datasource.dynamic.datasource.master.name} | ||||||
|     front-type: 10 # 前端模版的类型,参见 CodegenFrontTypeEnum 枚举类 |     front-type: 10 # 前端模版的类型,参见 CodegenFrontTypeEnum 枚举类 | ||||||
|   tenant: # 多租户相关配置项 |   tenant: # 多租户相关配置项 | ||||||
|     enable: true |     enable: false | ||||||
|     ignore-urls: |     ignore-urls: | ||||||
|       - /admin-api/system/tenant/get-id-by-name # 基于名字获取租户,不许带租户编号 |       - /admin-api/system/tenant/get-id-by-name # 基于名字获取租户,不许带租户编号 | ||||||
|       - /admin-api/system/tenant/get-by-website # 基于域名获取租户,不许带租户编号 |       - /admin-api/system/tenant/get-by-website # 基于域名获取租户,不许带租户编号 | ||||||
| @ -261,4 +261,4 @@ debug: false | |||||||
| # 积木报表配置 | # 积木报表配置 | ||||||
| jeecg: | jeecg: | ||||||
|   jmreport: |   jmreport: | ||||||
|     saas-mode: tenant |     saas-mode: tenant | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user