mirror of
				https://gitee.com/hhyykk/ipms-sjy.git
				synced 2025-10-31 10:18:42 +08:00 
			
		
		
		
	初始化 crm 模块
This commit is contained in:
		
							
								
								
									
										1
									
								
								pom.xml
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								pom.xml
									
									
									
									
									
								
							| @@ -21,6 +21,7 @@ | |||||||
| <!--        <module>yudao-module-mp</module>--> | <!--        <module>yudao-module-mp</module>--> | ||||||
| <!--        <module>yudao-module-pay</module>--> | <!--        <module>yudao-module-pay</module>--> | ||||||
| <!--        <module>yudao-module-mall</module>--> | <!--        <module>yudao-module-mall</module>--> | ||||||
|  |         <module>yudao-module-crm</module> | ||||||
|         <!-- 示例项目 --> |         <!-- 示例项目 --> | ||||||
|         <module>yudao-example</module> |         <module>yudao-example</module> | ||||||
|     </modules> |     </modules> | ||||||
|   | |||||||
| @@ -35,9 +35,12 @@ public class ServiceErrorCodeRange { | |||||||
|     // 模块 member 错误码区间 [1-004-000-000 ~ 1-005-000-000) |     // 模块 member 错误码区间 [1-004-000-000 ~ 1-005-000-000) | ||||||
|     // 模块 mp 错误码区间 [1-006-000-000 ~ 1-007-000-000) |     // 模块 mp 错误码区间 [1-006-000-000 ~ 1-007-000-000) | ||||||
|     // 模块 pay 错误码区间 [1-007-000-000 ~ 1-008-000-000) |     // 模块 pay 错误码区间 [1-007-000-000 ~ 1-008-000-000) | ||||||
|     // 模块 product 错误码区间 [1-008-000-000 ~ 1-009-000-000) |  | ||||||
|     // 模块 bpm 错误码区间 [1-009-000-000 ~ 1-010-000-000) |     // 模块 bpm 错误码区间 [1-009-000-000 ~ 1-010-000-000) | ||||||
|  |  | ||||||
|  |     // 模块 product 错误码区间 [1-008-000-000 ~ 1-009-000-000) | ||||||
|     // 模块 trade 错误码区间 [1-011-000-000 ~ 1-012-000-000) |     // 模块 trade 错误码区间 [1-011-000-000 ~ 1-012-000-000) | ||||||
|     // 模块 promotion 错误码区间 [1-013-000-000 ~ 1-014-000-000) |     // 模块 promotion 错误码区间 [1-013-000-000 ~ 1-014-000-000) | ||||||
|  |  | ||||||
|  |     // 模块 crm 错误码区间 [1-020-000-000 ~ 1-021-000-000) | ||||||
|  |  | ||||||
| } | } | ||||||
|   | |||||||
							
								
								
									
										25
									
								
								yudao-module-crm/pom.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								yudao-module-crm/pom.xml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,25 @@ | |||||||
|  | <?xml version="1.0" encoding="UTF-8"?> | ||||||
|  | <project xmlns="http://maven.apache.org/POM/4.0.0" | ||||||
|  |          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||||||
|  |          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||||||
|  |     <parent> | ||||||
|  |         <groupId>cn.iocoder.boot</groupId> | ||||||
|  |         <artifactId>yudao</artifactId> | ||||||
|  |         <version>${revision}</version> | ||||||
|  |     </parent> | ||||||
|  |     <modules> | ||||||
|  |         <module>yudao-module-crm-api</module> | ||||||
|  |         <module>yudao-module-crm-biz</module> | ||||||
|  |     </modules> | ||||||
|  |     <modelVersion>4.0.0</modelVersion> | ||||||
|  |     <artifactId>yudao-module-crm</artifactId> | ||||||
|  |     <packaging>pom</packaging> | ||||||
|  |  | ||||||
|  |     <name>${project.artifactId}</name> | ||||||
|  |  | ||||||
|  |     <description> | ||||||
|  |         crm 包下,客户关系管理(Customer Relationship Management)。 | ||||||
|  |         例如说:客户、联系人、商机、合同、回款等等 | ||||||
|  |     </description> | ||||||
|  |  | ||||||
|  | </project> | ||||||
							
								
								
									
										33
									
								
								yudao-module-crm/yudao-module-crm-api/pom.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										33
									
								
								yudao-module-crm/yudao-module-crm-api/pom.xml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,33 @@ | |||||||
|  | <?xml version="1.0" encoding="UTF-8"?> | ||||||
|  | <project xmlns="http://maven.apache.org/POM/4.0.0" | ||||||
|  |          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||||||
|  |          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||||||
|  |     <parent> | ||||||
|  |         <groupId>cn.iocoder.boot</groupId> | ||||||
|  |         <artifactId>yudao-module-crm</artifactId> | ||||||
|  |         <version>${revision}</version> | ||||||
|  |     </parent> | ||||||
|  |     <modelVersion>4.0.0</modelVersion> | ||||||
|  |     <artifactId>yudao-module-crm-api</artifactId> | ||||||
|  |     <packaging>jar</packaging> | ||||||
|  |  | ||||||
|  |     <name>${project.artifactId}</name> | ||||||
|  |     <description> | ||||||
|  |         crm 模块 API,暴露给其它模块调用 | ||||||
|  |     </description> | ||||||
|  |  | ||||||
|  |     <dependencies> | ||||||
|  |         <dependency> | ||||||
|  |             <groupId>cn.iocoder.boot</groupId> | ||||||
|  |             <artifactId>yudao-common</artifactId> | ||||||
|  |         </dependency> | ||||||
|  |  | ||||||
|  |         <!-- 参数校验 --> | ||||||
|  |         <dependency> | ||||||
|  |             <groupId>org.springframework.boot</groupId> | ||||||
|  |             <artifactId>spring-boot-starter-validation</artifactId> | ||||||
|  |             <optional>true</optional> | ||||||
|  |         </dependency> | ||||||
|  |     </dependencies> | ||||||
|  |  | ||||||
|  | </project> | ||||||
| @@ -0,0 +1,4 @@ | |||||||
|  | /** | ||||||
|  |  * crm API 包,定义暴露给其它模块的 API | ||||||
|  |  */ | ||||||
|  | package cn.iocoder.yudao.module.crm.api; | ||||||
| @@ -0,0 +1,12 @@ | |||||||
|  | package cn.iocoder.yudao.module.crm.enums; | ||||||
|  |  | ||||||
|  | /** | ||||||
|  |  * CRM 错误码枚举类 | ||||||
|  |  * <p> | ||||||
|  |  * crm 系统,使用 1-020-000-000 段 | ||||||
|  |  */ | ||||||
|  | public interface ErrorCodeConstants { | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | } | ||||||
							
								
								
									
										55
									
								
								yudao-module-crm/yudao-module-crm-biz/pom.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										55
									
								
								yudao-module-crm/yudao-module-crm-biz/pom.xml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,55 @@ | |||||||
|  | <?xml version="1.0" encoding="UTF-8"?> | ||||||
|  | <project xmlns="http://maven.apache.org/POM/4.0.0" | ||||||
|  |          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||||||
|  |          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||||||
|  |     <parent> | ||||||
|  |         <groupId>cn.iocoder.boot</groupId> | ||||||
|  |         <artifactId>yudao-module-crm</artifactId> | ||||||
|  |         <version>${revision}</version> | ||||||
|  |     </parent> | ||||||
|  |     <modelVersion>4.0.0</modelVersion> | ||||||
|  |     <artifactId>yudao-module-crm-biz</artifactId> | ||||||
|  |  | ||||||
|  |     <name>${project.artifactId}</name> | ||||||
|  |     <description> | ||||||
|  |         crm 包下,客户关系管理(Customer Relationship Management)。 | ||||||
|  |         例如说:客户、联系人、商机、合同、回款等等 | ||||||
|  |     </description> | ||||||
|  |  | ||||||
|  |     <dependencies> | ||||||
|  |         <dependency> | ||||||
|  |             <groupId>cn.iocoder.boot</groupId> | ||||||
|  |             <artifactId>yudao-module-system-api</artifactId> | ||||||
|  |             <version>${revision}</version> | ||||||
|  |         </dependency> | ||||||
|  |  | ||||||
|  |         <!-- 业务组件 --> | ||||||
|  |         <dependency> | ||||||
|  |             <groupId>cn.iocoder.boot</groupId> | ||||||
|  |             <artifactId>yudao-spring-boot-starter-biz-operatelog</artifactId> | ||||||
|  |         </dependency> | ||||||
|  |  | ||||||
|  |         <!-- Web 相关 --> | ||||||
|  |         <dependency> | ||||||
|  |             <groupId>cn.iocoder.boot</groupId> | ||||||
|  |             <artifactId>yudao-spring-boot-starter-web</artifactId> | ||||||
|  |         </dependency> | ||||||
|  |  | ||||||
|  |         <dependency> | ||||||
|  |             <groupId>cn.iocoder.boot</groupId> | ||||||
|  |             <artifactId>yudao-spring-boot-starter-security</artifactId> | ||||||
|  |         </dependency> | ||||||
|  |  | ||||||
|  |         <!-- DB 相关 --> | ||||||
|  |         <dependency> | ||||||
|  |             <groupId>cn.iocoder.boot</groupId> | ||||||
|  |             <artifactId>yudao-spring-boot-starter-mybatis</artifactId> | ||||||
|  |         </dependency> | ||||||
|  |  | ||||||
|  |         <!-- Test 测试相关 --> | ||||||
|  |         <dependency> | ||||||
|  |             <groupId>cn.iocoder.boot</groupId> | ||||||
|  |             <artifactId>yudao-spring-boot-starter-test</artifactId> | ||||||
|  |         </dependency> | ||||||
|  |     </dependencies> | ||||||
|  | </project> | ||||||
| @@ -0,0 +1,4 @@ | |||||||
|  | /** | ||||||
|  |  * crm API 实现类,定义暴露给其它模块的 API | ||||||
|  |  */ | ||||||
|  | package cn.iocoder.yudao.module.crm.api; | ||||||
| @@ -0,0 +1,4 @@ | |||||||
|  | /** | ||||||
|  |  * 商机(销售机会) | ||||||
|  |  */ | ||||||
|  | package cn.iocoder.yudao.module.crm.controller.admin.business; | ||||||
| @@ -0,0 +1,4 @@ | |||||||
|  | /** | ||||||
|  |  * 线索 | ||||||
|  |  */ | ||||||
|  | package cn.iocoder.yudao.module.crm.controller.admin.clue; | ||||||
| @@ -0,0 +1,4 @@ | |||||||
|  | /** | ||||||
|  |  * 联系人 | ||||||
|  |  */ | ||||||
|  | package cn.iocoder.yudao.module.crm.controller.admin.contact; | ||||||
| @@ -0,0 +1,4 @@ | |||||||
|  | /** | ||||||
|  |  * 合同 | ||||||
|  |  */ | ||||||
|  | package cn.iocoder.yudao.module.crm.controller.admin.contract; | ||||||
| @@ -0,0 +1,4 @@ | |||||||
|  | ### 请求 /crm/customer/test 接口 => 成功 | ||||||
|  | GET {{baseUrl}}/crm/customer/test | ||||||
|  | tenant-id: 1 | ||||||
|  | Authorization: Bearer {{token}} | ||||||
| @@ -0,0 +1,23 @@ | |||||||
|  | package cn.iocoder.yudao.module.crm.controller.admin.customer; | ||||||
|  |  | ||||||
|  | import cn.iocoder.yudao.framework.common.pojo.CommonResult; | ||||||
|  | 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; | ||||||
|  |  | ||||||
|  | @Tag(name = "管理后台 - 客户信息") | ||||||
|  | @RestController | ||||||
|  | @RequestMapping("/crm/customer") | ||||||
|  | @Validated | ||||||
|  | public class CrmCustomerController { | ||||||
|  |  | ||||||
|  |     @GetMapping("/test") | ||||||
|  |     public CommonResult<String> test() { | ||||||
|  |         return success("hello"); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  | } | ||||||
| @@ -0,0 +1,4 @@ | |||||||
|  | /** | ||||||
|  |  * 产品表 | ||||||
|  |  */ | ||||||
|  | package cn.iocoder.yudao.module.crm.controller.admin.product; | ||||||
| @@ -0,0 +1,4 @@ | |||||||
|  | /** | ||||||
|  |  * 回款 | ||||||
|  |  */ | ||||||
|  | package cn.iocoder.yudao.module.crm.controller.admin.receivable; | ||||||
| @@ -0,0 +1,4 @@ | |||||||
|  | /** | ||||||
|  |  * 占位 | ||||||
|  |  */ | ||||||
|  | package cn.iocoder.yudao.module.crm.controller.app; | ||||||
| @@ -0,0 +1,6 @@ | |||||||
|  | /** | ||||||
|  |  * 提供 RESTful API 给前端: | ||||||
|  |  * 1. admin 包:提供给管理后台 yudao-ui-admin 前端项目 | ||||||
|  |  * 2. app 包:提供给用户 APP yudao-ui-app 前端项目,它的 Controller 和 VO 都要添加 App 前缀,用于和管理后台进行区分 | ||||||
|  |  */ | ||||||
|  | package cn.iocoder.yudao.module.crm.controller; | ||||||
| @@ -0,0 +1,6 @@ | |||||||
|  | /** | ||||||
|  |  * 提供 POJO 类的实体转换 | ||||||
|  |  * | ||||||
|  |  * 目前使用 MapStruct 框架 | ||||||
|  |  */ | ||||||
|  | package cn.iocoder.yudao.module.crm.convert; | ||||||
| @@ -0,0 +1 @@ | |||||||
|  | <http://www.iocoder.cn/Spring-Boot/MapStruct/?yudao> | ||||||
| @@ -0,0 +1,4 @@ | |||||||
|  | /** | ||||||
|  |  * 商机(销售机会) | ||||||
|  |  */ | ||||||
|  | package cn.iocoder.yudao.module.crm.dal.dataobject.business; | ||||||
| @@ -0,0 +1,4 @@ | |||||||
|  | /** | ||||||
|  |  * 线索 | ||||||
|  |  */ | ||||||
|  | package cn.iocoder.yudao.module.crm.dal.dataobject.clue; | ||||||
| @@ -0,0 +1,4 @@ | |||||||
|  | /** | ||||||
|  |  * 联系人 | ||||||
|  |  */ | ||||||
|  | package cn.iocoder.yudao.module.crm.dal.dataobject.contact; | ||||||
| @@ -0,0 +1,4 @@ | |||||||
|  | /** | ||||||
|  |  * 合同 | ||||||
|  |  */ | ||||||
|  | package cn.iocoder.yudao.module.crm.dal.dataobject.contract; | ||||||
| @@ -0,0 +1,4 @@ | |||||||
|  | /** | ||||||
|  |  * 客户 | ||||||
|  |  */ | ||||||
|  | package cn.iocoder.yudao.module.crm.dal.dataobject.customer; | ||||||
| @@ -0,0 +1,4 @@ | |||||||
|  | /** | ||||||
|  |  * 产品表 | ||||||
|  |  */ | ||||||
|  | package cn.iocoder.yudao.module.crm.dal.dataobject.product; | ||||||
| @@ -0,0 +1,4 @@ | |||||||
|  | /** | ||||||
|  |  * 回款 | ||||||
|  |  */ | ||||||
|  | package cn.iocoder.yudao.module.crm.dal.dataobject.receivable; | ||||||
| @@ -0,0 +1,4 @@ | |||||||
|  | /** | ||||||
|  |  * 商机(销售机会) | ||||||
|  |  */ | ||||||
|  | package cn.iocoder.yudao.module.crm.dal.mysql.business; | ||||||
| @@ -0,0 +1,4 @@ | |||||||
|  | /** | ||||||
|  |  * 线索 | ||||||
|  |  */ | ||||||
|  | package cn.iocoder.yudao.module.crm.dal.mysql.clue; | ||||||
| @@ -0,0 +1,4 @@ | |||||||
|  | /** | ||||||
|  |  * 联系人 | ||||||
|  |  */ | ||||||
|  | package cn.iocoder.yudao.module.crm.dal.mysql.contact; | ||||||
| @@ -0,0 +1,4 @@ | |||||||
|  | /** | ||||||
|  |  * 合同 | ||||||
|  |  */ | ||||||
|  | package cn.iocoder.yudao.module.crm.dal.mysql.contract; | ||||||
| @@ -0,0 +1,4 @@ | |||||||
|  | /** | ||||||
|  |  * 客户 | ||||||
|  |  */ | ||||||
|  | package cn.iocoder.yudao.module.crm.dal.mysql.customer; | ||||||
| @@ -0,0 +1,4 @@ | |||||||
|  | /** | ||||||
|  |  * 产品表 | ||||||
|  |  */ | ||||||
|  | package cn.iocoder.yudao.module.crm.dal.mysql.product; | ||||||
| @@ -0,0 +1,4 @@ | |||||||
|  | /** | ||||||
|  |  * 回款 | ||||||
|  |  */ | ||||||
|  | package cn.iocoder.yudao.module.crm.dal.mysql.receivable; | ||||||
| @@ -0,0 +1,6 @@ | |||||||
|  | /** | ||||||
|  |  * 属于 crm 模块的 framework 封装 | ||||||
|  |  * | ||||||
|  |  * @author 芋道源码 | ||||||
|  |  */ | ||||||
|  | package cn.iocoder.yudao.module.crm.framework; | ||||||
| @@ -0,0 +1,10 @@ | |||||||
|  | /** | ||||||
|  |  * crm 包下,客户关系管理(Customer Relationship Management)。 | ||||||
|  |  * 例如说:客户、联系人、商机、合同、回款等等 | ||||||
|  |  * | ||||||
|  |  * 1. Controller URL:以 /crm/ 开头,避免和其它 Module 冲突 | ||||||
|  |  * 2. DataObject 表名:以 crm_ 开头,方便在数据库中区分 | ||||||
|  |  * | ||||||
|  |  * 注意,由于 Crm 模块下,容易和其它模块重名,所以类名都加载 Crm 的前缀~ | ||||||
|  |  */ | ||||||
|  | package cn.iocoder.yudao.module.crm; | ||||||
| @@ -0,0 +1,4 @@ | |||||||
|  | /** | ||||||
|  |  * 商机(销售机会) | ||||||
|  |  */ | ||||||
|  | package cn.iocoder.yudao.module.crm.service.business; | ||||||
| @@ -0,0 +1,4 @@ | |||||||
|  | /** | ||||||
|  |  * 线索 | ||||||
|  |  */ | ||||||
|  | package cn.iocoder.yudao.module.crm.service.clue; | ||||||
| @@ -0,0 +1,4 @@ | |||||||
|  | /** | ||||||
|  |  * 联系人 | ||||||
|  |  */ | ||||||
|  | package cn.iocoder.yudao.module.crm.service.contact; | ||||||
| @@ -0,0 +1,4 @@ | |||||||
|  | /** | ||||||
|  |  * 合同 | ||||||
|  |  */ | ||||||
|  | package cn.iocoder.yudao.module.crm.service.contract; | ||||||
| @@ -0,0 +1,4 @@ | |||||||
|  | /** | ||||||
|  |  * 客户 | ||||||
|  |  */ | ||||||
|  | package cn.iocoder.yudao.module.crm.service.customer; | ||||||
| @@ -0,0 +1,4 @@ | |||||||
|  | /** | ||||||
|  |  * 产品表 | ||||||
|  |  */ | ||||||
|  | package cn.iocoder.yudao.module.crm.service.product; | ||||||
| @@ -0,0 +1,4 @@ | |||||||
|  | /** | ||||||
|  |  * 回款 | ||||||
|  |  */ | ||||||
|  | package cn.iocoder.yudao.module.crm.service.receivable; | ||||||
| @@ -91,6 +91,13 @@ | |||||||
| <!--            <version>${revision}</version>--> | <!--            <version>${revision}</version>--> | ||||||
| <!--        </dependency>--> | <!--        </dependency>--> | ||||||
|  |  | ||||||
|  |         <!-- CRM 相关模块。默认注释,保证编译速度 --> | ||||||
|  |         <dependency> | ||||||
|  |             <groupId>cn.iocoder.boot</groupId> | ||||||
|  |             <artifactId>yudao-module-crm-biz</artifactId> | ||||||
|  |             <version>${revision}</version> | ||||||
|  |         </dependency> | ||||||
|  |  | ||||||
|         <!-- spring boot 配置所需依赖 --> |         <!-- spring boot 配置所需依赖 --> | ||||||
|         <dependency> |         <dependency> | ||||||
|             <groupId>org.springframework.boot</groupId> |             <groupId>org.springframework.boot</groupId> | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 YunaiV
					YunaiV