commit 27eaa65c46af8de678d4b04ed6b88ae65e4f515c Author: yuanh Date: Tue Oct 13 11:59:58 2026 +0400 上传文件至「/」 init smt erp project diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..261eeb9 --- /dev/null +++ b/LICENSE @@ -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. diff --git a/README.md b/README.md new file mode 100644 index 0000000..4937d51 --- /dev/null +++ b/README.md @@ -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` 中的 `11` 为准。 + +## 业务规划 + +### 第一阶段:核心业务闭环 + +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)。 diff --git a/babel.config.js b/babel.config.js new file mode 100644 index 0000000..f05294d --- /dev/null +++ b/babel.config.js @@ -0,0 +1,6 @@ +module.exports = { + presets: [ + ['@vue/app', + { useBuiltIns: 'entry' }] + ] +} diff --git a/changeLog.md b/changeLog.md new file mode 100644 index 0000000..a3fe125 --- /dev/null +++ b/changeLog.md @@ -0,0 +1,5 @@ +# 变更日志 + +## Release Version: 1.0.0 (2026-07-18) +## Change detail: +1. SMT-ERP project int \ No newline at end of file diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..e444164 --- /dev/null +++ b/pom.xml @@ -0,0 +1,219 @@ + + + 4.0.0 + com.reallin + smt-erp + 1.0.0 + smt-erp + smt-erp + + + org.springframework.boot + spring-boot-starter-parent + 2.0.0.RELEASE + + + + UTF-8 + UTF-8 + 11 + 2.28.2 + 1.9.10 + + + + + com.gitee.starblues + springboot-plugin-framework + 2.2.1-RELEASE + + + com.gitee.starblues + springboot-plugin-framework-extension-mybatis + 2.2.1-RELEASE + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-aop + + + org.springframework.boot + spring-boot-starter-test + test + + + com.alibaba + fastjson + 1.2.83 + + + mysql + mysql-connector-java + 8.0.33 + + + + org.apache.httpcomponents + httpclient + 4.5.2 + + + net.sourceforge.jexcelapi + jxl + 2.6.12 + + + org.apache.poi + poi-ooxml + 4.1.2 + + + + org.projectlombok + lombok + 1.18.12 + + + + org.apache.logging.log4j + log4j-to-slf4j + 2.15.0 + compile + + + org.slf4j + jul-to-slf4j + 1.7.25 + compile + + + com.baomidou + mybatis-plus-boot-starter + 3.0.7.1 + + + org.springframework.boot + spring-boot-starter-redis + 1.4.1.RELEASE + + + io.springfox + springfox-swagger2 + 2.7.0 + compile + + + com.github.xiaoymin + swagger-bootstrap-ui + 1.6 + + + com.aliyun.oss + aliyun-sdk-oss + 3.10.1 + + + com.itextpdf + itextpdf + 5.5.13.1 + + + org.apache.commons + commons-io + 1.3.2 + + + com.belerweb + pinyin4j + 2.5.1 + + + com.github.pagehelper + pagehelper-spring-boot-starter + 1.2.13 + + + com.sun.mail + javax.mail + 1.6.2 + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.5.4 + + + org.springframework.boot + spring-boot-maven-plugin + 2.0.3.RELEASE + + + build-info + generate-sources + + build-info + + + + repackage + package + + repackage + + + com.reallin.smt.ErpApplication + JAR + + + + + + org.apache.maven.plugins + maven-assembly-plugin + 2.5.1 + + + make-zip + package + + single + + + + src/main/assembly/assembly.xml + + ./dist + + + + + + org.mybatis.generator + mybatis-generator-maven-plugin + 1.4.0 + + ${basedir}/src/test/resources/generatorConfig.xml + true + true + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.7.0 + + 11 + + + + +