提交 5cb69223 authored 作者: ww1xhqc's avatar ww1xhqc

[数据模型] 修改了查询列名的逻辑

上级 c77a1008
...@@ -56,8 +56,7 @@ ...@@ -56,8 +56,7 @@
│ └─frame --核心逻辑所在位置 │ └─frame --核心逻辑所在位置
``` ```
## 使用方式 ## 使用方式
### 后端安装 ### 安装
#### maven #### maven
``` ```
<dependency> <dependency>
...@@ -70,7 +69,7 @@ ...@@ -70,7 +69,7 @@
1. 获取 workflow-core-0.0.1-SNAPSHOT.jar 1. 获取 workflow-core-0.0.1-SNAPSHOT.jar
2. 在你自己项目的根目录下创建lib文件夹 并将 jar 包放入 2. 在你自己项目的根目录下创建lib文件夹 并将 jar 包放入
3. pom 添加 如下 3. pom 添加 如下
``` ```
<dependency> <dependency>
<groupId>com.tykj</groupId> <groupId>com.tykj</groupId>
...@@ -80,11 +79,7 @@ ...@@ -80,11 +79,7 @@
<systemPath>${basedir}/lib/workflow-core-0.0.1-SNAPSHOT.jar</systemPath> <systemPath>${basedir}/lib/workflow-core-0.0.1-SNAPSHOT.jar</systemPath>
</dependency> </dependency>
``` ```
### 前端安装 ### 调用
```
npm install workflow-form
```
### 配置
1. 在springboot 启动类上添加注解 @EnableWorkFlowCore 1. 在springboot 启动类上添加注解 @EnableWorkFlowCore
``` ```
@EnableWorkFlowCore @EnableWorkFlowCore
...@@ -150,119 +145,5 @@ public class FlowUserServiceImpl implements UserService { ...@@ -150,119 +145,5 @@ public class FlowUserServiceImpl implements UserService {
} }
``` ```
### 使用
1. 工作流部分
1. 建立数据模型
![image-20210315130344008](images\image-20210315130344008.png)
2. 建立流程
![image-20210315131641756](images\image-20210315131641756.png)
3. 为节点配置页面
![image-20210315131723560](images\image-20210315131723560.png)
![image-20210315132632917](images\image-20210315132632917.png)
4. 配置节点的审核人
![image-20210315132126849](images\image-20210315132126849.png)
2. 宿主系统部分
1. 查询可发起流程
```
接口返回值示例
{
"message": "查询成功",
"data": {
"content": [
{
"id": 2,
"createdTime": "2021-03-15T03:00:48.028+00:00",
"updatedTime": "2021-03-15T03:10:33.009+00:00",
"deleted": 0,
"userId": null,
"userName": null,
"flowName": "测试1",
"resourceName": "processId_2850e08d-0e3d-4925-93f6-adce8a9e2246bpmn20.xml",
"flowKey": "processId_2850e08d-0e3d-4925-93f6-adce8a9e2246",
//前端组件需要使用该数据
"state": 0,
"filePath": "\\xml\\processId_2850e08d-0e3d-4925-93f6-adce8a9e2246bpmn20.xml",
"flowDescribe": "测试2",
"startId": null,
"startPageId": 1, //前端组件需要使用该数据
"processInstanceId": null,
"deployId": "a4c408b0-853a-11eb-81c9-d2c637ad090d"
},
{
"id": 3,
"createdTime": "2021-03-15T03:17:30.914+00:00",
"updatedTime": "2021-03-15T03:17:31.850+00:00",
"deleted": 0,
"userId": null,
"userName": null,
"flowName": "测试流程1",
"resourceName": "processId_560c6b5c-8be5-40b8-852f-8e174346e9c8bpmn20.xml",
"flowKey": "processId_560c6b5c-8be5-40b8-852f-8e174346e9c8",
"state": 0,
"filePath": "\\xml\\processId_560c6b5c-8be5-40b8-852f-8e174346e9c8bpmn20.xml",
"flowDescribe": "测试流程描述1",
"startId": null,
"startPageId": null,
"processInstanceId": null,
"deployId": "fa83de4c-853c-11eb-81c9-d2c637ad090d"
}
],
"pageable": {
"sort": {
"sorted": false,
"unsorted": true,
"empty": true
},
"offset": 0,
"pageSize": 15,
"pageNumber": 0,
"paged": true,
"unpaged": false
},
"totalElements": 2,
"last": true,
"totalPages": 1,
"number": 0,
"size": 15,
"sort": {
"sorted": false,
"unsorted": true,
"empty": true
},
"numberOfElements": 2,
"first": true,
"empty": false
}
}
```
2. 渲染页面
```
fromUtil.creatFrom(pageId,flowKey)
```
(渲染出来的表单页面中的逻辑由工作流控制,用户完成表单所有操作后页面会自动关闭)
3. 模拟效果
![image-20210315132852126](images\image-20210315132852126.png)
![image-20210315132859363](images\image-20210315132859363.png)
...@@ -4,6 +4,7 @@ package com.tykj.workflowcore.model_layer.controller; ...@@ -4,6 +4,7 @@ package com.tykj.workflowcore.model_layer.controller;
import com.tykj.workflowcore.base.result.ResultUtil; import com.tykj.workflowcore.base.result.ResultUtil;
import com.tykj.workflowcore.model_layer.entity.vo.QueryCondition; import com.tykj.workflowcore.model_layer.entity.vo.QueryCondition;
import com.tykj.workflowcore.model_layer.entity.vo.SearchColumnInfoVo;
import com.tykj.workflowcore.model_layer.entity.vo.SearchTableInfoVo; import com.tykj.workflowcore.model_layer.entity.vo.SearchTableInfoVo;
import com.tykj.workflowcore.model_layer.entity.TableInfo; import com.tykj.workflowcore.model_layer.entity.TableInfo;
import com.tykj.workflowcore.model_layer.entity.vo.TableVO; import com.tykj.workflowcore.model_layer.entity.vo.TableVO;
...@@ -65,11 +66,9 @@ public class ModelController { ...@@ -65,11 +66,9 @@ public class ModelController {
**/ **/
@ApiOperation("根据表名获查询所有字段") @ApiOperation("根据表名获查询所有字段")
@GetMapping("/getAllField") @GetMapping("/getAllField")
public ResponseEntity getFields(String tableName) { public ResponseEntity getFields(SearchColumnInfoVo searchColumnInfoVo) {
if (tableName != null && tableName != "") {
return ResultUtil.failed("表名不存在"); return ResultUtil.success(modelService.showModelFields(searchColumnInfoVo), "");
}
return ResultUtil.success(modelService.showModelFields(tableName), "");
} }
/** /**
......
package com.tykj.workflowcore.model_layer.entity.vo;/** package com.tykj.workflowcore.model_layer.entity.vo;
*@ClassName SearchColumnInfoVo
*@Description TODO import com.tykj.workflowcore.base.page.JpaCustomPage;
*@Author WWW import lombok.AllArgsConstructor;
*@Date 2021/3/15 14:46 import lombok.Data;
*@Version 1.0 import lombok.NoArgsConstructor;
*/public class SearchColumnInfoVo {
/**
* @ClassName SearchColumnInfoVo
* @Description TODO
* @Author WWW
* @Date 2021/3/15 14:46
* @Version 1.0
*/
@AllArgsConstructor
@NoArgsConstructor
@Data
public class SearchColumnInfoVo extends JpaCustomPage {
private Integer id;
private String dbName;
} }
package com.tykj.workflowcore.model_layer.service; package com.tykj.workflowcore.model_layer.service;
import com.tykj.workflowcore.model_layer.entity.*; import com.tykj.workflowcore.model_layer.entity.ColumnInfo;
import com.tykj.workflowcore.model_layer.entity.TableInfo;
import com.tykj.workflowcore.model_layer.entity.vo.QueryCondition; import com.tykj.workflowcore.model_layer.entity.vo.QueryCondition;
import com.tykj.workflowcore.model_layer.entity.vo.SearchColumnInfoVo;
import com.tykj.workflowcore.model_layer.entity.vo.SearchTableInfoVo; import com.tykj.workflowcore.model_layer.entity.vo.SearchTableInfoVo;
import com.tykj.workflowcore.model_layer.entity.vo.TableVO; import com.tykj.workflowcore.model_layer.entity.vo.TableVO;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
...@@ -44,7 +46,7 @@ public interface ModelService { ...@@ -44,7 +46,7 @@ public interface ModelService {
* @param modelName * @param modelName
* @return * @return
*/ */
List<ColumnInfo> showModelFields(String modelName); List<ColumnInfo> showModelFields(SearchColumnInfoVo searchColumnInfoVo);
/** /**
......
package com.tykj.workflowcore.model_layer.utils; package com.tykj.workflowcore.model_layer.utils;
import com.tykj.workflowcore.model_layer.model.ColumnInfo;
import com.tykj.workflowcore.model_layer.entity.ColumnInfo;
/** /**
* @ClassName ClassTypeLength * @ClassName ClassTypeLength
...@@ -14,7 +15,7 @@ public class ClassTypeLength { ...@@ -14,7 +15,7 @@ public class ClassTypeLength {
private static String Integer="class java.lang.Integer"; private static String Integer="class java.lang.Integer";
private static String Double="class java.lang.Double"; private static String Double="class java.lang.Double";
public static void setLength(ColumnInfo columnInfo ,java.lang.reflect.Type genericType){ public static void setLength(ColumnInfo columnInfo , java.lang.reflect.Type genericType){
if (STRING.equals(genericType.toString())){ if (STRING.equals(genericType.toString())){
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论