补全后端基础相关模块
This commit is contained in:
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.cloud</groupId>
|
||||||
|
<artifactId>yudao</artifactId>
|
||||||
|
<version>${revision}</version>
|
||||||
|
</parent>
|
||||||
|
<modules>
|
||||||
|
<module>yudao-module-crm-api</module>
|
||||||
|
<module>yudao-module-crm-server</module>
|
||||||
|
</modules>
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<artifactId>yudao-module-crm</artifactId>
|
||||||
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
|
<name>${project.artifactId}</name>
|
||||||
|
<description>
|
||||||
|
crm 包下,客户关系管理(Customer Relationship Management)。
|
||||||
|
例如说:客户、联系人、商机、合同、回款等等
|
||||||
|
商业智能 BI 模块,包括:报表、图表、数据大屏等等
|
||||||
|
</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.cloud</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.cloud</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,23 @@
|
|||||||
|
package cn.iocoder.yudao.module.crm.enums;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.enums.RpcConstants;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* API 相关的枚举
|
||||||
|
*
|
||||||
|
* @author 芋道源码
|
||||||
|
*/
|
||||||
|
public class ApiConstants {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务名
|
||||||
|
*
|
||||||
|
* 注意,需要保证和 spring.application.name 保持一致
|
||||||
|
*/
|
||||||
|
public static final String NAME = "crm-server";
|
||||||
|
|
||||||
|
public static final String PREFIX = RpcConstants.RPC_API_PREFIX + "/crm";
|
||||||
|
|
||||||
|
public static final String VERSION = "1.0.0";
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package cn.iocoder.yudao.module.crm.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* CRM 字典类型的枚举类
|
||||||
|
*
|
||||||
|
* @author 芋道源码
|
||||||
|
*/
|
||||||
|
public interface DictTypeConstants {
|
||||||
|
|
||||||
|
String CRM_CUSTOMER_INDUSTRY = "crm_customer_industry"; // CRM 客户所属行业
|
||||||
|
String CRM_CUSTOMER_LEVEL = "crm_customer_level"; // CRM 客户等级
|
||||||
|
String CRM_CUSTOMER_SOURCE = "crm_customer_source"; // CRM 客户来源
|
||||||
|
String CRM_AUDIT_STATUS = "crm_audit_status"; // CRM 审批状态
|
||||||
|
String CRM_PRODUCT_UNIT = "crm_product_unit"; // CRM 产品单位
|
||||||
|
String CRM_PRODUCT_STATUS = "crm_product_status"; // CRM 产品状态
|
||||||
|
String CRM_FOLLOW_UP_TYPE = "crm_follow_up_type"; // CRM 跟进方式
|
||||||
|
String CRM_RECEIVABLE_RETURN_TYPE = "crm_receivable_return_type"; // CRM 回款方式
|
||||||
|
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,45 @@
|
|||||||
|
package cn.iocoder.yudao.module.crm.enums.business;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商机的结束状态枚举
|
||||||
|
*
|
||||||
|
* @author lzxhqs
|
||||||
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Getter
|
||||||
|
public enum CrmBusinessEndStatusEnum implements ArrayValuable<Integer> {
|
||||||
|
|
||||||
|
WIN(1, "赢单"),
|
||||||
|
LOSE(2, "输单"),
|
||||||
|
INVALID(3, "无效");
|
||||||
|
|
||||||
|
public static final Integer[] ARRAYS = Arrays.stream(values()).map(CrmBusinessEndStatusEnum::getStatus).toArray(Integer[]::new);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 场景类型
|
||||||
|
*/
|
||||||
|
private final Integer status;
|
||||||
|
/**
|
||||||
|
* 场景名称
|
||||||
|
*/
|
||||||
|
private final String name;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer[] array() {
|
||||||
|
return ARRAYS;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static CrmBusinessEndStatusEnum fromStatus(Integer status) {
|
||||||
|
return Arrays.stream(values())
|
||||||
|
.filter(value -> value.getStatus().equals(status))
|
||||||
|
.findFirst()
|
||||||
|
.orElse(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package cn.iocoder.yudao.module.crm.enums.common;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* CRM 的审批状态
|
||||||
|
*
|
||||||
|
* @author 赤焰
|
||||||
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Getter
|
||||||
|
public enum CrmAuditStatusEnum implements ArrayValuable<Integer> {
|
||||||
|
|
||||||
|
DRAFT(0, "未提交"),
|
||||||
|
PROCESS(10, "审批中"),
|
||||||
|
APPROVE(20, "审核通过"),
|
||||||
|
REJECT(30, "审核不通过"),
|
||||||
|
CANCEL(40, "已取消");
|
||||||
|
|
||||||
|
private final Integer status;
|
||||||
|
private final String name;
|
||||||
|
|
||||||
|
public static final Integer[] ARRAYS = Arrays.stream(values()).map(CrmAuditStatusEnum::getStatus).toArray(Integer[]::new);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer[] array() {
|
||||||
|
return ARRAYS;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
package cn.iocoder.yudao.module.crm.enums.common;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import cn.hutool.core.util.ObjUtil;
|
||||||
|
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* CRM 业务类型枚举
|
||||||
|
*
|
||||||
|
* @author HUIHUI
|
||||||
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Getter
|
||||||
|
public enum CrmBizTypeEnum implements ArrayValuable<Integer> {
|
||||||
|
|
||||||
|
CRM_CLUE(1, "线索"),
|
||||||
|
CRM_CUSTOMER(2, "客户"),
|
||||||
|
CRM_CONTACT(3, "联系人"),
|
||||||
|
CRM_BUSINESS(4, "商机"),
|
||||||
|
CRM_CONTRACT(5, "合同"),
|
||||||
|
CRM_PRODUCT(6, "产品"),
|
||||||
|
CRM_RECEIVABLE(7, "回款"),
|
||||||
|
CRM_RECEIVABLE_PLAN(8, "回款计划")
|
||||||
|
;
|
||||||
|
|
||||||
|
public static final Integer[] ARRAYS = Arrays.stream(values()).map(CrmBizTypeEnum::getType).toArray(Integer[]::new);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类型
|
||||||
|
*/
|
||||||
|
private final Integer type;
|
||||||
|
/**
|
||||||
|
* 名称
|
||||||
|
*/
|
||||||
|
private final String name;
|
||||||
|
|
||||||
|
public static String getNameByType(Integer type) {
|
||||||
|
CrmBizTypeEnum typeEnum = CollUtil.findOne(CollUtil.newArrayList(CrmBizTypeEnum.values()),
|
||||||
|
item -> ObjUtil.equal(item.type, type));
|
||||||
|
return typeEnum == null ? null : typeEnum.getName();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer[] array() {
|
||||||
|
return ARRAYS;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user