上传文件至「/」

init smt erp project
This commit is contained in:
2026-10-13 11:59:58 +04:00
commit 27eaa65c46
5 changed files with 624 additions and 0 deletions

201
LICENSE Normal file
View File

@@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

193
README.md Normal file
View File

@@ -0,0 +1,193 @@
# SMT-ERP
SMT-ERP 是面向瑞银电子马来西亚(SMT)分公司的私有化 ERP 系统,服务于吉隆坡分公司的进销存、生产、财务和内部管理场景。
项目以 SMT 为首个落地试点,面向人员规模不超过 100 人的海外分公司建设,后续可复制到其他海外分公司。系统部署在 SMT 本地机房,核心业务数据由企业自主掌控。
## 项目目标
围绕“总部生产完成 → 调拨至 SMT → SMT 包装/组装 → 交付客户 → 收款”的业务链路,建立从订单、调拨、库存、生产到财务的闭环管理,解决库存依赖 Excel、审批依赖线下纸质流程以及业务账与财务账不一致等问题。
系统重点支持:
- TNB(马来西亚国家电力公司)订单及二级市场订单管理
- 总部调拨、SMT 本地包材采购和到货管理
- 包装 BOM、生产工单、领料、报工和完工入库
- 批次(LOT NO)与电表序列号(S/N From - S/N To)全流程追溯
- 销售出库、客户签收、应收应付、成本核算和财务报表
- 钉钉国际版审批集成,以及 SMT 与 Reallin 的数据互通
## 当前项目结构
```text
SMT_ERP/
├── smtERP-boot/ # Java 后端服务
│ ├── src/main/java/ # 控制器、业务逻辑、数据访问和系统配置
│ ├── src/main/resources/
│ │ ├── application.yml
│ │ └── mapper_xml/ # MyBatis XML 映射
│ └── docs/ # 初始化及数据库升级脚本
├── smtERP-web/ # Web 前端
│ ├── src/api/ # 后端接口封装
│ ├── src/views/ # 业务页面
│ └── src/components/ # 通用组件
├── LICENSE
└── README.md
```
## 技术架构
| 层级 | 当前实现 |
|---|---|
| 前端 | Vue 2.7.16、Vue Router 3、Vuex 3、Ant Design Vue 1.5.2、Axios |
| 后端 | Java 11、Spring Boot 2.0.0.RELEASE、Maven |
| 持久层 | MyBatis-Plus 3.0.7.1、MyBatis XML Mapper |
| 数据库 | MySQL 8.0.33 驱动,默认数据库名 `jsh_erp` |
| 缓存 | Redis |
| 接口文档 | Springfox Swagger 2.7.0、Swagger Bootstrap UI |
| 部署 | SMT 本地机房私有化部署,可运行于 Windows 或 Linux |
> 需求文档规划的 Vue 3 属于后续技术演进方向;当前仓库前端仍以 Vue 2.7.16 为准。后端编译版本以 `smtERP-boot/pom.xml` 中的 `<java.version>11</java.version>` 为准。
## 业务规划
### 第一阶段:核心业务闭环
1. 销售管理:客户、报价、TNB/二级市场订单、交货计划、发货、签收、销售对账。
2. 采购管理:总部调拨申请与接收、本地包材采购、供应商、采购入库和对账。
3. 生产管理:包装 BOM、包装工单、领料、生产报工、质检、完工入库和生产进度。
4. 仓储管理:多仓库、入库、出库、批次、序列号、库存账、库存预警、盘点和库存规划。
5. 审批与数据互通:接入钉钉国际版审批,并规划 SMT 与 Reallin 的业务数据同步。
### 第二阶段:内部信息化管理
将当前线下 Excel 管理内容逐步搬到线上,覆盖考勤、请假、培训、资产、费用及其他内部管理事项。
### 财务与合规重点
- 以人民币作为主要结算币种,同时支持本地采购使用 MYR(马来西亚林吉特)记录。
- 财务年度为每年 3 月 1 日至次年 3 月 31 日。
- 支持应收、应付、总账、费用、成本、发票和资产负债表/利润表等报表。
- 财务核算遵循马来西亚当地业务要求,预留 MFRS、SST 及电子发票相关能力。
- 发票录入需满足清关及货运文件齐全等前置条件,并支持跨期入账和电子发票提交时间窗口控制。
## 开发环境
- JDK 11
- Maven 3.6+(以本机 Maven 版本为准)
- Node.js 及 npm/yarn
- MySQL 8.0+
- Redis 6.x+
- IntelliJ IDEA 或其他 Java IDE
## 本地运行
### 1. 初始化数据库
创建 MySQL 数据库后,执行:
```text
smtERP-boot/docs/jsh_erp.sql
```
后续升级脚本按版本和实际需求执行,数据库升级记录见 `smtERP-boot/docs/`。
### 2. 配置后端
编辑 `smtERP-boot/src/main/resources/application.yml`,至少确认以下配置:
- MySQL 地址、数据库名、用户名和密码
- Redis 地址、端口和密码
- 文件上传目录及目录权限
- 服务端口和上下文路径
请勿在生产环境直接使用仓库中的示例密码,并避免将真实密码提交到 Git。
### 3. 启动后端
```bash
cd smtERP-boot
mvn spring-boot:run
```
后端默认地址:`http://localhost:27210/jshERP-boot`
### 4. 启动前端
```bash
cd smtERP-web
npm install
npm run serve
```
前端开发地址:`http://localhost:27200`。开发服务器会将 `/jshERP-boot` 请求代理到 `http://localhost:27210`。
### SMT 其他入库同步
外部平台可调用 `POST /jshERP-boot/smtInbound/sync`,请求头为
`Content-Type: application/json`,请求体示例:
```json
[
{
"docNo": "SM2503070001",
"businessDate": "2025-03-07 00:00:00.000",
"materialCode": "C.4.T.0.00562",
"materialName": "MD-4GVIII(VB)",
"specification": "MD-4GVIII(VB)",
"qtyPriceAmount": 50,
"finallyPrice": "324",
"totalNetMoney": "14336.280000000",
"totalMoney": "16200.000000000",
"sourceDocNo": "SH2503070002"
}
]
```
接口按 `docNo` 去重:未审核单据会被整单覆盖,已审核单据会跳过,并在
`auditedDocNos` 中返回冲突单号。Excel 导入使用同一规则。其他入库审核通过时,
系统以 `materialCode` 作为 ERP 条码创建或更新商品,并将库存写入“成品仓库”。
### 5. 构建
```bash
cd smtERP-web
npm run build
cd ../smtERP-boot
mvn clean package
```
构建生成的 `target/`、`dist/`、压缩包、`node_modules/` 和运行日志不会纳入版本库。
## 部署说明
系统采用 SMT 本地机房部署模式,建议由 SMT 开发与 IT 人员共同负责部署和日常维护,总部系统信息部提供架构、集成和技术支持。
生产部署至少应完成:
1. 准备 Java 11 运行环境、MySQL、Redis 和 Web 服务器/反向代理。
2. 初始化数据库并按发布版本执行升级脚本。
3. 使用生产数据库、Redis、文件目录和外部接口配置替换示例配置。
4. 配置前端静态文件、后端服务、反向代理、备份和日志轮转。
5. 上线前验证登录、权限、库存、单据、审批回调和数据同步链路。
## 组织与协作
SMT 当前组织包括财务部、市场部、技术部、生产部和行政部门,系统权限设计需结合部门、岗位、仓库和数据范围进行隔离。
- SMT 项目管理:Hafiz
- SMT 开发、需求收集和日常运维:Aziman
- SMT 机房、网络和部署支持:Haslim
- 总部架构、核心模块、钉钉国际版集成和技术支持:总部系统信息部
- 需求提交渠道:Reallin 售后服务平台
## 版本与状态
当前仓库是 SMT-ERP 的开发基线,已包含现有进销存、财务、生产、报表、系统管理等基础代码。需求文档中的钉钉国际版审批、SMT 与 Reallin 数据互通、完整序列号追溯及第二阶段内部信息化能力,按项目迭代计划逐步建设。
需求依据:SMT(马来西亚)ERP 系统需求文档 v1.7(2026-08-21)。
## 许可证
本项目遵循 Apache License 2.0,详见 [LICENSE](LICENSE)。

6
babel.config.js Normal file
View File

@@ -0,0 +1,6 @@
module.exports = {
presets: [
['@vue/app',
{ useBuiltIns: 'entry' }]
]
}

5
changeLog.md Normal file
View File

@@ -0,0 +1,5 @@
# 变更日志
## Release Version: 1.0.0 (2026-07-18)
## Change detail:
1. SMT-ERP project int

219
pom.xml Normal file
View File

@@ -0,0 +1,219 @@
<?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">
<modelVersion>4.0.0</modelVersion>
<groupId>com.reallin</groupId>
<artifactId>smt-erp</artifactId>
<version>1.0.0</version>
<description>smt-erp</description>
<name>smt-erp</name>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.0.RELEASE</version>
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>11</java.version>
<mockito.version>2.28.2</mockito.version>
<byte-buddy.version>1.9.10</byte-buddy.version>
</properties>
<dependencies>
<dependency>
<groupId>com.gitee.starblues</groupId>
<artifactId>springboot-plugin-framework</artifactId>
<version>2.2.1-RELEASE</version>
</dependency>
<dependency>
<groupId>com.gitee.starblues</groupId>
<artifactId>springboot-plugin-framework-extension-mybatis</artifactId>
<version>2.2.1-RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.83</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.33</version>
</dependency>
<!--http-->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.2</version>
</dependency>
<dependency>
<groupId>net.sourceforge.jexcelapi</groupId>
<artifactId>jxl</artifactId>
<version>2.6.12</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>4.1.2</version>
</dependency>
<!-- lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.12</version>
</dependency>
<!-- 日志 -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-to-slf4j</artifactId>
<version>2.15.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jul-to-slf4j</artifactId>
<version>1.7.25</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>3.0.7.1</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-redis</artifactId>
<version>1.4.1.RELEASE</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.7.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>swagger-bootstrap-ui</artifactId>
<version>1.6</version>
</dependency>
<dependency>
<groupId>com.aliyun.oss</groupId>
<artifactId>aliyun-sdk-oss</artifactId>
<version>3.10.1</version>
</dependency>
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>itextpdf</artifactId>
<version>5.5.13.1</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-io</artifactId>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>com.belerweb</groupId>
<artifactId>pinyin4j</artifactId>
<version>2.5.1</version>
</dependency>
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>1.2.13</version>
</dependency>
<dependency>
<groupId>com.sun.mail</groupId>
<artifactId>javax.mail</artifactId>
<version>1.6.2</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.5.4</version>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.0.3.RELEASE</version>
<executions>
<execution>
<id>build-info</id>
<phase>generate-sources</phase>
<goals>
<goal>build-info</goal>
</goals>
</execution>
<execution>
<id>repackage</id>
<phase>package</phase>
<goals>
<goal>repackage</goal>
</goals>
<configuration>
<mainClass>com.reallin.smt.ErpApplication</mainClass>
<layout>JAR</layout>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.5.1</version>
<executions>
<execution>
<id>make-zip</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>src/main/assembly/assembly.xml</descriptor>
</descriptors>
<outputDirectory>./dist</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-maven-plugin</artifactId>
<version>1.4.0</version>
<configuration>
<configurationFile>${basedir}/src/test/resources/generatorConfig.xml</configurationFile>
<verbose>true</verbose>
<overwrite>true</overwrite>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<release>11</release>
</configuration>
</plugin>
</plugins>
</build>
</project>