Skip to content

Commit

Permalink
✨ 增加 ERP 模块
Browse files Browse the repository at this point in the history
  • Loading branch information
YunaiV committed Feb 17, 2024
1 parent f71a3b7 commit 5f53986
Show file tree
Hide file tree
Showing 233 changed files with 19,094 additions and 28 deletions.
3 changes: 2 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@
<module>yudao-module-report</module>
<module>yudao-module-mp</module>
<module>yudao-module-mall</module>
<module>yudao-module-erp</module>
</modules>

<name>${project.artifactId}</name>
<description>芋道项目基础脚手架</description>
<url>https://github.com/YunaiV/ruoyi-vue-pro</url>

<properties>
<revision>2.0.0-snapshot</revision>
<revision>2.0.1-snapshot</revision>
<!-- Maven 相关 -->
<java.version>21</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
Expand Down
2 changes: 1 addition & 1 deletion yudao-dependencies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<url>https://github.com/YunaiV/ruoyi-vue-pro</url>

<properties>
<revision>2.0.0-snapshot</revision>
<revision>2.0.1-snapshot</revision>
<flatten-maven-plugin.version>1.5.0</flatten-maven-plugin.version>
<!-- 统一依赖管理 -->
<spring.boot.version>3.2.1</spring.boot.version>
Expand Down
12 changes: 8 additions & 4 deletions yudao-gateway/src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,13 @@ spring:
- Path=/admin-api/statistics/**
filters:
- RewritePath=/admin-api/statistics/v3/api-docs, /v3/api-docs # 配置,保证转发到 /v3/api-docs
- id: statistics-app-api # 路由的编号
uri: grayLb://statistics-server
## erp-server 服务
- id: erp-admin-api # 路由的编号
uri: grayLb://erp-server
predicates: # 断言,作为路由的匹配条件,对应 RouteDefinition 数组
- Path=/app-api/statistics/**
- Path=/admin-api/erp/**
filters:
- RewritePath=/app-api/statistics/v3/api-docs, /v3/api-docs
- RewritePath=/admin-api/erp/v3/api-docs, /v3/api-docs # 配置,保证转发到 /v3/api-docs
x-forwarded:
prefix-enabled: false # 避免 Swagger 重复带上额外的 /admin-api/system 前缀

Expand Down Expand Up @@ -182,6 +183,9 @@ knife4j:
- name: statistics-server
service-name: statistics-server
url: /admin-api/statistics/v3/api-docs
- name: erp-server
service-name: erp-server
url: /admin-api/erp/v3/api-docs

--- #################### 芋道相关配置 ####################

Expand Down
24 changes: 24 additions & 0 deletions yudao-module-erp/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?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-erp-api</module>
<module>yudao-module-erp-biz</module>
</modules>
<modelVersion>4.0.0</modelVersion>
<artifactId>yudao-module-erp</artifactId>
<packaging>pom</packaging>

<name>${project.artifactId}</name>
<description>
erp 包下,企业资源管理(Enterprise Resource Planning)。
例如说:采购、销售、库存、财务、产品等等
</description>

</project>
33 changes: 33 additions & 0 deletions yudao-module-erp/yudao-module-erp-api/pom.xml
Original file line number Diff line number Diff line change
@@ -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-erp</artifactId>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>yudao-module-erp-api</artifactId>
<packaging>jar</packaging>

<name>${project.artifactId}</name>
<description>
erp 模块 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>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/**
* erp API 包,定义暴露给其它模块的 API
*/
package cn.iocoder.yudao.module.erp.api;
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package cn.iocoder.yudao.module.erp.enums;

import cn.iocoder.yudao.framework.common.enums.RpcConstants;

/**
* API 相关的枚举
*
* @author 芋道源码
*/
public class ApiConstants {

/**
* 服务名
*
* 注意,需要保证和 spring.application.name 保持一致
*/
public static final String NAME = "erp-server";

public static final String PREFIX = RpcConstants.RPC_API_PREFIX + "/erp";

public static final String VERSION = "1.0.0";

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package cn.iocoder.yudao.module.erp.enums;

/**
* ERP 字典类型的枚举类
*
* @author 芋道源码
*/
public interface DictTypeConstants {

String AUDIT_STATUS = "erp_audit_status"; // 审核状态
String STOCK_RECORD_BIZ_TYPE = "erp_stock_record_biz_type"; // 库存明细的业务类型

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package cn.iocoder.yudao.module.erp.enums;

import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

import java.util.Arrays;

/**
* ERP 审核状态枚举
*
* TODO 芋艿:目前只有待审批、已审批两个状态,未来接入工作流后,会丰富下:待提交(草稿)=》已提交(待审核)=》审核通过、审核不通过;另外,工作流需要支持“反审核”,把工作流退回到原点;
*
* @author 芋道源码
*/
@RequiredArgsConstructor
@Getter
public enum ErpAuditStatus implements IntArrayValuable {

PROCESS(10, "未审核"), // 审核中
APPROVE(20, "已审核"); // 审核通过

public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(ErpAuditStatus::getStatus).toArray();

/**
* 状态
*/
private final Integer status;
/**
* 状态名
*/
private final String name;

@Override
public int[] array() {
return ARRAYS;
}

}
Loading

0 comments on commit 5f53986

Please sign in to comment.