This commit is contained in:
yubaolee
2024-06-19 20:32:29 +08:00
19 changed files with 239 additions and 110 deletions

View File

@@ -39,11 +39,18 @@ CodeSmith Generator Studio 8.0或以上
如下图使用CodeSmith文件夹中的模板右击【ApiGenerate.cst】--【Execute】选择需要生成的表本文以Stock为例及相关的上下文命名空间点击【Generate】
![](http://pj.openauth.net.cn/zentao/file-read-26.jpg)
![20240613220037](http://img.openauth.net.cn/20240613220037.png)
注意,有两个配置项:
* WholeDb: 如果选中,则按数据库中所有表生成实体及逻辑;否则,按选择的表生成
* HeaderModel会生成主、从表结构类似 WmsInboundOrderTbl / WmsInboundOrderDtbl
生成成功后在CodeSmith/Csharp文件夹下面会有Stock实体相关文档如下图
![](http://pj.openauth.net.cn/zentao/file-read-53.png)
![20240613220224](http://img.openauth.net.cn/20240613220224.png)
把CSharp\OpenAuth.App覆盖到自己项目对应目录
@@ -51,7 +58,6 @@ CodeSmith Generator Studio 8.0或以上
**把CSharp\OpenAuth.Repository\OpenAuthDBContext.cs中的内容添加到自己项目的文件中千万不要直接覆盖文件**
**其他文件夹的内容为WebAPI项目使用可以不管。**
## 添加界面
@@ -69,7 +75,15 @@ userJs直接覆盖到OpenAuth.Mvc/wwwroot中
## 添加模块
编写完上面代码后运行系统使用System账号登录系统在【模块管理】中添加`仓储管理`模块,并为它添加菜单这里我只添加一个菜单【btnAdd】如下图
编写完上面代码后运行系统使用System账号登录系统在【模块管理】中添加`仓储管理`模块,
![20240613220434](http://img.openauth.net.cn/20240613220434.png)
::: warning 注意
因为生成的Controller名称类似XXXsController所以模块的Url地址应该是XXXs/Index
:::
并为它添加菜单这里我只添加一个菜单【btnAdd】如下图
![](http://pj.openauth.net.cn/zentao/file-read-51.png)

View File

@@ -10,9 +10,13 @@ OpenAuth.Pro是一套全新的前端界面基于vue-element-admin采用VUE
## OpenAuth.Net系列教学视频
[OpenAuth.Net教学合集--系统结构及代码下载](https://www.bilibili.com/video/BV1Z1421q7xU/)
[OpenAuth.Net视频合集--系统结构及代码下载](https://www.bilibili.com/video/BV1Z1421q7xU/)
[OpenAuth.Net教学合集--企业版代码启动](https://www.bilibili.com/video/BV1KSuQebEek/)
[OpenAuth.Net视频合集--企业版代码启动](https://www.bilibili.com/video/BV1KSuQebEek/)
[OpenAuth.Net视频合集--使用企业版代码生成器](https://www.bilibili.com/video/BV1JCuyeaEFp/)
[OpenAuth.Net视频合集--权限管理介绍](https://www.bilibili.com/video/BV1M9KeejENf/)
## 工具准备

View File

@@ -1,5 +1,7 @@
# 企业版代码生成器
本章节视频讲解请参考:[OpenAuth.Net视频合集--使用企业版代码生成器](https://www.bilibili.com/video/BV1JCuyeaEFp/)
## 术语解释
在添加新功能之前需要先了解OpenAuth.Net生成代码时的两个概念动态头部和固定头部
@@ -49,17 +51,21 @@ initCfg() {
-- mysql示例
create table stock
(
createtime datetime not null comment '操作时间',
status int not null comment '出库/入库',
price decimal(10, 1) not null comment '产品单价',
number int not null comment '产品数量',
name text not null comment '产品名称',
orgid varchar(50) null comment '组织ID',
user varchar(50) not null comment '操作人',
viewable varchar(50) not null comment '可见范围',
id varchar(50) not null comment '数据ID'
primary key
Id varchar(50) not null comment '数据ID'
primary key,
Name text not null comment '产品名称',
Number int not null comment '产品数量',
Price decimal(10, 1) not null comment '产品单价',
Status int not null comment '出库/入库',
Viewable varchar(50) not null comment '可见范围',
User varchar(50) not null comment '操作人',
Time datetime not null comment '操作时间',
OrgId varchar(50) null comment '组织ID'
)
comment '出入库信息表' charset = utf8
row_format = COMPACT;
```