Compare commits
10 Commits
140a7fb66f
...
564c83b265
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
564c83b265 | ||
|
|
e1db57d541 | ||
|
|
8242e1348e | ||
|
|
194208a58b | ||
|
|
a86ddbf2c3 | ||
|
|
3de2294ead | ||
|
|
912944c0b2 | ||
|
|
fcffc37602 | ||
|
|
43effcdbe9 | ||
|
|
1d294464a7 |
11
.dockerignore
Normal file
11
.dockerignore
Normal file
@@ -0,0 +1,11 @@
|
||||
**/target/
|
||||
**/node_modules/
|
||||
**/.git
|
||||
**/.idea
|
||||
**/.vscode
|
||||
**/*.iml
|
||||
**/dist/
|
||||
**/.DS_Store
|
||||
**/logs/
|
||||
docker-compose.yml
|
||||
.env
|
||||
18
.env.example
Normal file
18
.env.example
Normal file
@@ -0,0 +1,18 @@
|
||||
# WCS-RuoYi Docker <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE>
|
||||
# <20><><EFBFBD>ƴ<EFBFBD><C6B4>ļ<EFBFBD>Ϊ .env <20><><EFBFBD><EFBFBD>Ϊʵ<CEAA><CAB5>ֵ
|
||||
|
||||
# MySQL
|
||||
MYSQL_DATABASE=ry-vue
|
||||
MYSQL_ROOT_PASSWORD=change_me_root
|
||||
MYSQL_USER=ruoyi
|
||||
MYSQL_PASSWORD=change_me
|
||||
MYSQL_PORT=3306
|
||||
|
||||
# Redis
|
||||
REDIS_PORT=6379
|
||||
|
||||
# <20><><EFBFBD>˷<EFBFBD><CBB7><EFBFBD>
|
||||
SERVER_PORT=8080
|
||||
|
||||
# ǰ<><C7B0>
|
||||
UI_PORT=80
|
||||
19
Dockerfile
Normal file
19
Dockerfile
Normal file
@@ -0,0 +1,19 @@
|
||||
FROM maven:3.8-openjdk-8 AS build
|
||||
WORKDIR /app
|
||||
COPY pom.xml .
|
||||
COPY ruoyi-admin/pom.xml ruoyi-admin/pom.xml
|
||||
COPY ruoyi-common/pom.xml ruoyi-common/pom.xml
|
||||
COPY ruoyi-framework/pom.xml ruoyi-framework/pom.xml
|
||||
COPY ruoyi-generator/pom.xml ruoyi-generator/pom.xml
|
||||
COPY ruoyi-quartz/pom.xml ruoyi-quartz/pom.xml
|
||||
COPY ruoyi-system/pom.xml ruoyi-system/pom.xml
|
||||
RUN mvn dependency:go-offline -B || true
|
||||
COPY . .
|
||||
RUN mvn package -DskipTests -q
|
||||
|
||||
FROM openjdk:8-jre-slim
|
||||
WORKDIR /app
|
||||
COPY --from=build /app/ruoyi-admin/target/ruoyi-admin.jar app.jar
|
||||
EXPOSE 8080
|
||||
ENV JAVA_OPTS="-Xms256m -Xmx512m"
|
||||
ENTRYPOINT ["sh", "-c", "java ${JAVA_OPTS} -jar app.jar"]
|
||||
41
README.md
41
README.md
@@ -13,15 +13,37 @@
|
||||
|
||||
若依是一套全部开源的快速开发平台,毫无保留给个人及企业免费使用。
|
||||
|
||||
* 本仓库为RuoYi-Vue的Spring Boot 2 的版本,保持同步更新。
|
||||
* 前端采用Vue、Element UI。
|
||||
* 后端采用Spring Boot、Spring Security、Redis & Jwt。
|
||||
* 权限认证使用Jwt,支持多终端认证系统。
|
||||
* 支持加载动态权限菜单,多方式轻松权限控制。
|
||||
* 高效率开发,使用代码生成器可以一键生成前后端代码。
|
||||
* 提供了技术栈(Vue3 Element Plus Vite)的 [RuoYi-Vue3](https://gitcode.com/yangzongzhuan/RuoYi-Vue3)版本,以及技术栈(TypeScript)的 [RuoYi-Vue3-TypeScript](https://gitcode.com/yangzongzhuan/RuoYi-Vue3/tree/typescript)版本,两者保持同步更新。
|
||||
* 提供了适配 Spring Boot 3 的版本分支 [RuoYi-Vue (springboot3)](https://gitee.com/y_project/RuoYi-Vue/tree/springboot3),以及特定需求的 单应用版本 [RuoYi-Vue-fast](https://gitcode.com/yangzongzhuan/RuoYi-Vue-fast) 与 Oracle数据库版本 [RuoYi-Vue-Oracle](https://gitcode.com/yangzongzhuan/RuoYi-Vue-Oracle),均保持同步更新。
|
||||
* 阿里云折扣场:[点我进入](http://aly.ruoyi.vip),腾讯云秒杀场:[点我进入](http://txy.ruoyi.vip)
|
||||
|
||||
# 版本分支
|
||||
|
||||
RuoYi-Vue 后端项目提供 Spring Boot 2.x / 3.x / 4.x 多版本分支的并行维护。
|
||||
|
||||
| 名称 | 说明 | 地址 |
|
||||
| :---------------- | :------------------------ | :------------------------------------------------------ |
|
||||
| master 默认分支 | Spring Boot 4.x (JDK 17+) | https://gitee.com/y_project/RuoYi-Vue |
|
||||
| springboot3 分支 | Spring Boot 3.x (JDK 17+) | https://gitee.com/y_project/RuoYi-Vue/tree/springboot3 |
|
||||
| springboot2 分支 | Spring Boot 2.x (JDK 8+) | https://gitee.com/y_project/RuoYi-Vue/tree/springboot2 |
|
||||
|
||||
RuoYi-Vue 前端项目提供 Vue 2.x / 3.x / JavaScript TypeScript 版本均可混用搭配
|
||||
|
||||
| 项目名称 | **RuoYi-Vue** | **RuoYi-Vue3** | **RuoYi-Vue3-TypeScript** |
|
||||
| :--- | :--- | :--- | :--- |
|
||||
| **前端框架** | Vue 2 | Vue 3 | Vue 3 |
|
||||
| **脚本语言** | JavaScript | JavaScript | TypeScript |
|
||||
| **构建工具** | Vue CLI | Vite | Vite |
|
||||
| **UI 组件库** | Element UI | Element Plus | Element Plus |
|
||||
| **状态管理** | Vuex | Pinia | Pinia |
|
||||
| **路由管理** | Vue Router 3 | Vue Router 4 | Vue Router 4 |
|
||||
| **核心特点** | 1. 技术栈经典稳定<br>2. 社区资料丰富<br>3. 当前维护重心已转移 | 1. 现代前端技术栈<br>2. 开发体验与性能更优<br>3. 官方主推的活跃版本 | 1. 类型加持,减少沟通成本<br>2. 开发时有提示,效率更高<br>3. 多人协作企业级开发项目 |
|
||||
| **仓库地址** | [RuoYi-Vue](https://gitee.com/y_project/RuoYi-Vue) | [RuoYi-Vue3](https://gitcode.com/yangzongzhuan/RuoYi-Vue3) | [RuoYi-Vue3-TypeScript](https://gitcode.com/yangzongzhuan/RuoYi-Vue3/tree/typescript) |
|
||||
|
||||
## 内置功能
|
||||
|
||||
1. 用户管理:用户是系统操作者,该功能主要完成系统用户配置。
|
||||
@@ -43,21 +65,6 @@
|
||||
17. 在线构建器:拖动表单元素生成相应的HTML代码。
|
||||
18. 连接池监视:监视当前系统数据库连接池状态,可进行分析SQL找出系统性能瓶颈。
|
||||
|
||||
# 版本对比
|
||||
|
||||
RuoYi-Vue 前端项目的三个主要演进版本,方便你直观对比其技术栈差异(并行开发维护)。
|
||||
|
||||
| 项目名称 | **RuoYi-Vue** | **RuoYi-Vue3** | **RuoYi-Vue3-TypeScript** |
|
||||
| :--- | :--- | :--- | :--- |
|
||||
| **前端框架** | Vue 2 | Vue 3 | Vue 3 |
|
||||
| **脚本语言** | JavaScript | JavaScript | TypeScript |
|
||||
| **构建工具** | Vue CLI | Vite | Vite |
|
||||
| **UI 组件库** | Element UI | Element Plus | Element Plus |
|
||||
| **状态管理** | Vuex | Pinia | Pinia |
|
||||
| **路由管理** | Vue Router 3 | Vue Router 4 | Vue Router 4 |
|
||||
| **核心特点** | 1. 技术栈经典稳定<br>2. 社区资料丰富<br>3. 当前维护重心已转移 | 1. 现代前端技术栈<br>2. 开发体验与性能更优<br>3. 官方主推的活跃版本 | 1. 类型加持,减少沟通成本<br>2. 开发时有提示,效率更高<br>3. 多人协作企业级开发项目 |
|
||||
| **仓库地址** | [RuoYi-Vue](https://gitee.com/y_project/RuoYi-Vue) | [RuoYi-Vue3](https://gitcode.com/yangzongzhuan/RuoYi-Vue3) | [RuoYi-Vue3-TypeScript](https://gitcode.com/yangzongzhuan/RuoYi-Vue3/tree/typescript) |
|
||||
|
||||
## 在线体验
|
||||
|
||||
- admin/admin123
|
||||
|
||||
73
docker-compose.yml
Normal file
73
docker-compose.yml
Normal file
@@ -0,0 +1,73 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
mysql:
|
||||
image: mysql:8.0
|
||||
container_name: wcs-mysql
|
||||
environment:
|
||||
MYSQL_DATABASE: ${MYSQL_DATABASE:-ry-vue}
|
||||
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-your_password_here}
|
||||
MYSQL_USER: ${MYSQL_USER:-ruoyi}
|
||||
MYSQL_PASSWORD: ${MYSQL_PASSWORD:-your_password_here}
|
||||
ports:
|
||||
- "${MYSQL_PORT:-3306}:3306"
|
||||
volumes:
|
||||
- mysql-data:/var/lib/mysql
|
||||
- ./sql:/docker-entrypoint-initdb.d
|
||||
command: >
|
||||
--character-set-server=utf8mb4
|
||||
--collation-server=utf8mb4_general_ci
|
||||
--default-authentication-plugin=mysql_native_password
|
||||
healthcheck:
|
||||
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
container_name: wcs-redis
|
||||
ports:
|
||||
- "${REDIS_PORT:-6379}:6379"
|
||||
volumes:
|
||||
- redis-data:/data
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "ping"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
ruoyi-server:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
container_name: wcs-server
|
||||
ports:
|
||||
- "${SERVER_PORT:-8080}:8080"
|
||||
environment:
|
||||
SPRING_DATASOURCE_URL: jdbc:mysql://mysql:3306/${MYSQL_DATABASE:-ry-vue}?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=Asia/Shanghai
|
||||
SPRING_DATASOURCE_USERNAME: ${MYSQL_USER:-ruoyi}
|
||||
SPRING_DATASOURCE_PASSWORD: ${MYSQL_PASSWORD:-your_password_here}
|
||||
SPRING_REDIS_HOST: redis
|
||||
SPRING_REDIS_PORT: 6379
|
||||
depends_on:
|
||||
mysql:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_healthy
|
||||
|
||||
ruoyi-ui:
|
||||
image: node:16-alpine
|
||||
container_name: wcs-ui
|
||||
working_dir: /app
|
||||
volumes:
|
||||
- ./ruoyi-ui:/app
|
||||
ports:
|
||||
- "${UI_PORT:-80}:80"
|
||||
command: sh -c "npm install --registry https://registry.npmmirror.com && npm run dev"
|
||||
depends_on:
|
||||
- ruoyi-server
|
||||
|
||||
volumes:
|
||||
mysql-data:
|
||||
redis-data:
|
||||
4
pom.xml
4
pom.xml
@@ -19,12 +19,12 @@
|
||||
<java.version>1.8</java.version>
|
||||
<maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
|
||||
<spring-boot.version>2.5.15</spring-boot.version>
|
||||
<druid.version>1.2.27</druid.version>
|
||||
<druid.version>1.2.28</druid.version>
|
||||
<yauaa.version>7.32.0</yauaa.version>
|
||||
<swagger.version>3.0.0</swagger.version>
|
||||
<kaptcha.version>2.3.3</kaptcha.version>
|
||||
<pagehelper.boot.version>1.4.7</pagehelper.boot.version>
|
||||
<fastjson.version>2.0.60</fastjson.version>
|
||||
<fastjson.version>2.0.61</fastjson.version>
|
||||
<oshi.version>6.10.0</oshi.version>
|
||||
<commons.io.version>2.21.0</commons.io.version>
|
||||
<poi.version>4.1.2</poi.version>
|
||||
|
||||
@@ -0,0 +1,114 @@
|
||||
package com.ruoyi.wcs.api.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.wcs.api.domain.WcsApiConfig;
|
||||
import com.ruoyi.wcs.api.service.IWcsApiConfigService;
|
||||
|
||||
/**
|
||||
* <20>ӿ<EFBFBD><D3BF><EFBFBD><EFBFBD><EFBFBD> Controller
|
||||
*
|
||||
* @author wcs
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/wcs/api/config")
|
||||
public class WcsApiConfigController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IWcsApiConfigService apiConfigService;
|
||||
|
||||
/**
|
||||
* <20><>ѯ<EFBFBD>ӿ<EFBFBD><D3BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wcs:api:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(WcsApiConfig apiConfig)
|
||||
{
|
||||
startPage();
|
||||
List<WcsApiConfig> list = apiConfigService.selectApiConfigList(apiConfig);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* <20><><EFBFBD><EFBFBD><EFBFBD>ӿ<EFBFBD><D3BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>
|
||||
*/
|
||||
@Log(title = "<EFBFBD>ӿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", businessType = BusinessType.EXPORT)
|
||||
@PreAuthorize("@ss.hasPermi('wcs:api:export')")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, WcsApiConfig apiConfig)
|
||||
{
|
||||
List<WcsApiConfig> list = apiConfigService.selectApiConfigList(apiConfig);
|
||||
ExcelUtil<WcsApiConfig> util = new ExcelUtil<WcsApiConfig>(WcsApiConfig.class);
|
||||
util.exportExcel(response, list, "<EFBFBD>ӿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||
}
|
||||
|
||||
/**
|
||||
* <20><><EFBFBD>ݽӿ<DDBD>ID<49><44>ȡ<EFBFBD><C8A1>ϸ<EFBFBD><CFB8>Ϣ
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wcs:api:query')")
|
||||
@GetMapping(value = "/{apiId}")
|
||||
public AjaxResult getInfo(@PathVariable Long apiId)
|
||||
{
|
||||
return success(apiConfigService.selectApiConfigById(apiId));
|
||||
}
|
||||
|
||||
/**
|
||||
* <20><><EFBFBD><EFBFBD><EFBFBD>ӿ<EFBFBD><D3BF><EFBFBD><EFBFBD><EFBFBD>
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wcs:api:add')")
|
||||
@Log(title = "<EFBFBD>ӿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody WcsApiConfig apiConfig)
|
||||
{
|
||||
if (!apiConfigService.checkApiCodeUnique(apiConfig))
|
||||
{
|
||||
return error("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӿ<EFBFBD>'" + apiConfig.getApiCode() + "'ʧ<>ܣ<EFBFBD><DCA3>ӿڱ<D3BF><DAB1><EFBFBD><EFBFBD>Ѵ<EFBFBD><D1B4><EFBFBD>");
|
||||
}
|
||||
apiConfig.setCreateBy(getUsername());
|
||||
return toAjax(apiConfigService.insertApiConfig(apiConfig));
|
||||
}
|
||||
|
||||
/**
|
||||
* <20>Ľӿ<C4BD><D3BF><EFBFBD><EFBFBD><EFBFBD>
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wcs:api:edit')")
|
||||
@Log(title = "<EFBFBD>ӿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@Validated @RequestBody WcsApiConfig apiConfig)
|
||||
{
|
||||
if (!apiConfigService.checkApiCodeUnique(apiConfig))
|
||||
{
|
||||
return error("<EFBFBD>Ľӿ<EFBFBD>'" + apiConfig.getApiCode() + "'ʧ<>ܣ<EFBFBD><DCA3>ӿڱ<D3BF><DAB1><EFBFBD><EFBFBD>Ѵ<EFBFBD><D1B4><EFBFBD>");
|
||||
}
|
||||
apiConfig.setUpdateBy(getUsername());
|
||||
return toAjax(apiConfigService.updateApiConfig(apiConfig));
|
||||
}
|
||||
|
||||
/**
|
||||
* ɾ<><C9BE><EFBFBD>ӿ<EFBFBD><D3BF><EFBFBD><EFBFBD><EFBFBD>
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wcs:api:remove')")
|
||||
@Log(title = "<EFBFBD>ӿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{apiIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] apiIds)
|
||||
{
|
||||
return toAjax(apiConfigService.deleteApiConfigByIds(apiIds));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,187 @@
|
||||
package com.ruoyi.wcs.api.domain;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Size;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.annotation.Excel.ColumnType;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* <20>ӿ<EFBFBD><D3BF><EFBFBD><EFBFBD>ñ<EFBFBD> wcs_api_config
|
||||
*
|
||||
* @author wcs
|
||||
*/
|
||||
public class WcsApiConfig extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Excel(name = "<EFBFBD>ӿ<EFBFBD>ID", cellType = ColumnType.NUMERIC)
|
||||
private Long apiId;
|
||||
|
||||
@Excel(name = "<EFBFBD>ӿڱ<EFBFBD><EFBFBD><EFBFBD>")
|
||||
private String apiCode;
|
||||
|
||||
@Excel(name = "<EFBFBD>ӿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>")
|
||||
private String apiName;
|
||||
|
||||
@Excel(name = "<EFBFBD>ӿڵ<EFBFBD>ַ")
|
||||
private String apiUrl;
|
||||
|
||||
@Excel(name = "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ")
|
||||
private String requestMethod;
|
||||
|
||||
@Excel(name = "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>")
|
||||
private String contentType;
|
||||
|
||||
@Excel(name = "<EFBFBD><EFBFBD>ʱʱ<EFBFBD><EFBFBD>", cellType = ColumnType.NUMERIC)
|
||||
private Integer timeout;
|
||||
|
||||
@Excel(name = "<EFBFBD><EFBFBD><EFBFBD>Դ<EFBFBD><EFBFBD><EFBFBD>", cellType = ColumnType.NUMERIC)
|
||||
private Integer retryCount;
|
||||
|
||||
@Excel(name = "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", readConverterExp = "inbound=<3D><>վ,outbound=<3D><>վ")
|
||||
private String direction;
|
||||
|
||||
@Excel(name = "״̬", readConverterExp = "0=<3D><><EFBFBD><EFBFBD>,1=ͣ<><CDA3>")
|
||||
private String status;
|
||||
|
||||
private String delFlag;
|
||||
|
||||
public Long getApiId()
|
||||
{
|
||||
return apiId;
|
||||
}
|
||||
|
||||
public void setApiId(Long apiId)
|
||||
{
|
||||
this.apiId = apiId;
|
||||
}
|
||||
|
||||
@NotBlank(message = "<EFBFBD>ӿڱ<EFBFBD><EFBFBD>벻<EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>")
|
||||
@Size(min = 0, max = 64, message = "<EFBFBD>ӿڱ<EFBFBD><EFBFBD>볤<EFBFBD>Ȳ<EFBFBD><EFBFBD>ܳ<EFBFBD><EFBFBD><EFBFBD>64<EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD>")
|
||||
public String getApiCode()
|
||||
{
|
||||
return apiCode;
|
||||
}
|
||||
|
||||
public void setApiCode(String apiCode)
|
||||
{
|
||||
this.apiCode = apiCode;
|
||||
}
|
||||
|
||||
@Size(min = 0, max = 128, message = "<EFBFBD>ӿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƴ<EFBFBD><EFBFBD>Ȳ<EFBFBD><EFBFBD>ܳ<EFBFBD><EFBFBD><EFBFBD>128<EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD>")
|
||||
public String getApiName()
|
||||
{
|
||||
return apiName;
|
||||
}
|
||||
|
||||
public void setApiName(String apiName)
|
||||
{
|
||||
this.apiName = apiName;
|
||||
}
|
||||
|
||||
@Size(min = 0, max = 512, message = "<EFBFBD>ӿڵ<EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD>Ȳ<EFBFBD><EFBFBD>ܳ<EFBFBD><EFBFBD><EFBFBD>512<EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD>")
|
||||
public String getApiUrl()
|
||||
{
|
||||
return apiUrl;
|
||||
}
|
||||
|
||||
public void setApiUrl(String apiUrl)
|
||||
{
|
||||
this.apiUrl = apiUrl;
|
||||
}
|
||||
|
||||
public String getRequestMethod()
|
||||
{
|
||||
return requestMethod;
|
||||
}
|
||||
|
||||
public void setRequestMethod(String requestMethod)
|
||||
{
|
||||
this.requestMethod = requestMethod;
|
||||
}
|
||||
|
||||
public String getContentType()
|
||||
{
|
||||
return contentType;
|
||||
}
|
||||
|
||||
public void setContentType(String contentType)
|
||||
{
|
||||
this.contentType = contentType;
|
||||
}
|
||||
|
||||
public Integer getTimeout()
|
||||
{
|
||||
return timeout;
|
||||
}
|
||||
|
||||
public void setTimeout(Integer timeout)
|
||||
{
|
||||
this.timeout = timeout;
|
||||
}
|
||||
|
||||
public Integer getRetryCount()
|
||||
{
|
||||
return retryCount;
|
||||
}
|
||||
|
||||
public void setRetryCount(Integer retryCount)
|
||||
{
|
||||
this.retryCount = retryCount;
|
||||
}
|
||||
|
||||
public String getDirection()
|
||||
{
|
||||
return direction;
|
||||
}
|
||||
|
||||
public void setDirection(String direction)
|
||||
{
|
||||
this.direction = direction;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getDelFlag()
|
||||
{
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
public void setDelFlag(String delFlag)
|
||||
{
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("apiId", getApiId())
|
||||
.append("apiCode", getApiCode())
|
||||
.append("apiName", getApiName())
|
||||
.append("apiUrl", getApiUrl())
|
||||
.append("requestMethod", getRequestMethod())
|
||||
.append("contentType", getContentType())
|
||||
.append("timeout", getTimeout())
|
||||
.append("retryCount", getRetryCount())
|
||||
.append("direction", getDirection())
|
||||
.append("status", getStatus())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package com.ruoyi.wcs.api.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.wcs.api.domain.WcsApiConfig;
|
||||
|
||||
/**
|
||||
* <20>ӿ<EFBFBD><D3BF><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>ݲ<EFBFBD>
|
||||
*
|
||||
* @author wcs
|
||||
*/
|
||||
public interface WcsApiConfigMapper
|
||||
{
|
||||
/**
|
||||
* <20><>ѯ<EFBFBD>ӿ<EFBFBD><D3BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>
|
||||
*
|
||||
* @param apiConfig <20>ӿ<EFBFBD><D3BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
||||
* @return <20>ӿ<EFBFBD><D3BF><EFBFBD><EFBFBD>ü<EFBFBD><C3BC><EFBFBD>
|
||||
*/
|
||||
public List<WcsApiConfig> selectApiConfigList(WcsApiConfig apiConfig);
|
||||
|
||||
/**
|
||||
* ͨ<><CDA8><EFBFBD>ӿ<EFBFBD>ID<49><44>ѯ<EFBFBD>ӿ<EFBFBD><D3BF><EFBFBD><EFBFBD><EFBFBD>
|
||||
*
|
||||
* @param apiId <20>ӿ<EFBFBD>ID
|
||||
* @return <20>ӿ<EFBFBD><D3BF><EFBFBD><EFBFBD>ö<EFBFBD><C3B6><EFBFBD>
|
||||
*/
|
||||
public WcsApiConfig selectApiConfigById(Long apiId);
|
||||
|
||||
/**
|
||||
* <20><><EFBFBD><EFBFBD><EFBFBD>ӿ<EFBFBD><D3BF><EFBFBD><EFBFBD><EFBFBD>
|
||||
*
|
||||
* @param apiConfig <20>ӿ<EFBFBD><D3BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
||||
* @return <20><><EFBFBD><EFBFBD>
|
||||
*/
|
||||
public int insertApiConfig(WcsApiConfig apiConfig);
|
||||
|
||||
/**
|
||||
* <20>Ľӿ<C4BD><D3BF><EFBFBD><EFBFBD><EFBFBD>
|
||||
*
|
||||
* @param apiConfig <20>ӿ<EFBFBD><D3BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
||||
* @return <20><><EFBFBD><EFBFBD>
|
||||
*/
|
||||
public int updateApiConfig(WcsApiConfig apiConfig);
|
||||
|
||||
/**
|
||||
* ɾ<><C9BE><EFBFBD>ӿ<EFBFBD><D3BF><EFBFBD><EFBFBD><EFBFBD>
|
||||
*
|
||||
* @param apiId <20>ӿ<EFBFBD>ID
|
||||
* @return <20><><EFBFBD><EFBFBD>
|
||||
*/
|
||||
public int deleteApiConfigById(Long apiId);
|
||||
|
||||
/**
|
||||
* <20><><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD>ӿ<EFBFBD><D3BF><EFBFBD><EFBFBD><EFBFBD>
|
||||
*
|
||||
* @param apiIds <20>ӿ<EFBFBD>ID<49><44><EFBFBD><EFBFBD>
|
||||
* @return <20><><EFBFBD><EFBFBD>
|
||||
*/
|
||||
public int deleteApiConfigByIds(Long[] apiIds);
|
||||
|
||||
/**
|
||||
* У<><D0A3><EFBFBD>ӿڱ<D3BF><DAB1><EFBFBD><EFBFBD>Ƿ<EFBFBD>Ψһ
|
||||
*
|
||||
* @param apiCode <20>ӿڱ<D3BF><DAB1><EFBFBD>
|
||||
* @return <20>ӿ<EFBFBD><D3BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
||||
*/
|
||||
public WcsApiConfig checkApiCodeUnique(String apiCode);
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* WCS <20>ӿ<EFBFBD><D3BF><EFBFBD><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3>
|
||||
* <p>
|
||||
* <20><><EFBFBD><EFBFBD> WCS <20><><EFBFBD>ⲿϵͳ<CFB5><CDB3>WMS / ERP / PLC <20>ȣ<EFBFBD><C8A3><EFBFBD> API <20>ӿ<EFBFBD><D3BF><EFBFBD><EFBFBD>ã<EFBFBD>
|
||||
* <20><><EFBFBD><EFBFBD><EFBFBD>ӿڵ<D3BF>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>á<EFBFBD><C3A1><EFBFBD><EFBFBD>Բ<EFBFBD><D4B2>Եȡ<D4B5>
|
||||
* </p>
|
||||
*
|
||||
* @author WCS
|
||||
*/
|
||||
package com.ruoyi.wcs.api;
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.ruoyi.wcs.api.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.wcs.api.domain.WcsApiConfig;
|
||||
|
||||
/**
|
||||
* <20>ӿ<EFBFBD><D3BF><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
*
|
||||
* @author wcs
|
||||
*/
|
||||
public interface IWcsApiConfigService
|
||||
{
|
||||
/**
|
||||
* <20><>ѯ<EFBFBD>ӿ<EFBFBD><D3BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>
|
||||
*
|
||||
* @param apiConfig <20>ӿ<EFBFBD><D3BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
||||
* @return <20>ӿ<EFBFBD><D3BF><EFBFBD><EFBFBD>ü<EFBFBD><C3BC><EFBFBD>
|
||||
*/
|
||||
public List<WcsApiConfig> selectApiConfigList(WcsApiConfig apiConfig);
|
||||
|
||||
/**
|
||||
* ͨ<><CDA8><EFBFBD>ӿ<EFBFBD>ID<49><44>ѯ<EFBFBD>ӿ<EFBFBD><D3BF><EFBFBD><EFBFBD><EFBFBD>
|
||||
*
|
||||
* @param apiId <20>ӿ<EFBFBD>ID
|
||||
* @return <20>ӿ<EFBFBD><D3BF><EFBFBD><EFBFBD>ö<EFBFBD><C3B6><EFBFBD>
|
||||
*/
|
||||
public WcsApiConfig selectApiConfigById(Long apiId);
|
||||
|
||||
/**
|
||||
* <20><><EFBFBD><EFBFBD><EFBFBD>ӿ<EFBFBD><D3BF><EFBFBD><EFBFBD><EFBFBD>
|
||||
*
|
||||
* @param apiConfig <20>ӿ<EFBFBD><D3BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
||||
* @return <20><><EFBFBD><EFBFBD>
|
||||
*/
|
||||
public int insertApiConfig(WcsApiConfig apiConfig);
|
||||
|
||||
/**
|
||||
* <20>Ľӿ<C4BD><D3BF><EFBFBD><EFBFBD><EFBFBD>
|
||||
*
|
||||
* @param apiConfig <20>ӿ<EFBFBD><D3BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
||||
* @return <20><><EFBFBD><EFBFBD>
|
||||
*/
|
||||
public int updateApiConfig(WcsApiConfig apiConfig);
|
||||
|
||||
/**
|
||||
* <20><><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD>ӿ<EFBFBD><D3BF><EFBFBD><EFBFBD><EFBFBD>
|
||||
*
|
||||
* @param apiIds <20>ӿ<EFBFBD>ID<49><44><EFBFBD><EFBFBD>
|
||||
* @return <20><><EFBFBD><EFBFBD>
|
||||
*/
|
||||
public int deleteApiConfigByIds(Long[] apiIds);
|
||||
|
||||
/**
|
||||
* У<><D0A3><EFBFBD>ӿڱ<D3BF><DAB1><EFBFBD><EFBFBD>Ƿ<EFBFBD>Ψһ
|
||||
*
|
||||
* @param apiConfig <20>ӿ<EFBFBD><D3BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
||||
* @return <20><><EFBFBD><EFBFBD>
|
||||
*/
|
||||
public boolean checkApiCodeUnique(WcsApiConfig apiConfig);
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.ruoyi.wcs.api.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.common.constant.UserConstants;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.wcs.api.domain.WcsApiConfig;
|
||||
import com.ruoyi.wcs.api.mapper.WcsApiConfigMapper;
|
||||
import com.ruoyi.wcs.api.service.IWcsApiConfigService;
|
||||
|
||||
/**
|
||||
* <20>ӿ<EFBFBD><D3BF><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>㴦<EFBFBD><E3B4A6>
|
||||
*
|
||||
* @author wcs
|
||||
*/
|
||||
@Service
|
||||
public class WcsApiConfigServiceImpl implements IWcsApiConfigService
|
||||
{
|
||||
@Autowired
|
||||
private WcsApiConfigMapper apiConfigMapper;
|
||||
|
||||
@Override
|
||||
public List<WcsApiConfig> selectApiConfigList(WcsApiConfig apiConfig)
|
||||
{
|
||||
return apiConfigMapper.selectApiConfigList(apiConfig);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WcsApiConfig selectApiConfigById(Long apiId)
|
||||
{
|
||||
return apiConfigMapper.selectApiConfigById(apiId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertApiConfig(WcsApiConfig apiConfig)
|
||||
{
|
||||
return apiConfigMapper.insertApiConfig(apiConfig);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateApiConfig(WcsApiConfig apiConfig)
|
||||
{
|
||||
return apiConfigMapper.updateApiConfig(apiConfig);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteApiConfigByIds(Long[] apiIds)
|
||||
{
|
||||
return apiConfigMapper.deleteApiConfigByIds(apiIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkApiCodeUnique(WcsApiConfig apiConfig)
|
||||
{
|
||||
Long apiId = StringUtils.isNull(apiConfig.getApiId()) ? -1L : apiConfig.getApiId();
|
||||
WcsApiConfig info = apiConfigMapper.checkApiCodeUnique(apiConfig.getApiCode());
|
||||
if (StringUtils.isNotNull(info) && info.getApiId().longValue() != apiId.longValue())
|
||||
{
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
package com.ruoyi.wcs.device.controller;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.wcs.device.domain.WcsDevice;
|
||||
import com.ruoyi.wcs.device.service.IWcsDeviceService;
|
||||
|
||||
/**
|
||||
* WCS <20>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD> Controller
|
||||
*
|
||||
* @author wcs
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/wcs/device")
|
||||
public class WcsDeviceController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IWcsDeviceService deviceService;
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('wcs:device:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(WcsDevice device)
|
||||
{
|
||||
startPage();
|
||||
List<WcsDevice> list = deviceService.selectDeviceList(device);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('wcs:device:query')")
|
||||
@GetMapping(value = "/{deviceId}")
|
||||
public AjaxResult getInfo(@PathVariable Long deviceId)
|
||||
{
|
||||
return success(deviceService.selectDeviceById(deviceId));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('wcs:device:add')")
|
||||
@Log(title = "<EFBFBD>豸<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody WcsDevice device)
|
||||
{
|
||||
if (!deviceService.checkDeviceCodeUnique(device))
|
||||
{
|
||||
return error("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>豸'" + device.getDeviceCode() + "'ʧ<>ܣ<EFBFBD><DCA3>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD><D1B4><EFBFBD>");
|
||||
}
|
||||
device.setCreateBy(getUsername());
|
||||
return toAjax(deviceService.insertDevice(device));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('wcs:device:edit')")
|
||||
@Log(title = "<EFBFBD>豸<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@Validated @RequestBody WcsDevice device)
|
||||
{
|
||||
if (!deviceService.checkDeviceCodeUnique(device))
|
||||
{
|
||||
return error("<EFBFBD><EFBFBD><EFBFBD>豸'" + device.getDeviceCode() + "'ʧ<>ܣ<EFBFBD><DCA3>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD><D1B4><EFBFBD>");
|
||||
}
|
||||
device.setUpdateBy(getUsername());
|
||||
return toAjax(deviceService.updateDevice(device));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('wcs:device:remove')")
|
||||
@Log(title = "<EFBFBD>豸<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{deviceIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] deviceIds)
|
||||
{
|
||||
return toAjax(deviceService.deleteDeviceByIds(deviceIds));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package com.ruoyi.wcs.device.controller;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.wcs.device.domain.WcsDevicePoint;
|
||||
import com.ruoyi.wcs.device.service.IWcsDevicePointService;
|
||||
|
||||
/**
|
||||
* WCS <20>豸<EFBFBD><E8B1B8>λ<EFBFBD><CEBB><EFBFBD><EFBFBD> Controller
|
||||
*
|
||||
* @author wcs
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/wcs/device/point")
|
||||
public class WcsDevicePointController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IWcsDevicePointService pointService;
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('wcs:point:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(WcsDevicePoint point)
|
||||
{
|
||||
startPage();
|
||||
List<WcsDevicePoint> list = pointService.selectPointList(point);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('wcs:point:query')")
|
||||
@GetMapping(value = "/{pointId}")
|
||||
public AjaxResult getInfo(@PathVariable Long pointId)
|
||||
{
|
||||
return success(pointService.selectPointById(pointId));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('wcs:point:add')")
|
||||
@Log(title = "<EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody WcsDevicePoint point)
|
||||
{
|
||||
point.setCreateBy(getUsername());
|
||||
return toAjax(pointService.insertPoint(point));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('wcs:point:edit')")
|
||||
@Log(title = "<EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@Validated @RequestBody WcsDevicePoint point)
|
||||
{
|
||||
point.setUpdateBy(getUsername());
|
||||
return toAjax(pointService.updatePoint(point));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('wcs:point:remove')")
|
||||
@Log(title = "<EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{pointIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] pointIds)
|
||||
{
|
||||
return toAjax(pointService.deletePointByIds(pointIds));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,182 @@
|
||||
package com.ruoyi.wcs.device.domain;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Size;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.annotation.Excel.ColumnType;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* <20>豸<EFBFBD><E8B1B8>Ϣ<EFBFBD><CFA2> wcs_device
|
||||
*
|
||||
* @author wcs
|
||||
*/
|
||||
public class WcsDevice extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** <20>豸ID */
|
||||
@Excel(name = "<EFBFBD>豸ID", cellType = ColumnType.NUMERIC)
|
||||
private Long deviceId;
|
||||
|
||||
/** <20>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD> */
|
||||
@Excel(name = "<EFBFBD>豸<EFBFBD><EFBFBD><EFBFBD><EFBFBD>")
|
||||
private String deviceCode;
|
||||
|
||||
/** <20>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD> */
|
||||
@Excel(name = "<EFBFBD>豸<EFBFBD><EFBFBD><EFBFBD><EFBFBD>")
|
||||
private String deviceName;
|
||||
|
||||
/** <20>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD> */
|
||||
@Excel(name = "<EFBFBD>豸<EFBFBD><EFBFBD><EFBFBD><EFBFBD>")
|
||||
private String deviceType;
|
||||
|
||||
/** <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
@Excel(name = "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>")
|
||||
private String areaCode;
|
||||
|
||||
/** ͨ<><CDA8>Э<EFBFBD><D0AD> */
|
||||
@Excel(name = "ͨ<EFBFBD><EFBFBD>Э<EFBFBD><EFBFBD>")
|
||||
private String protocolType;
|
||||
|
||||
/** <20>豸IP<49><50>ַ */
|
||||
@Excel(name = "IP<EFBFBD><EFBFBD>ַ")
|
||||
private String ipAddress;
|
||||
|
||||
/** ͨ<>Ŷ˿<C5B6> */
|
||||
@Excel(name = "<EFBFBD>˿<EFBFBD>", cellType = ColumnType.NUMERIC)
|
||||
private Integer port;
|
||||
|
||||
/** <20>豸״̬<D7B4><CCAC>0<EFBFBD><30><EFBFBD><EFBFBD> 1ͣ<31>ã<EFBFBD> */
|
||||
@Excel(name = "״̬", readConverterExp = "0=<3D><><EFBFBD><EFBFBD>,1=ͣ<><CDA3>")
|
||||
private String status;
|
||||
|
||||
/** ɾ<><C9BE><EFBFBD><EFBFBD>־<EFBFBD><D6BE>0<EFBFBD><30><EFBFBD><EFBFBD> 2ɾ<32><C9BE><EFBFBD><EFBFBD> */
|
||||
private String delFlag;
|
||||
|
||||
public Long getDeviceId()
|
||||
{
|
||||
return deviceId;
|
||||
}
|
||||
|
||||
public void setDeviceId(Long deviceId)
|
||||
{
|
||||
this.deviceId = deviceId;
|
||||
}
|
||||
|
||||
@NotBlank(message = "<EFBFBD>豸<EFBFBD><EFBFBD><EFBFBD>벻<EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>")
|
||||
@Size(min = 0, max = 64, message = "<EFBFBD>豸<EFBFBD><EFBFBD><EFBFBD>볤<EFBFBD>Ȳ<EFBFBD><EFBFBD>ܳ<EFBFBD><EFBFBD><EFBFBD>64<EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD>")
|
||||
public String getDeviceCode()
|
||||
{
|
||||
return deviceCode;
|
||||
}
|
||||
|
||||
public void setDeviceCode(String deviceCode)
|
||||
{
|
||||
this.deviceCode = deviceCode;
|
||||
}
|
||||
|
||||
@Size(min = 0, max = 128, message = "<EFBFBD>豸<EFBFBD><EFBFBD><EFBFBD>Ƴ<EFBFBD><EFBFBD>Ȳ<EFBFBD><EFBFBD>ܳ<EFBFBD><EFBFBD><EFBFBD>128<EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD>")
|
||||
public String getDeviceName()
|
||||
{
|
||||
return deviceName;
|
||||
}
|
||||
|
||||
public void setDeviceName(String deviceName)
|
||||
{
|
||||
this.deviceName = deviceName;
|
||||
}
|
||||
|
||||
public String getDeviceType()
|
||||
{
|
||||
return deviceType;
|
||||
}
|
||||
|
||||
public void setDeviceType(String deviceType)
|
||||
{
|
||||
this.deviceType = deviceType;
|
||||
}
|
||||
|
||||
public String getAreaCode()
|
||||
{
|
||||
return areaCode;
|
||||
}
|
||||
|
||||
public void setAreaCode(String areaCode)
|
||||
{
|
||||
this.areaCode = areaCode;
|
||||
}
|
||||
|
||||
public String getProtocolType()
|
||||
{
|
||||
return protocolType;
|
||||
}
|
||||
|
||||
public void setProtocolType(String protocolType)
|
||||
{
|
||||
this.protocolType = protocolType;
|
||||
}
|
||||
|
||||
public String getIpAddress()
|
||||
{
|
||||
return ipAddress;
|
||||
}
|
||||
|
||||
public void setIpAddress(String ipAddress)
|
||||
{
|
||||
this.ipAddress = ipAddress;
|
||||
}
|
||||
|
||||
public Integer getPort()
|
||||
{
|
||||
return port;
|
||||
}
|
||||
|
||||
public void setPort(Integer port)
|
||||
{
|
||||
this.port = port;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getDelFlag()
|
||||
{
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
public void setDelFlag(String delFlag)
|
||||
{
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("deviceId", getDeviceId())
|
||||
.append("deviceCode", getDeviceCode())
|
||||
.append("deviceName", getDeviceName())
|
||||
.append("deviceType", getDeviceType())
|
||||
.append("areaCode", getAreaCode())
|
||||
.append("protocolType", getProtocolType())
|
||||
.append("ipAddress", getIpAddress())
|
||||
.append("port", getPort())
|
||||
.append("status", getStatus())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,197 @@
|
||||
package com.ruoyi.wcs.device.domain;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.annotation.Excel.ColumnType;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* <20>豸<EFBFBD><E8B1B8>λ<EFBFBD><CEBB> wcs_device_point
|
||||
*
|
||||
* @author wcs
|
||||
*/
|
||||
public class WcsDevicePoint extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** <20><>λID */
|
||||
@Excel(name = "<EFBFBD><EFBFBD>λID", cellType = ColumnType.NUMERIC)
|
||||
private Long pointId;
|
||||
|
||||
/** <20><><EFBFBD><EFBFBD><EFBFBD>豸ID */
|
||||
@Excel(name = "<EFBFBD>豸ID", cellType = ColumnType.NUMERIC)
|
||||
private Long deviceId;
|
||||
|
||||
/** <20><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD> */
|
||||
@Excel(name = "<EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>")
|
||||
private String pointCode;
|
||||
|
||||
/** <20><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD> */
|
||||
@Excel(name = "<EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>")
|
||||
private String pointName;
|
||||
|
||||
/** <20><>λ<EFBFBD><CEBB><EFBFBD>ͣ<EFBFBD>read/write/read_write<74><65> */
|
||||
@Excel(name = "<EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>")
|
||||
private String pointType;
|
||||
|
||||
/** <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͣ<EFBFBD>int/float/bool/string<6E><67> */
|
||||
@Excel(name = "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>")
|
||||
private String dataType;
|
||||
|
||||
/** <20>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD>ַ/OPC<50>ڵ<EFBFBD> */
|
||||
@Excel(name = "<EFBFBD><EFBFBD>ַ")
|
||||
private String address;
|
||||
|
||||
/** <20><>λ */
|
||||
@Excel(name = "<EFBFBD><EFBFBD>λ")
|
||||
private String unit;
|
||||
|
||||
/** ״̬<D7B4><CCAC>0<EFBFBD><30><EFBFBD><EFBFBD> 1ͣ<31>ã<EFBFBD> */
|
||||
@Excel(name = "״̬", readConverterExp = "0=<3D><><EFBFBD><EFBFBD>,1=ͣ<><CDA3>")
|
||||
private String status;
|
||||
|
||||
/** ɾ<><C9BE><EFBFBD><EFBFBD>־<EFBFBD><D6BE>0<EFBFBD><30><EFBFBD><EFBFBD> 2ɾ<32><C9BE><EFBFBD><EFBFBD> */
|
||||
private String delFlag;
|
||||
|
||||
/** <20><><EFBFBD><EFBFBD><EFBFBD>豸<EFBFBD><E8B1B8><EFBFBD>ƣ<EFBFBD><C6A3>dz־û<D6BE><C3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>չʾ<D5B9><CABE> */
|
||||
private String deviceName;
|
||||
|
||||
public Long getPointId()
|
||||
{
|
||||
return pointId;
|
||||
}
|
||||
|
||||
public void setPointId(Long pointId)
|
||||
{
|
||||
this.pointId = pointId;
|
||||
}
|
||||
|
||||
@NotNull(message = "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>豸<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>")
|
||||
public Long getDeviceId()
|
||||
{
|
||||
return deviceId;
|
||||
}
|
||||
|
||||
public void setDeviceId(Long deviceId)
|
||||
{
|
||||
this.deviceId = deviceId;
|
||||
}
|
||||
|
||||
@NotBlank(message = "<EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD><EFBFBD>벻<EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>")
|
||||
@Size(min = 0, max = 64, message = "<EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD><EFBFBD>볤<EFBFBD>Ȳ<EFBFBD><EFBFBD>ܳ<EFBFBD><EFBFBD><EFBFBD>64<EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD>")
|
||||
public String getPointCode()
|
||||
{
|
||||
return pointCode;
|
||||
}
|
||||
|
||||
public void setPointCode(String pointCode)
|
||||
{
|
||||
this.pointCode = pointCode;
|
||||
}
|
||||
|
||||
@Size(min = 0, max = 128, message = "<EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD><EFBFBD>Ƴ<EFBFBD><EFBFBD>Ȳ<EFBFBD><EFBFBD>ܳ<EFBFBD><EFBFBD><EFBFBD>128<EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD>")
|
||||
public String getPointName()
|
||||
{
|
||||
return pointName;
|
||||
}
|
||||
|
||||
public void setPointName(String pointName)
|
||||
{
|
||||
this.pointName = pointName;
|
||||
}
|
||||
|
||||
public String getPointType()
|
||||
{
|
||||
return pointType;
|
||||
}
|
||||
|
||||
public void setPointType(String pointType)
|
||||
{
|
||||
this.pointType = pointType;
|
||||
}
|
||||
|
||||
public String getDataType()
|
||||
{
|
||||
return dataType;
|
||||
}
|
||||
|
||||
public void setDataType(String dataType)
|
||||
{
|
||||
this.dataType = dataType;
|
||||
}
|
||||
|
||||
public String getAddress()
|
||||
{
|
||||
return address;
|
||||
}
|
||||
|
||||
public void setAddress(String address)
|
||||
{
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public String getUnit()
|
||||
{
|
||||
return unit;
|
||||
}
|
||||
|
||||
public void setUnit(String unit)
|
||||
{
|
||||
this.unit = unit;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getDelFlag()
|
||||
{
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
public void setDelFlag(String delFlag)
|
||||
{
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
public String getDeviceName()
|
||||
{
|
||||
return deviceName;
|
||||
}
|
||||
|
||||
public void setDeviceName(String deviceName)
|
||||
{
|
||||
this.deviceName = deviceName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("pointId", getPointId())
|
||||
.append("deviceId", getDeviceId())
|
||||
.append("pointCode", getPointCode())
|
||||
.append("pointName", getPointName())
|
||||
.append("pointType", getPointType())
|
||||
.append("dataType", getDataType())
|
||||
.append("address", getAddress())
|
||||
.append("unit", getUnit())
|
||||
.append("status", getStatus())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package com.ruoyi.wcs.device.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.wcs.device.domain.WcsDevice;
|
||||
|
||||
/**
|
||||
* <20>豸<EFBFBD><E8B1B8>Ϣ <20><><EFBFBD>ݲ<EFBFBD>
|
||||
*
|
||||
* @author wcs
|
||||
*/
|
||||
public interface WcsDeviceMapper
|
||||
{
|
||||
/**
|
||||
* <20><>ѯ<EFBFBD>豸<EFBFBD>б<EFBFBD>
|
||||
*
|
||||
* @param device <20>豸<EFBFBD><E8B1B8>Ϣ
|
||||
* @return <20>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>
|
||||
*/
|
||||
public List<WcsDevice> selectDeviceList(WcsDevice device);
|
||||
|
||||
/**
|
||||
* ͨ<><CDA8><EFBFBD>豸ID<49><44>ѯ<EFBFBD>豸<EFBFBD><E8B1B8>Ϣ
|
||||
*
|
||||
* @param deviceId <20>豸ID
|
||||
* @return <20>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>
|
||||
*/
|
||||
public WcsDevice selectDeviceById(Long deviceId);
|
||||
|
||||
/**
|
||||
* <20><><EFBFBD><EFBFBD><EFBFBD>豸
|
||||
*
|
||||
* @param device <20>豸<EFBFBD><E8B1B8>Ϣ
|
||||
* @return <20><><EFBFBD><EFBFBD>
|
||||
*/
|
||||
public int insertDevice(WcsDevice device);
|
||||
|
||||
/**
|
||||
* <20><EFBFBD><DEB8>豸
|
||||
*
|
||||
* @param device <20>豸<EFBFBD><E8B1B8>Ϣ
|
||||
* @return <20><><EFBFBD><EFBFBD>
|
||||
*/
|
||||
public int updateDevice(WcsDevice device);
|
||||
|
||||
/**
|
||||
* ɾ<><C9BE><EFBFBD>豸
|
||||
*
|
||||
* @param deviceId <20>豸ID
|
||||
* @return <20><><EFBFBD><EFBFBD>
|
||||
*/
|
||||
public int deleteDeviceById(Long deviceId);
|
||||
|
||||
/**
|
||||
* <20><><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD>豸
|
||||
*
|
||||
* @param deviceIds <20>豸ID<49><44><EFBFBD><EFBFBD>
|
||||
* @return <20><><EFBFBD><EFBFBD>
|
||||
*/
|
||||
public int deleteDeviceByIds(Long[] deviceIds);
|
||||
|
||||
/**
|
||||
* У<><D0A3><EFBFBD>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD>Ψһ
|
||||
*
|
||||
* @param deviceCode <20>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>
|
||||
* @return <20>豸<EFBFBD><E8B1B8>Ϣ
|
||||
*/
|
||||
public WcsDevice checkDeviceCodeUnique(String deviceCode);
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.ruoyi.wcs.device.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.wcs.device.domain.WcsDevicePoint;
|
||||
|
||||
/**
|
||||
* <20>豸<EFBFBD><E8B1B8>λ <20><><EFBFBD>ݲ<EFBFBD>
|
||||
*
|
||||
* @author wcs
|
||||
*/
|
||||
public interface WcsDevicePointMapper
|
||||
{
|
||||
/**
|
||||
* <20><>ѯ<EFBFBD><D1AF>λ<EFBFBD>б<EFBFBD>
|
||||
*
|
||||
* @param point <20><>λ<EFBFBD><CEBB>Ϣ
|
||||
* @return <20><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>
|
||||
*/
|
||||
public List<WcsDevicePoint> selectPointList(WcsDevicePoint point);
|
||||
|
||||
/**
|
||||
* ͨ<><CDA8><EFBFBD><EFBFBD>λID<49><44>ѯ<EFBFBD><D1AF>λ<EFBFBD><CEBB>Ϣ
|
||||
*
|
||||
* @param pointId <20><>λID
|
||||
* @return <20><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>
|
||||
*/
|
||||
public WcsDevicePoint selectPointById(Long pointId);
|
||||
|
||||
/**
|
||||
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ
|
||||
*
|
||||
* @param point <20><>λ<EFBFBD><CEBB>Ϣ
|
||||
* @return <20><><EFBFBD><EFBFBD>
|
||||
*/
|
||||
public int insertPoint(WcsDevicePoint point);
|
||||
|
||||
/**
|
||||
* <20>ĵ<DEB8>λ
|
||||
*
|
||||
* @param point <20><>λ<EFBFBD><CEBB>Ϣ
|
||||
* @return <20><><EFBFBD><EFBFBD>
|
||||
*/
|
||||
public int updatePoint(WcsDevicePoint point);
|
||||
|
||||
/**
|
||||
* ɾ<><C9BE><EFBFBD><EFBFBD>λ
|
||||
*
|
||||
* @param pointId <20><>λID
|
||||
* @return <20><><EFBFBD><EFBFBD>
|
||||
*/
|
||||
public int deletePointById(Long pointId);
|
||||
|
||||
/**
|
||||
* <20><><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD>λ
|
||||
*
|
||||
* @param pointIds <20><>λID<49><44><EFBFBD><EFBFBD>
|
||||
* @return <20><><EFBFBD><EFBFBD>
|
||||
*/
|
||||
public int deletePointByIds(Long[] pointIds);
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* WCS <20>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3>
|
||||
* <p>
|
||||
* <20><><EFBFBD><EFBFBD><EFBFBD>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>豸<EFBFBD><E8B1B8>λ<EFBFBD><CEBB><EFBFBD>á<EFBFBD><C3A1><EFBFBD>λֵ<CEBB><D6B5>д<EFBFBD>ȹ<EFBFBD><C8B9>ܡ<EFBFBD>
|
||||
* <20><><EFBFBD><EFBFBD> Controller / Service / Mapper / Domain <20>ȷֲ<C8B7><D6B2>ṹ<EFBFBD><E1B9B9>
|
||||
* </p>
|
||||
*
|
||||
* @author WCS
|
||||
*/
|
||||
package com.ruoyi.wcs.device;
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.ruoyi.wcs.device.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.wcs.device.domain.WcsDevicePoint;
|
||||
|
||||
/**
|
||||
* <20>豸<EFBFBD><E8B1B8>λ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
*
|
||||
* @author wcs
|
||||
*/
|
||||
public interface IWcsDevicePointService
|
||||
{
|
||||
/**
|
||||
* <20><>ѯ<EFBFBD><D1AF>λ<EFBFBD>б<EFBFBD>
|
||||
*
|
||||
* @param point <20><>λ<EFBFBD><CEBB>Ϣ
|
||||
* @return <20><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>
|
||||
*/
|
||||
public List<WcsDevicePoint> selectPointList(WcsDevicePoint point);
|
||||
|
||||
/**
|
||||
* ͨ<><CDA8><EFBFBD><EFBFBD>λID<49><44>ѯ<EFBFBD><D1AF>λ<EFBFBD><CEBB>Ϣ
|
||||
*
|
||||
* @param pointId <20><>λID
|
||||
* @return <20><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>
|
||||
*/
|
||||
public WcsDevicePoint selectPointById(Long pointId);
|
||||
|
||||
/**
|
||||
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ
|
||||
*
|
||||
* @param point <20><>λ<EFBFBD><CEBB>Ϣ
|
||||
* @return <20><><EFBFBD><EFBFBD>
|
||||
*/
|
||||
public int insertPoint(WcsDevicePoint point);
|
||||
|
||||
/**
|
||||
* <20>ĵ<DEB8>λ
|
||||
*
|
||||
* @param point <20><>λ<EFBFBD><CEBB>Ϣ
|
||||
* @return <20><><EFBFBD><EFBFBD>
|
||||
*/
|
||||
public int updatePoint(WcsDevicePoint point);
|
||||
|
||||
/**
|
||||
* <20><><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD>λ
|
||||
*
|
||||
* @param pointIds <20><>λID<49><44><EFBFBD><EFBFBD>
|
||||
* @return <20><><EFBFBD><EFBFBD>
|
||||
*/
|
||||
public int deletePointByIds(Long[] pointIds);
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.ruoyi.wcs.device.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.wcs.device.domain.WcsDevice;
|
||||
|
||||
/**
|
||||
* <20>豸<EFBFBD><E8B1B8>Ϣ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
*
|
||||
* @author wcs
|
||||
*/
|
||||
public interface IWcsDeviceService
|
||||
{
|
||||
/**
|
||||
* <20><>ѯ<EFBFBD>豸<EFBFBD>б<EFBFBD>
|
||||
*
|
||||
* @param device <20>豸<EFBFBD><E8B1B8>Ϣ
|
||||
* @return <20>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>
|
||||
*/
|
||||
public List<WcsDevice> selectDeviceList(WcsDevice device);
|
||||
|
||||
/**
|
||||
* ͨ<><CDA8><EFBFBD>豸ID<49><44>ѯ<EFBFBD>豸<EFBFBD><E8B1B8>Ϣ
|
||||
*
|
||||
* @param deviceId <20>豸ID
|
||||
* @return <20>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>
|
||||
*/
|
||||
public WcsDevice selectDeviceById(Long deviceId);
|
||||
|
||||
/**
|
||||
* <20><><EFBFBD><EFBFBD><EFBFBD>豸
|
||||
*
|
||||
* @param device <20>豸<EFBFBD><E8B1B8>Ϣ
|
||||
* @return <20><><EFBFBD><EFBFBD>
|
||||
*/
|
||||
public int insertDevice(WcsDevice device);
|
||||
|
||||
/**
|
||||
* <20><EFBFBD><DEB8>豸
|
||||
*
|
||||
* @param device <20>豸<EFBFBD><E8B1B8>Ϣ
|
||||
* @return <20><><EFBFBD><EFBFBD>
|
||||
*/
|
||||
public int updateDevice(WcsDevice device);
|
||||
|
||||
/**
|
||||
* <20><><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD>豸
|
||||
*
|
||||
* @param deviceIds <20>豸ID<49><44><EFBFBD><EFBFBD>
|
||||
* @return <20><><EFBFBD><EFBFBD>
|
||||
*/
|
||||
public int deleteDeviceByIds(Long[] deviceIds);
|
||||
|
||||
/**
|
||||
* У<><D0A3><EFBFBD>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD>Ψһ
|
||||
*
|
||||
* @param device <20>豸<EFBFBD><E8B1B8>Ϣ
|
||||
* @return <20><><EFBFBD><EFBFBD>
|
||||
*/
|
||||
public boolean checkDeviceCodeUnique(WcsDevice device);
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.ruoyi.wcs.device.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.wcs.device.domain.WcsDevicePoint;
|
||||
import com.ruoyi.wcs.device.mapper.WcsDevicePointMapper;
|
||||
import com.ruoyi.wcs.device.service.IWcsDevicePointService;
|
||||
|
||||
/**
|
||||
* <20>豸<EFBFBD><E8B1B8>λ <20><><EFBFBD><EFBFBD><EFBFBD>㴦<EFBFBD><E3B4A6>
|
||||
*
|
||||
* @author wcs
|
||||
*/
|
||||
@Service
|
||||
public class WcsDevicePointServiceImpl implements IWcsDevicePointService
|
||||
{
|
||||
@Autowired
|
||||
private WcsDevicePointMapper pointMapper;
|
||||
|
||||
@Override
|
||||
public List<WcsDevicePoint> selectPointList(WcsDevicePoint point)
|
||||
{
|
||||
return pointMapper.selectPointList(point);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WcsDevicePoint selectPointById(Long pointId)
|
||||
{
|
||||
return pointMapper.selectPointById(pointId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertPoint(WcsDevicePoint point)
|
||||
{
|
||||
return pointMapper.insertPoint(point);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updatePoint(WcsDevicePoint point)
|
||||
{
|
||||
return pointMapper.updatePoint(point);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deletePointByIds(Long[] pointIds)
|
||||
{
|
||||
return pointMapper.deletePointByIds(pointIds);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.ruoyi.wcs.device.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.common.constant.UserConstants;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.wcs.device.domain.WcsDevice;
|
||||
import com.ruoyi.wcs.device.mapper.WcsDeviceMapper;
|
||||
import com.ruoyi.wcs.device.service.IWcsDeviceService;
|
||||
|
||||
/**
|
||||
* <20>豸<EFBFBD><E8B1B8>Ϣ <20><><EFBFBD><EFBFBD><EFBFBD>㴦<EFBFBD><E3B4A6>
|
||||
*
|
||||
* @author wcs
|
||||
*/
|
||||
@Service
|
||||
public class WcsDeviceServiceImpl implements IWcsDeviceService
|
||||
{
|
||||
@Autowired
|
||||
private WcsDeviceMapper deviceMapper;
|
||||
|
||||
@Override
|
||||
public List<WcsDevice> selectDeviceList(WcsDevice device)
|
||||
{
|
||||
return deviceMapper.selectDeviceList(device);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WcsDevice selectDeviceById(Long deviceId)
|
||||
{
|
||||
return deviceMapper.selectDeviceById(deviceId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertDevice(WcsDevice device)
|
||||
{
|
||||
return deviceMapper.insertDevice(device);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateDevice(WcsDevice device)
|
||||
{
|
||||
return deviceMapper.updateDevice(device);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteDeviceByIds(Long[] deviceIds)
|
||||
{
|
||||
return deviceMapper.deleteDeviceByIds(deviceIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkDeviceCodeUnique(WcsDevice device)
|
||||
{
|
||||
Long deviceId = StringUtils.isNull(device.getDeviceId()) ? -1L : device.getDeviceId();
|
||||
WcsDevice info = deviceMapper.checkDeviceCodeUnique(device.getDeviceCode());
|
||||
if (StringUtils.isNotNull(info) && info.getDeviceId().longValue() != deviceId.longValue())
|
||||
{
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
package com.ruoyi.wcs.flow.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.wcs.flow.domain.WcsFlowDef;
|
||||
import com.ruoyi.wcs.flow.service.IWcsFlowDefService;
|
||||
|
||||
/**
|
||||
* <20><><EFBFBD>̶<EFBFBD><CCB6><EFBFBD> Controller
|
||||
*
|
||||
* @author wcs
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/wcs/flow/def")
|
||||
public class WcsFlowDefController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IWcsFlowDefService flowDefService;
|
||||
|
||||
/**
|
||||
* <20><>ѯ<EFBFBD><D1AF><EFBFBD>̶<EFBFBD><CCB6><EFBFBD><EFBFBD>б<EFBFBD>
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wcs:flow:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(WcsFlowDef flowDef)
|
||||
{
|
||||
startPage();
|
||||
List<WcsFlowDef> list = flowDefService.selectFlowDefList(flowDef);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̶<EFBFBD><CCB6><EFBFBD><EFBFBD>б<EFBFBD>
|
||||
*/
|
||||
@Log(title = "<EFBFBD><EFBFBD><EFBFBD>̶<EFBFBD><EFBFBD><EFBFBD>", businessType = BusinessType.EXPORT)
|
||||
@PreAuthorize("@ss.hasPermi('wcs:flow:export')")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, WcsFlowDef flowDef)
|
||||
{
|
||||
List<WcsFlowDef> list = flowDefService.selectFlowDefList(flowDef);
|
||||
ExcelUtil<WcsFlowDef> util = new ExcelUtil<WcsFlowDef>(WcsFlowDef.class);
|
||||
util.exportExcel(response, list, "<EFBFBD><EFBFBD><EFBFBD>̶<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||
}
|
||||
|
||||
/**
|
||||
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ID<49><44>ȡ<EFBFBD><C8A1>ϸ<EFBFBD><CFB8>Ϣ
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wcs:flow:query')")
|
||||
@GetMapping(value = "/{flowId}")
|
||||
public AjaxResult getInfo(@PathVariable Long flowId)
|
||||
{
|
||||
return success(flowDefService.selectFlowDefById(flowId));
|
||||
}
|
||||
|
||||
/**
|
||||
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̶<EFBFBD><CCB6><EFBFBD>
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wcs:flow:add')")
|
||||
@Log(title = "<EFBFBD><EFBFBD><EFBFBD>̶<EFBFBD><EFBFBD><EFBFBD>", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody WcsFlowDef flowDef)
|
||||
{
|
||||
if (!flowDefService.checkFlowCodeUnique(flowDef))
|
||||
{
|
||||
return error("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'" + flowDef.getFlowCode() + "'ʧ<>ܣ<EFBFBD><DCA3><EFBFBD><EFBFBD>̱<EFBFBD><CCB1><EFBFBD><EFBFBD>Ѵ<EFBFBD><D1B4><EFBFBD>");
|
||||
}
|
||||
flowDef.setCreateBy(getUsername());
|
||||
return toAjax(flowDefService.insertFlowDef(flowDef));
|
||||
}
|
||||
|
||||
/**
|
||||
* <20><EFBFBD><DEB8><EFBFBD><EFBFBD>̶<EFBFBD><CCB6><EFBFBD>
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wcs:flow:edit')")
|
||||
@Log(title = "<EFBFBD><EFBFBD><EFBFBD>̶<EFBFBD><EFBFBD><EFBFBD>", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@Validated @RequestBody WcsFlowDef flowDef)
|
||||
{
|
||||
if (!flowDefService.checkFlowCodeUnique(flowDef))
|
||||
{
|
||||
return error("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'" + flowDef.getFlowCode() + "'ʧ<>ܣ<EFBFBD><DCA3><EFBFBD><EFBFBD>̱<EFBFBD><CCB1><EFBFBD><EFBFBD>Ѵ<EFBFBD><D1B4><EFBFBD>");
|
||||
}
|
||||
flowDef.setUpdateBy(getUsername());
|
||||
return toAjax(flowDefService.updateFlowDef(flowDef));
|
||||
}
|
||||
|
||||
/**
|
||||
* ɾ<><C9BE><EFBFBD><EFBFBD><EFBFBD>̶<EFBFBD><CCB6><EFBFBD>
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wcs:flow:remove')")
|
||||
@Log(title = "<EFBFBD><EFBFBD><EFBFBD>̶<EFBFBD><EFBFBD><EFBFBD>", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{flowIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] flowIds)
|
||||
{
|
||||
return toAjax(flowDefService.deleteFlowDefByIds(flowIds));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
package com.ruoyi.wcs.flow.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.wcs.flow.domain.WcsFlowInstance;
|
||||
import com.ruoyi.wcs.flow.engine.FlowEngineService;
|
||||
import com.ruoyi.wcs.flow.service.IWcsFlowInstanceService;
|
||||
|
||||
/**
|
||||
* <20><><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5> Controller
|
||||
*
|
||||
* @author wcs
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/wcs/flow/instance")
|
||||
public class WcsFlowInstanceController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IWcsFlowInstanceService flowInstanceService;
|
||||
|
||||
@Autowired
|
||||
private FlowEngineService flowEngineService;
|
||||
|
||||
/**
|
||||
* <20><>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5><EFBFBD>б<EFBFBD>
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wcs:flowinstance:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(WcsFlowInstance flowInstance)
|
||||
{
|
||||
startPage();
|
||||
List<WcsFlowInstance> list = flowInstanceService.selectFlowInstanceList(flowInstance);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5><EFBFBD>б<EFBFBD>
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wcs:flowinstance:export')")
|
||||
@Log(title = "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD><EFBFBD>", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, WcsFlowInstance flowInstance)
|
||||
{
|
||||
List<WcsFlowInstance> list = flowInstanceService.selectFlowInstanceList(flowInstance);
|
||||
ExcelUtil<WcsFlowInstance> util = new ExcelUtil<WcsFlowInstance>(WcsFlowInstance.class);
|
||||
util.exportExcel(response, list, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||
}
|
||||
|
||||
/**
|
||||
* <20><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD>ϸ<EFBFBD><CFB8>Ϣ
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wcs:flowinstance:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable Long id)
|
||||
{
|
||||
return success(flowInstanceService.selectFlowInstanceById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5>
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wcs:flowinstance:add')")
|
||||
@Log(title = "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD><EFBFBD>", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody WcsFlowInstance flowInstance)
|
||||
{
|
||||
flowInstance.setCreateBy(getUsername());
|
||||
return toAjax(flowInstanceService.insertFlowInstance(flowInstance));
|
||||
}
|
||||
|
||||
/**
|
||||
* <20><EFBFBD><DEB8><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5>
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wcs:flowinstance:edit')")
|
||||
@Log(title = "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD><EFBFBD>", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@Validated @RequestBody WcsFlowInstance flowInstance)
|
||||
{
|
||||
flowInstance.setUpdateBy(getUsername());
|
||||
return toAjax(flowInstanceService.updateFlowInstance(flowInstance));
|
||||
}
|
||||
|
||||
/**
|
||||
* ɾ<><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5>
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wcs:flowinstance:remove')")
|
||||
@Log(title = "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD><EFBFBD>", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(flowInstanceService.deleteFlowInstanceByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行流程
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wcs:flowinstance:execute')")
|
||||
@Log(title = "流程实例", businessType = BusinessType.OTHER)
|
||||
@PostMapping("/execute/{flowDefId}")
|
||||
public AjaxResult execute(@PathVariable Long flowDefId)
|
||||
{
|
||||
Long instanceId = flowEngineService.executeFlow(flowDefId);
|
||||
return AjaxResult.success("流程已启动", instanceId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
package com.ruoyi.wcs.flow.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.wcs.flow.domain.WcsFlowLine;
|
||||
import com.ruoyi.wcs.flow.service.IWcsFlowLineService;
|
||||
|
||||
/**
|
||||
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Controller
|
||||
*
|
||||
* @author wcs
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/wcs/flow/line")
|
||||
public class WcsFlowLineController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IWcsFlowLineService flowLineService;
|
||||
|
||||
/**
|
||||
* <20><>ѯָ<D1AF><D6B8><EFBFBD><EFBFBD><EFBFBD>̵<EFBFBD><CCB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wcs:flow:query')")
|
||||
@GetMapping("/list/{flowId}")
|
||||
public AjaxResult list(@PathVariable Long flowId)
|
||||
{
|
||||
List<WcsFlowLine> list = flowLineService.selectFlowLineListByFlowId(flowId);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* <20><><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD>̵<EFBFBD><CCB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>
|
||||
*/
|
||||
@Log(title = "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", businessType = BusinessType.EXPORT)
|
||||
@PreAuthorize("@ss.hasPermi('wcs:flow:export')")
|
||||
@PostMapping("/export/{flowId}")
|
||||
public void export(HttpServletResponse response, @PathVariable Long flowId)
|
||||
{
|
||||
List<WcsFlowLine> list = flowLineService.selectFlowLineListByFlowId(flowId);
|
||||
ExcelUtil<WcsFlowLine> util = new ExcelUtil<WcsFlowLine>(WcsFlowLine.class);
|
||||
util.exportExcel(response, list, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||
}
|
||||
|
||||
/**
|
||||
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wcs:flow:edit')")
|
||||
@Log(title = "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody WcsFlowLine flowLine)
|
||||
{
|
||||
return toAjax(flowLineService.insertFlowLine(flowLine));
|
||||
}
|
||||
|
||||
/**
|
||||
* ɾ<><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wcs:flow:edit')")
|
||||
@Log(title = "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{lineId}")
|
||||
public AjaxResult remove(@PathVariable Long lineId)
|
||||
{
|
||||
return toAjax(flowLineService.deleteFlowLineById(lineId));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
package com.ruoyi.wcs.flow.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.wcs.flow.domain.WcsFlowNodeLog;
|
||||
import com.ruoyi.wcs.flow.service.IWcsFlowNodeLogService;
|
||||
|
||||
/**
|
||||
* 流程节点执行日志 Controller
|
||||
*
|
||||
* @author wcs
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/wcs/flow/log")
|
||||
public class WcsFlowLogController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IWcsFlowNodeLogService wcsFlowNodeLogService;
|
||||
|
||||
/**
|
||||
* 查询流程节点日志列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wcs:flowlog:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(WcsFlowNodeLog wcsFlowNodeLog)
|
||||
{
|
||||
startPage();
|
||||
List<WcsFlowNodeLog> list = wcsFlowNodeLogService.selectFlowNodeLogList(wcsFlowNodeLog);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出流程节点日志列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wcs:flowlog:export')")
|
||||
@Log(title = "流程节点日志", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, WcsFlowNodeLog wcsFlowNodeLog)
|
||||
{
|
||||
List<WcsFlowNodeLog> list = wcsFlowNodeLogService.selectFlowNodeLogList(wcsFlowNodeLog);
|
||||
ExcelUtil<WcsFlowNodeLog> util = new ExcelUtil<WcsFlowNodeLog>(WcsFlowNodeLog.class);
|
||||
util.exportExcel(response, list, "流程节点日志数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取流程节点日志详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wcs:flowlog:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(wcsFlowNodeLogService.selectFlowNodeLogById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增流程节点日志
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wcs:flowlog:add')")
|
||||
@Log(title = "流程节点日志", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody WcsFlowNodeLog wcsFlowNodeLog)
|
||||
{
|
||||
wcsFlowNodeLog.setCreateBy(getUsername());
|
||||
return toAjax(wcsFlowNodeLogService.insertFlowNodeLog(wcsFlowNodeLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改流程节点日志
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wcs:flowlog:edit')")
|
||||
@Log(title = "流程节点日志", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@Validated @RequestBody WcsFlowNodeLog wcsFlowNodeLog)
|
||||
{
|
||||
wcsFlowNodeLog.setUpdateBy(getUsername());
|
||||
return toAjax(wcsFlowNodeLogService.updateFlowNodeLog(wcsFlowNodeLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除流程节点日志
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wcs:flowlog:remove')")
|
||||
@Log(title = "流程节点日志", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(wcsFlowNodeLogService.deleteFlowNodeLogByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
package com.ruoyi.wcs.flow.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.wcs.flow.domain.WcsFlowNode;
|
||||
import com.ruoyi.wcs.flow.service.IWcsFlowNodeService;
|
||||
|
||||
/**
|
||||
* <20><><EFBFBD>̽ڵ<CCBD> Controller
|
||||
*
|
||||
* @author wcs
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/wcs/flow/node")
|
||||
public class WcsFlowNodeController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IWcsFlowNodeService flowNodeService;
|
||||
|
||||
/**
|
||||
* <20><>ѯָ<D1AF><D6B8><EFBFBD><EFBFBD><EFBFBD>̵Ľڵ<C4BD><DAB5>б<EFBFBD>
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wcs:flow:query')")
|
||||
@GetMapping("/list/{flowId}")
|
||||
public AjaxResult list(@PathVariable Long flowId)
|
||||
{
|
||||
List<WcsFlowNode> list = flowNodeService.selectFlowNodeListByFlowId(flowId);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* <20><><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD>̵Ľڵ<C4BD><DAB5>б<EFBFBD>
|
||||
*/
|
||||
@Log(title = "<EFBFBD><EFBFBD><EFBFBD>̽ڵ<EFBFBD>", businessType = BusinessType.EXPORT)
|
||||
@PreAuthorize("@ss.hasPermi('wcs:flow:export')")
|
||||
@PostMapping("/export/{flowId}")
|
||||
public void export(HttpServletResponse response, @PathVariable Long flowId)
|
||||
{
|
||||
List<WcsFlowNode> list = flowNodeService.selectFlowNodeListByFlowId(flowId);
|
||||
ExcelUtil<WcsFlowNode> util = new ExcelUtil<WcsFlowNode>(WcsFlowNode.class);
|
||||
util.exportExcel(response, list, "<EFBFBD><EFBFBD><EFBFBD>̽ڵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||
}
|
||||
|
||||
/**
|
||||
* <20><><EFBFBD>ݽڵ<DDBD>ID<49><44>ȡ<EFBFBD><C8A1>ϸ<EFBFBD><CFB8>Ϣ
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wcs:flow:query')")
|
||||
@GetMapping(value = "/{nodeId}")
|
||||
public AjaxResult getInfo(@PathVariable Long nodeId)
|
||||
{
|
||||
return success(flowNodeService.selectFlowNodeById(nodeId));
|
||||
}
|
||||
|
||||
/**
|
||||
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̽ڵ<CCBD>
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wcs:flow:edit')")
|
||||
@Log(title = "<EFBFBD><EFBFBD><EFBFBD>̽ڵ<EFBFBD>", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody WcsFlowNode flowNode)
|
||||
{
|
||||
return toAjax(flowNodeService.insertFlowNode(flowNode));
|
||||
}
|
||||
|
||||
/**
|
||||
* <20><EFBFBD><DEB8><EFBFBD><EFBFBD>̽ڵ<CCBD>
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wcs:flow:edit')")
|
||||
@Log(title = "<EFBFBD><EFBFBD><EFBFBD>̽ڵ<EFBFBD>", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody WcsFlowNode flowNode)
|
||||
{
|
||||
return toAjax(flowNodeService.updateFlowNode(flowNode));
|
||||
}
|
||||
|
||||
/**
|
||||
* ɾ<><C9BE><EFBFBD><EFBFBD><EFBFBD>̽ڵ<CCBD>
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wcs:flow:edit')")
|
||||
@Log(title = "<EFBFBD><EFBFBD><EFBFBD>̽ڵ<EFBFBD>", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{nodeId}")
|
||||
public AjaxResult remove(@PathVariable Long nodeId)
|
||||
{
|
||||
return toAjax(flowNodeService.deleteFlowNodeById(nodeId));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,142 @@
|
||||
package com.ruoyi.wcs.flow.domain;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Size;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.annotation.Excel.ColumnType;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* <20><><EFBFBD>̶<EFBFBD><CCB6><EFBFBD><EFBFBD><EFBFBD> wcs_flow_def
|
||||
*
|
||||
* @author wcs
|
||||
*/
|
||||
public class WcsFlowDef extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Excel(name = "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ID", cellType = ColumnType.NUMERIC)
|
||||
private Long flowId;
|
||||
|
||||
@Excel(name = "<EFBFBD><EFBFBD><EFBFBD>̱<EFBFBD><EFBFBD><EFBFBD>")
|
||||
private String flowCode;
|
||||
|
||||
@Excel(name = "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>")
|
||||
private String flowName;
|
||||
|
||||
@Excel(name = "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>")
|
||||
private String flowType;
|
||||
|
||||
@Excel(name = "<EFBFBD>汾<EFBFBD><EFBFBD>", cellType = ColumnType.NUMERIC)
|
||||
private Integer version;
|
||||
|
||||
private String flowJson;
|
||||
|
||||
@Excel(name = "״̬", readConverterExp = "0=<3D>ݸ<EFBFBD>,1=<3D>ѷ<EFBFBD><D1B7><EFBFBD>,2=<3D><>ͣ<EFBFBD><CDA3>")
|
||||
private String status;
|
||||
|
||||
private String delFlag;
|
||||
|
||||
public Long getFlowId()
|
||||
{
|
||||
return flowId;
|
||||
}
|
||||
|
||||
public void setFlowId(Long flowId)
|
||||
{
|
||||
this.flowId = flowId;
|
||||
}
|
||||
|
||||
@NotBlank(message = "<EFBFBD><EFBFBD><EFBFBD>̱<EFBFBD><EFBFBD>벻<EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>")
|
||||
@Size(min = 0, max = 64, message = "<EFBFBD><EFBFBD><EFBFBD>̱<EFBFBD><EFBFBD>볤<EFBFBD>Ȳ<EFBFBD><EFBFBD>ܳ<EFBFBD><EFBFBD><EFBFBD>64<EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD>")
|
||||
public String getFlowCode()
|
||||
{
|
||||
return flowCode;
|
||||
}
|
||||
|
||||
public void setFlowCode(String flowCode)
|
||||
{
|
||||
this.flowCode = flowCode;
|
||||
}
|
||||
|
||||
@Size(min = 0, max = 128, message = "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƴ<EFBFBD><EFBFBD>Ȳ<EFBFBD><EFBFBD>ܳ<EFBFBD><EFBFBD><EFBFBD>128<EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD>")
|
||||
public String getFlowName()
|
||||
{
|
||||
return flowName;
|
||||
}
|
||||
|
||||
public void setFlowName(String flowName)
|
||||
{
|
||||
this.flowName = flowName;
|
||||
}
|
||||
|
||||
public String getFlowType()
|
||||
{
|
||||
return flowType;
|
||||
}
|
||||
|
||||
public void setFlowType(String flowType)
|
||||
{
|
||||
this.flowType = flowType;
|
||||
}
|
||||
|
||||
public Integer getVersion()
|
||||
{
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(Integer version)
|
||||
{
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public String getFlowJson()
|
||||
{
|
||||
return flowJson;
|
||||
}
|
||||
|
||||
public void setFlowJson(String flowJson)
|
||||
{
|
||||
this.flowJson = flowJson;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getDelFlag()
|
||||
{
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
public void setDelFlag(String delFlag)
|
||||
{
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("flowId", getFlowId())
|
||||
.append("flowCode", getFlowCode())
|
||||
.append("flowName", getFlowName())
|
||||
.append("flowType", getFlowType())
|
||||
.append("version", getVersion())
|
||||
.append("status", getStatus())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
package com.ruoyi.wcs.flow.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.annotation.Excel.ColumnType;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* <20><><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD> wcs_flow_instance
|
||||
*
|
||||
* @author wcs
|
||||
*/
|
||||
public class WcsFlowInstance extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Excel(name = "ʵ<EFBFBD><EFBFBD>ID", cellType = ColumnType.NUMERIC)
|
||||
private Long id;
|
||||
|
||||
@Excel(name = "<EFBFBD><EFBFBD><EFBFBD>̶<EFBFBD><EFBFBD><EFBFBD>ID", cellType = ColumnType.NUMERIC)
|
||||
private Long flowDefId;
|
||||
|
||||
@Excel(name = "״̬", readConverterExp = "0=<3D><>ִ<EFBFBD><D6B4>,1=ִ<><D6B4><EFBFBD><EFBFBD>,2=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,3=<3D>쳣<EFBFBD><ECB3A3>ֹ")
|
||||
private String status;
|
||||
|
||||
@Excel(name = "<EFBFBD><EFBFBD>ʼʱ<EFBFBD><EFBFBD>", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date startTime;
|
||||
|
||||
@Excel(name = "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date endTime;
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getFlowDefId()
|
||||
{
|
||||
return flowDefId;
|
||||
}
|
||||
|
||||
public void setFlowDefId(Long flowDefId)
|
||||
{
|
||||
this.flowDefId = flowDefId;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Date getStartTime()
|
||||
{
|
||||
return startTime;
|
||||
}
|
||||
|
||||
public void setStartTime(Date startTime)
|
||||
{
|
||||
this.startTime = startTime;
|
||||
}
|
||||
|
||||
public Date getEndTime()
|
||||
{
|
||||
return endTime;
|
||||
}
|
||||
|
||||
public void setEndTime(Date endTime)
|
||||
{
|
||||
this.endTime = endTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("flowDefId", getFlowDefId())
|
||||
.append("status", getStatus())
|
||||
.append("startTime", getStartTime())
|
||||
.append("endTime", getEndTime())
|
||||
.append("remark", getRemark())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
package com.ruoyi.wcs.flow.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.annotation.Excel.ColumnType;
|
||||
|
||||
/**
|
||||
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߱<EFBFBD> wcs_flow_line
|
||||
*
|
||||
* @author wcs
|
||||
*/
|
||||
public class WcsFlowLine
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Excel(name = "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ID", cellType = ColumnType.NUMERIC)
|
||||
private Long lineId;
|
||||
|
||||
@Excel(name = "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ID", cellType = ColumnType.NUMERIC)
|
||||
private Long flowId;
|
||||
|
||||
@Excel(name = "Դ<EFBFBD>ڵ<EFBFBD>ID", cellType = ColumnType.NUMERIC)
|
||||
private Long sourceNodeId;
|
||||
|
||||
@Excel(name = "Ŀ<EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD>ID", cellType = ColumnType.NUMERIC)
|
||||
private Long targetNodeId;
|
||||
|
||||
private String conditionExpr;
|
||||
|
||||
private String lineLabel;
|
||||
|
||||
private Integer sortOrder;
|
||||
|
||||
private Date createTime;
|
||||
|
||||
public Long getLineId()
|
||||
{
|
||||
return lineId;
|
||||
}
|
||||
|
||||
public void setLineId(Long lineId)
|
||||
{
|
||||
this.lineId = lineId;
|
||||
}
|
||||
|
||||
public Long getFlowId()
|
||||
{
|
||||
return flowId;
|
||||
}
|
||||
|
||||
public void setFlowId(Long flowId)
|
||||
{
|
||||
this.flowId = flowId;
|
||||
}
|
||||
|
||||
public Long getSourceNodeId()
|
||||
{
|
||||
return sourceNodeId;
|
||||
}
|
||||
|
||||
public void setSourceNodeId(Long sourceNodeId)
|
||||
{
|
||||
this.sourceNodeId = sourceNodeId;
|
||||
}
|
||||
|
||||
public Long getTargetNodeId()
|
||||
{
|
||||
return targetNodeId;
|
||||
}
|
||||
|
||||
public void setTargetNodeId(Long targetNodeId)
|
||||
{
|
||||
this.targetNodeId = targetNodeId;
|
||||
}
|
||||
|
||||
public String getConditionExpr()
|
||||
{
|
||||
return conditionExpr;
|
||||
}
|
||||
|
||||
public void setConditionExpr(String conditionExpr)
|
||||
{
|
||||
this.conditionExpr = conditionExpr;
|
||||
}
|
||||
|
||||
public String getLineLabel()
|
||||
{
|
||||
return lineLabel;
|
||||
}
|
||||
|
||||
public void setLineLabel(String lineLabel)
|
||||
{
|
||||
this.lineLabel = lineLabel;
|
||||
}
|
||||
|
||||
public Integer getSortOrder()
|
||||
{
|
||||
return sortOrder;
|
||||
}
|
||||
|
||||
public void setSortOrder(Integer sortOrder)
|
||||
{
|
||||
this.sortOrder = sortOrder;
|
||||
}
|
||||
|
||||
public Date getCreateTime()
|
||||
{
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime)
|
||||
{
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("lineId", getLineId())
|
||||
.append("flowId", getFlowId())
|
||||
.append("sourceNodeId", getSourceNodeId())
|
||||
.append("targetNodeId", getTargetNodeId())
|
||||
.append("conditionExpr", getConditionExpr())
|
||||
.append("lineLabel", getLineLabel())
|
||||
.append("sortOrder", getSortOrder())
|
||||
.append("createTime", getCreateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,184 @@
|
||||
package com.ruoyi.wcs.flow.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.annotation.Excel.ColumnType;
|
||||
|
||||
/**
|
||||
* <20><><EFBFBD>̽ڵ<CCBD><DAB5><EFBFBD> wcs_flow_node
|
||||
*
|
||||
* @author wcs
|
||||
*/
|
||||
public class WcsFlowNode
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Excel(name = "<EFBFBD>ڵ<EFBFBD>ID", cellType = ColumnType.NUMERIC)
|
||||
private Long nodeId;
|
||||
|
||||
@Excel(name = "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ID", cellType = ColumnType.NUMERIC)
|
||||
private Long flowId;
|
||||
|
||||
@Excel(name = "<EFBFBD>ڵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>")
|
||||
private String nodeCode;
|
||||
|
||||
@Excel(name = "<EFBFBD>ڵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>")
|
||||
private String nodeName;
|
||||
|
||||
@Excel(name = "<EFBFBD>ڵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>")
|
||||
private String nodeType;
|
||||
|
||||
private String handlerClass;
|
||||
|
||||
private String configJson;
|
||||
|
||||
private Integer posX;
|
||||
|
||||
private Integer posY;
|
||||
|
||||
private Integer sortOrder;
|
||||
|
||||
private Date createTime;
|
||||
|
||||
private Date updateTime;
|
||||
|
||||
public Long getNodeId()
|
||||
{
|
||||
return nodeId;
|
||||
}
|
||||
|
||||
public void setNodeId(Long nodeId)
|
||||
{
|
||||
this.nodeId = nodeId;
|
||||
}
|
||||
|
||||
public Long getFlowId()
|
||||
{
|
||||
return flowId;
|
||||
}
|
||||
|
||||
public void setFlowId(Long flowId)
|
||||
{
|
||||
this.flowId = flowId;
|
||||
}
|
||||
|
||||
public String getNodeCode()
|
||||
{
|
||||
return nodeCode;
|
||||
}
|
||||
|
||||
public void setNodeCode(String nodeCode)
|
||||
{
|
||||
this.nodeCode = nodeCode;
|
||||
}
|
||||
|
||||
public String getNodeName()
|
||||
{
|
||||
return nodeName;
|
||||
}
|
||||
|
||||
public void setNodeName(String nodeName)
|
||||
{
|
||||
this.nodeName = nodeName;
|
||||
}
|
||||
|
||||
public String getNodeType()
|
||||
{
|
||||
return nodeType;
|
||||
}
|
||||
|
||||
public void setNodeType(String nodeType)
|
||||
{
|
||||
this.nodeType = nodeType;
|
||||
}
|
||||
|
||||
public String getHandlerClass()
|
||||
{
|
||||
return handlerClass;
|
||||
}
|
||||
|
||||
public void setHandlerClass(String handlerClass)
|
||||
{
|
||||
this.handlerClass = handlerClass;
|
||||
}
|
||||
|
||||
public String getConfigJson()
|
||||
{
|
||||
return configJson;
|
||||
}
|
||||
|
||||
public void setConfigJson(String configJson)
|
||||
{
|
||||
this.configJson = configJson;
|
||||
}
|
||||
|
||||
public Integer getPosX()
|
||||
{
|
||||
return posX;
|
||||
}
|
||||
|
||||
public void setPosX(Integer posX)
|
||||
{
|
||||
this.posX = posX;
|
||||
}
|
||||
|
||||
public Integer getPosY()
|
||||
{
|
||||
return posY;
|
||||
}
|
||||
|
||||
public void setPosY(Integer posY)
|
||||
{
|
||||
this.posY = posY;
|
||||
}
|
||||
|
||||
public Integer getSortOrder()
|
||||
{
|
||||
return sortOrder;
|
||||
}
|
||||
|
||||
public void setSortOrder(Integer sortOrder)
|
||||
{
|
||||
this.sortOrder = sortOrder;
|
||||
}
|
||||
|
||||
public Date getCreateTime()
|
||||
{
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime)
|
||||
{
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public Date getUpdateTime()
|
||||
{
|
||||
return updateTime;
|
||||
}
|
||||
|
||||
public void setUpdateTime(Date updateTime)
|
||||
{
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("nodeId", getNodeId())
|
||||
.append("flowId", getFlowId())
|
||||
.append("nodeCode", getNodeCode())
|
||||
.append("nodeName", getNodeName())
|
||||
.append("nodeType", getNodeType())
|
||||
.append("handlerClass", getHandlerClass())
|
||||
.append("posX", getPosX())
|
||||
.append("posY", getPosY())
|
||||
.append("sortOrder", getSortOrder())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,168 @@
|
||||
package com.ruoyi.wcs.flow.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.annotation.Excel.ColumnType;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* <20><><EFBFBD>̽ڵ<CCBD>ִ<EFBFBD><D6B4><EFBFBD><EFBFBD>־<EFBFBD><D6BE> wcs_flow_node_log
|
||||
*
|
||||
* @author wcs
|
||||
*/
|
||||
public class WcsFlowNodeLog extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Excel(name = "<EFBFBD><EFBFBD>־ID", cellType = ColumnType.NUMERIC)
|
||||
private Long id;
|
||||
|
||||
@Excel(name = "ʵ<EFBFBD><EFBFBD>ID", cellType = ColumnType.NUMERIC)
|
||||
private Long instanceId;
|
||||
|
||||
@Excel(name = "<EFBFBD>ڵ<EFBFBD>ID")
|
||||
private String nodeId;
|
||||
|
||||
@Excel(name = "<EFBFBD>ڵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>")
|
||||
private String nodeType;
|
||||
|
||||
@Excel(name = "״̬", readConverterExp = "0=<3D><>ִ<EFBFBD><D6B4>,1=ִ<><D6B4><EFBFBD><EFBFBD>,2=<3D>ɹ<EFBFBD>,3=ʧ<><CAA7>,4=<3D><><EFBFBD><EFBFBD>")
|
||||
private String status;
|
||||
|
||||
private String input;
|
||||
|
||||
private String output;
|
||||
|
||||
@Excel(name = "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ")
|
||||
private String errorMsg;
|
||||
|
||||
@Excel(name = "<EFBFBD><EFBFBD>ʼʱ<EFBFBD><EFBFBD>", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date startTime;
|
||||
|
||||
@Excel(name = "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date endTime;
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getInstanceId()
|
||||
{
|
||||
return instanceId;
|
||||
}
|
||||
|
||||
public void setInstanceId(Long instanceId)
|
||||
{
|
||||
this.instanceId = instanceId;
|
||||
}
|
||||
|
||||
public String getNodeId()
|
||||
{
|
||||
return nodeId;
|
||||
}
|
||||
|
||||
public void setNodeId(String nodeId)
|
||||
{
|
||||
this.nodeId = nodeId;
|
||||
}
|
||||
|
||||
public String getNodeType()
|
||||
{
|
||||
return nodeType;
|
||||
}
|
||||
|
||||
public void setNodeType(String nodeType)
|
||||
{
|
||||
this.nodeType = nodeType;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getInput()
|
||||
{
|
||||
return input;
|
||||
}
|
||||
|
||||
public void setInput(String input)
|
||||
{
|
||||
this.input = input;
|
||||
}
|
||||
|
||||
public String getOutput()
|
||||
{
|
||||
return output;
|
||||
}
|
||||
|
||||
public void setOutput(String output)
|
||||
{
|
||||
this.output = output;
|
||||
}
|
||||
|
||||
public String getErrorMsg()
|
||||
{
|
||||
return errorMsg;
|
||||
}
|
||||
|
||||
public void setErrorMsg(String errorMsg)
|
||||
{
|
||||
this.errorMsg = errorMsg;
|
||||
}
|
||||
|
||||
public Date getStartTime()
|
||||
{
|
||||
return startTime;
|
||||
}
|
||||
|
||||
public void setStartTime(Date startTime)
|
||||
{
|
||||
this.startTime = startTime;
|
||||
}
|
||||
|
||||
public Date getEndTime()
|
||||
{
|
||||
return endTime;
|
||||
}
|
||||
|
||||
public void setEndTime(Date endTime)
|
||||
{
|
||||
this.endTime = endTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("instanceId", getInstanceId())
|
||||
.append("nodeId", getNodeId())
|
||||
.append("nodeType", getNodeType())
|
||||
.append("status", getStatus())
|
||||
.append("input", getInput())
|
||||
.append("output", getOutput())
|
||||
.append("errorMsg", getErrorMsg())
|
||||
.append("startTime", getStartTime())
|
||||
.append("endTime", getEndTime())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,246 @@
|
||||
package com.ruoyi.wcs.flow.engine;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import com.ruoyi.wcs.flow.domain.*;
|
||||
import com.ruoyi.wcs.flow.service.*;
|
||||
|
||||
/**
|
||||
* WCS 轻量流程执行引擎
|
||||
* 按流程定义依次执行节点,记录实例和节点日志
|
||||
*
|
||||
* @author wcs
|
||||
*/
|
||||
@Service
|
||||
public class FlowEngineService
|
||||
{
|
||||
private static final Logger log = LoggerFactory.getLogger(FlowEngineService.class);
|
||||
|
||||
private Map<String, INodeHandler> handlerMap = new HashMap<>();
|
||||
|
||||
@Autowired
|
||||
private IWcsFlowDefService flowDefService;
|
||||
|
||||
@Autowired
|
||||
private IWcsFlowNodeService flowNodeService;
|
||||
|
||||
@Autowired
|
||||
private IWcsFlowLineService flowLineService;
|
||||
|
||||
@Autowired
|
||||
private IWcsFlowInstanceService flowInstanceService;
|
||||
|
||||
@Autowired
|
||||
private IWcsFlowNodeLogService flowNodeLogService;
|
||||
|
||||
@Autowired
|
||||
public void setHandlers(List<INodeHandler> handlers)
|
||||
{
|
||||
for (INodeHandler handler : handlers)
|
||||
{
|
||||
handlerMap.put(handler.getNodeType(), handler);
|
||||
}
|
||||
log.info("[FlowEngine] 已注册 {} 个节点处理器: {}", handlerMap.size(), handlerMap.keySet());
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行流程
|
||||
*
|
||||
* @param flowDefId 流程定义ID
|
||||
* @return 流程实例ID
|
||||
*/
|
||||
@Transactional
|
||||
public Long executeFlow(Long flowDefId)
|
||||
{
|
||||
// 1. 查询流程定义
|
||||
WcsFlowDef flowDef = flowDefService.selectFlowDefById(flowDefId);
|
||||
if (flowDef == null)
|
||||
{
|
||||
throw new RuntimeException("流程定义不存在: " + flowDefId);
|
||||
}
|
||||
if (!"1".equals(flowDef.getStatus()))
|
||||
{
|
||||
throw new RuntimeException("流程未发布,无法执行: " + flowDef.getFlowCode());
|
||||
}
|
||||
|
||||
// 2. 创建流程实例
|
||||
WcsFlowInstance instance = new WcsFlowInstance();
|
||||
instance.setFlowDefId(flowDefId);
|
||||
instance.setStatus("1"); // 执行中
|
||||
instance.setStartTime(new Date());
|
||||
flowInstanceService.insertFlowInstance(instance);
|
||||
Long instanceId = instance.getId();
|
||||
log.info("[FlowEngine] 流程实例创建: instanceId={}, flowCode={}", instanceId, flowDef.getFlowCode());
|
||||
|
||||
// 3. 加载节点和连线
|
||||
List<WcsFlowNode> nodes = flowNodeService.selectFlowNodeListByFlowId(flowDefId);
|
||||
List<WcsFlowLine> lines = flowLineService.selectFlowLineListByFlowId(flowDefId);
|
||||
|
||||
// 按nodeId建索引
|
||||
Map<Long, WcsFlowNode> nodeMap = nodes.stream()
|
||||
.collect(Collectors.toMap(WcsFlowNode::getNodeId, n -> n));
|
||||
|
||||
// 4. 找到开始节点
|
||||
WcsFlowNode currentNode = findStartNode(nodes);
|
||||
if (currentNode == null)
|
||||
{
|
||||
updateInstanceStatus(instance, "3", "未找到开始节点");
|
||||
throw new RuntimeException("流程缺少开始节点: " + flowDef.getFlowCode());
|
||||
}
|
||||
|
||||
// 5. 执行上下文
|
||||
Map<String, Object> context = new HashMap<>();
|
||||
context.put("flowDefId", flowDefId);
|
||||
context.put("instanceId", instanceId);
|
||||
|
||||
// 6. 按连线顺序执行
|
||||
int maxSteps = 100; // 防止死循环
|
||||
int step = 0;
|
||||
try
|
||||
{
|
||||
while (currentNode != null && step < maxSteps)
|
||||
{
|
||||
step++;
|
||||
log.info("[FlowEngine] 执行节点: step={}, nodeId={}, type={}, name={}",
|
||||
step, currentNode.getNodeId(), currentNode.getNodeType(), currentNode.getNodeName());
|
||||
|
||||
// 记录节点日志-开始
|
||||
WcsFlowNodeLog nodeLog = new WcsFlowNodeLog();
|
||||
nodeLog.setInstanceId(instanceId);
|
||||
nodeLog.setNodeId(String.valueOf(currentNode.getNodeId()));
|
||||
nodeLog.setNodeType(currentNode.getNodeType());
|
||||
nodeLog.setStatus("1"); // 执行中
|
||||
nodeLog.setStartTime(new Date());
|
||||
flowNodeLogService.insertFlowNodeLog(nodeLog);
|
||||
|
||||
// 获取handler
|
||||
INodeHandler handler = getHandler(currentNode.getNodeType());
|
||||
if (handler == null)
|
||||
{
|
||||
nodeLog.setStatus("3"); // 失败
|
||||
nodeLog.setErrorMsg("未找到节点处理器: " + currentNode.getNodeType());
|
||||
nodeLog.setEndTime(new Date());
|
||||
flowNodeLogService.updateFlowNodeLog(nodeLog);
|
||||
updateInstanceStatus(instance, "3", nodeLog.getErrorMsg());
|
||||
return instanceId;
|
||||
}
|
||||
|
||||
// 执行节点
|
||||
NodeResult result = handler.execute(currentNode.getConfigJson(), context);
|
||||
|
||||
// 更新节点日志
|
||||
nodeLog.setEndTime(new Date());
|
||||
if (result.isSuccess())
|
||||
{
|
||||
nodeLog.setStatus("2"); // 成功
|
||||
nodeLog.setOutput(result.getOutput());
|
||||
}
|
||||
else
|
||||
{
|
||||
nodeLog.setStatus("3"); // 失败
|
||||
nodeLog.setErrorMsg(result.getErrorMsg());
|
||||
flowNodeLogService.updateFlowNodeLog(nodeLog);
|
||||
updateInstanceStatus(instance, "3", result.getErrorMsg());
|
||||
return instanceId;
|
||||
}
|
||||
flowNodeLogService.updateFlowNodeLog(nodeLog);
|
||||
|
||||
// end节点,流程结束
|
||||
if ("end".equals(currentNode.getNodeType()))
|
||||
{
|
||||
log.info("[FlowEngine] 流程执行完成: instanceId={}", instanceId);
|
||||
updateInstanceStatus(instance, "2", null); // 已完成
|
||||
return instanceId;
|
||||
}
|
||||
|
||||
// 找下一个节点
|
||||
currentNode = findNextNode(currentNode, result, lines, nodeMap);
|
||||
}
|
||||
|
||||
// 超过最大步数
|
||||
if (step >= maxSteps)
|
||||
{
|
||||
updateInstanceStatus(instance, "3", "超过最大执行步数: " + maxSteps);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.error("[FlowEngine] 流程执行异常: instanceId={}", instanceId, e);
|
||||
updateInstanceStatus(instance, "3", e.getMessage());
|
||||
}
|
||||
|
||||
return instanceId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 找开始节点
|
||||
*/
|
||||
private WcsFlowNode findStartNode(List<WcsFlowNode> nodes)
|
||||
{
|
||||
return nodes.stream()
|
||||
.filter(n -> "start".equals(n.getNodeType()))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据连线找下一个节点
|
||||
*/
|
||||
private WcsFlowNode findNextNode(WcsFlowNode current, NodeResult result,
|
||||
List<WcsFlowLine> lines, Map<Long, WcsFlowNode> nodeMap)
|
||||
{
|
||||
List<WcsFlowLine> outLines = lines.stream()
|
||||
.filter(l -> current.getNodeId().equals(l.getSourceNodeId()))
|
||||
.sorted(Comparator.comparingInt(l -> l.getSortOrder() != null ? l.getSortOrder() : 0))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
if (outLines.isEmpty())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
// condition节点:按branchKey匹配conditionExpr
|
||||
if ("condition".equals(current.getNodeType()) && result.getBranchKey() != null)
|
||||
{
|
||||
for (WcsFlowLine line : outLines)
|
||||
{
|
||||
if (result.getBranchKey().equals(line.getConditionExpr()))
|
||||
{
|
||||
return nodeMap.get(line.getTargetNodeId());
|
||||
}
|
||||
}
|
||||
// 没匹配到,走第一条(默认分支)
|
||||
log.warn("[FlowEngine] 条件分支未匹配, branchKey={}, 走默认分支", result.getBranchKey());
|
||||
}
|
||||
|
||||
// 非condition节点或默认:走第一条连线
|
||||
return nodeMap.get(outLines.get(0).getTargetNodeId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取节点处理器
|
||||
*/
|
||||
private INodeHandler getHandler(String nodeType)
|
||||
{
|
||||
return handlerMap.get(nodeType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新流程实例状态
|
||||
*/
|
||||
private void updateInstanceStatus(WcsFlowInstance instance, String status, String remark)
|
||||
{
|
||||
instance.setStatus(status);
|
||||
instance.setEndTime(new Date());
|
||||
if (remark != null)
|
||||
{
|
||||
instance.setRemark(remark);
|
||||
}
|
||||
flowInstanceService.updateFlowInstance(instance);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.ruoyi.wcs.flow.engine;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 流程节点处理器接口
|
||||
* 每种节点类型(start/api/plc/condition/wait/end)各实现一个
|
||||
*/
|
||||
public interface INodeHandler
|
||||
{
|
||||
/**
|
||||
* 获取节点类型标识
|
||||
*/
|
||||
String getNodeType();
|
||||
|
||||
/**
|
||||
* 执行节点逻辑
|
||||
*
|
||||
* @param configJson 节点配置JSON
|
||||
* @param context 流程上下文(可传递变量)
|
||||
* @return 执行结果,包含 success 标志和输出数据
|
||||
*/
|
||||
NodeResult execute(String configJson, Map<String, Object> context);
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.ruoyi.wcs.flow.engine;
|
||||
|
||||
/**
|
||||
* 节点执行结果
|
||||
*/
|
||||
public class NodeResult
|
||||
{
|
||||
/** 是否成功 */
|
||||
private boolean success;
|
||||
|
||||
/** 输出数据(JSON字符串) */
|
||||
private String output;
|
||||
|
||||
/** 错误信息 */
|
||||
private String errorMsg;
|
||||
|
||||
/** 下一个节点的条件分支标识(condition节点用) */
|
||||
private String branchKey;
|
||||
|
||||
public static NodeResult ok(String output)
|
||||
{
|
||||
NodeResult r = new NodeResult();
|
||||
r.success = true;
|
||||
r.output = output;
|
||||
return r;
|
||||
}
|
||||
|
||||
public static NodeResult fail(String errorMsg)
|
||||
{
|
||||
NodeResult r = new NodeResult();
|
||||
r.success = false;
|
||||
r.errorMsg = errorMsg;
|
||||
return r;
|
||||
}
|
||||
|
||||
public boolean isSuccess() { return success; }
|
||||
public void setSuccess(boolean success) { this.success = success; }
|
||||
public String getOutput() { return output; }
|
||||
public void setOutput(String output) { this.output = output; }
|
||||
public String getErrorMsg() { return errorMsg; }
|
||||
public void setErrorMsg(String errorMsg) { this.errorMsg = errorMsg; }
|
||||
public String getBranchKey() { return branchKey; }
|
||||
public void setBranchKey(String branchKey) { this.branchKey = branchKey; }
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.ruoyi.wcs.flow.engine.handler;
|
||||
|
||||
import java.util.Map;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
import com.ruoyi.wcs.flow.engine.INodeHandler;
|
||||
import com.ruoyi.wcs.flow.engine.NodeResult;
|
||||
|
||||
/**
|
||||
* API调用节点处理器
|
||||
* TODO: 后续对接 WcsApiConfig,通过 RestTemplate 调用外部接口
|
||||
*/
|
||||
@Component
|
||||
public class ApiNodeHandler implements INodeHandler
|
||||
{
|
||||
private static final Logger log = LoggerFactory.getLogger(ApiNodeHandler.class);
|
||||
|
||||
@Override
|
||||
public String getNodeType() { return "api"; }
|
||||
|
||||
@Override
|
||||
public NodeResult execute(String configJson, Map<String, Object> context)
|
||||
{
|
||||
log.info("[FlowEngine] API调用节点执行, config={}", configJson);
|
||||
// TODO: 解析 configJson 获取 apiCode,查询 WcsApiConfig,发起 HTTP 请求
|
||||
return NodeResult.ok("{\"msg\":\"api call stub\"}");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.ruoyi.wcs.flow.engine.handler;
|
||||
|
||||
import java.util.Map;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
import com.ruoyi.wcs.flow.engine.INodeHandler;
|
||||
import com.ruoyi.wcs.flow.engine.NodeResult;
|
||||
|
||||
/**
|
||||
* 条件判断节点处理器
|
||||
* TODO: 后续解析 conditionExpr 表达式,返回分支标识
|
||||
*/
|
||||
@Component
|
||||
public class ConditionNodeHandler implements INodeHandler
|
||||
{
|
||||
private static final Logger log = LoggerFactory.getLogger(ConditionNodeHandler.class);
|
||||
|
||||
@Override
|
||||
public String getNodeType() { return "condition"; }
|
||||
|
||||
@Override
|
||||
public NodeResult execute(String configJson, Map<String, Object> context)
|
||||
{
|
||||
log.info("[FlowEngine] 条件判断节点执行, config={}", configJson);
|
||||
// TODO: 解析条件表达式,根据 context 变量判断走哪个分支
|
||||
NodeResult result = NodeResult.ok("condition evaluated");
|
||||
result.setBranchKey("default");
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.ruoyi.wcs.flow.engine.handler;
|
||||
|
||||
import java.util.Map;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
import com.ruoyi.wcs.flow.engine.INodeHandler;
|
||||
import com.ruoyi.wcs.flow.engine.NodeResult;
|
||||
|
||||
/**
|
||||
* 结束节点处理器
|
||||
*/
|
||||
@Component
|
||||
public class EndNodeHandler implements INodeHandler
|
||||
{
|
||||
private static final Logger log = LoggerFactory.getLogger(EndNodeHandler.class);
|
||||
|
||||
@Override
|
||||
public String getNodeType() { return "end"; }
|
||||
|
||||
@Override
|
||||
public NodeResult execute(String configJson, Map<String, Object> context)
|
||||
{
|
||||
log.info("[FlowEngine] 结束节点执行");
|
||||
return NodeResult.ok("flow ended");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.ruoyi.wcs.flow.engine.handler;
|
||||
|
||||
import java.util.Map;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
import com.ruoyi.wcs.flow.engine.INodeHandler;
|
||||
import com.ruoyi.wcs.flow.engine.NodeResult;
|
||||
|
||||
/**
|
||||
* PLC读写节点处理器
|
||||
* TODO: 后续对接 PLC 统一读写服务
|
||||
*/
|
||||
@Component
|
||||
public class PlcNodeHandler implements INodeHandler
|
||||
{
|
||||
private static final Logger log = LoggerFactory.getLogger(PlcNodeHandler.class);
|
||||
|
||||
@Override
|
||||
public String getNodeType() { return "plc"; }
|
||||
|
||||
@Override
|
||||
public NodeResult execute(String configJson, Map<String, Object> context)
|
||||
{
|
||||
log.info("[FlowEngine] PLC读写节点执行, config={}", configJson);
|
||||
// TODO: 解析 configJson 获取设备点位,读写 PLC
|
||||
return NodeResult.ok("{\"msg\":\"plc rw stub\"}");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.ruoyi.wcs.flow.engine.handler;
|
||||
|
||||
import java.util.Map;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
import com.ruoyi.wcs.flow.engine.INodeHandler;
|
||||
import com.ruoyi.wcs.flow.engine.NodeResult;
|
||||
|
||||
/**
|
||||
* 开始节点处理器
|
||||
*/
|
||||
@Component
|
||||
public class StartNodeHandler implements INodeHandler
|
||||
{
|
||||
private static final Logger log = LoggerFactory.getLogger(StartNodeHandler.class);
|
||||
|
||||
@Override
|
||||
public String getNodeType() { return "start"; }
|
||||
|
||||
@Override
|
||||
public NodeResult execute(String configJson, Map<String, Object> context)
|
||||
{
|
||||
log.info("[FlowEngine] 开始节点执行");
|
||||
return NodeResult.ok("flow started");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.ruoyi.wcs.flow.engine.handler;
|
||||
|
||||
import java.util.Map;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
import com.ruoyi.wcs.flow.engine.INodeHandler;
|
||||
import com.ruoyi.wcs.flow.engine.NodeResult;
|
||||
|
||||
/**
|
||||
* 等待节点处理器
|
||||
* TODO: 后续实现轮询等待条件满足(如等待PLC信号)
|
||||
*/
|
||||
@Component
|
||||
public class WaitNodeHandler implements INodeHandler
|
||||
{
|
||||
private static final Logger log = LoggerFactory.getLogger(WaitNodeHandler.class);
|
||||
|
||||
@Override
|
||||
public String getNodeType() { return "wait"; }
|
||||
|
||||
@Override
|
||||
public NodeResult execute(String configJson, Map<String, Object> context)
|
||||
{
|
||||
log.info("[FlowEngine] 等待节点执行, config={}", configJson);
|
||||
// TODO: 解析等待条件,轮询直到满足或超时
|
||||
return NodeResult.ok("wait completed");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.ruoyi.wcs.flow.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.wcs.flow.domain.WcsFlowDef;
|
||||
|
||||
/**
|
||||
* <20><><EFBFBD>̶<EFBFBD><CCB6><EFBFBD> <20><><EFBFBD>ݲ<EFBFBD>
|
||||
*
|
||||
* @author wcs
|
||||
*/
|
||||
public interface WcsFlowDefMapper
|
||||
{
|
||||
public List<WcsFlowDef> selectFlowDefList(WcsFlowDef flowDef);
|
||||
|
||||
public WcsFlowDef selectFlowDefById(Long flowId);
|
||||
|
||||
public int insertFlowDef(WcsFlowDef flowDef);
|
||||
|
||||
public int updateFlowDef(WcsFlowDef flowDef);
|
||||
|
||||
public int deleteFlowDefById(Long flowId);
|
||||
|
||||
public int deleteFlowDefByIds(Long[] flowIds);
|
||||
|
||||
public WcsFlowDef checkFlowCodeUnique(String flowCode);
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.ruoyi.wcs.flow.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.wcs.flow.domain.WcsFlowInstance;
|
||||
|
||||
/**
|
||||
* <20><><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5> <20><><EFBFBD>ݲ<EFBFBD>
|
||||
*
|
||||
* @author wcs
|
||||
*/
|
||||
public interface WcsFlowInstanceMapper
|
||||
{
|
||||
public List<WcsFlowInstance> selectFlowInstanceList(WcsFlowInstance flowInstance);
|
||||
|
||||
public WcsFlowInstance selectFlowInstanceById(Long id);
|
||||
|
||||
public int insertFlowInstance(WcsFlowInstance flowInstance);
|
||||
|
||||
public int updateFlowInstance(WcsFlowInstance flowInstance);
|
||||
|
||||
public int deleteFlowInstanceById(Long id);
|
||||
|
||||
public int deleteFlowInstanceByIds(Long[] ids);
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.ruoyi.wcs.flow.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.wcs.flow.domain.WcsFlowLine;
|
||||
|
||||
/**
|
||||
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>ݲ<EFBFBD>
|
||||
*
|
||||
* @author wcs
|
||||
*/
|
||||
public interface WcsFlowLineMapper
|
||||
{
|
||||
public List<WcsFlowLine> selectFlowLineListByFlowId(Long flowId);
|
||||
|
||||
public WcsFlowLine selectFlowLineById(Long lineId);
|
||||
|
||||
public int insertFlowLine(WcsFlowLine flowLine);
|
||||
|
||||
public int deleteFlowLineById(Long lineId);
|
||||
|
||||
public int deleteFlowLineByFlowId(Long flowId);
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.ruoyi.wcs.flow.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.wcs.flow.domain.WcsFlowNodeLog;
|
||||
|
||||
/**
|
||||
* <20><><EFBFBD>̽ڵ<CCBD>ִ<EFBFBD><D6B4><EFBFBD><EFBFBD>־ <20><><EFBFBD>ݲ<EFBFBD>
|
||||
*
|
||||
* @author wcs
|
||||
*/
|
||||
public interface WcsFlowNodeLogMapper
|
||||
{
|
||||
public List<WcsFlowNodeLog> selectFlowNodeLogList(WcsFlowNodeLog flowNodeLog);
|
||||
|
||||
public WcsFlowNodeLog selectFlowNodeLogById(Long id);
|
||||
|
||||
public List<WcsFlowNodeLog> selectFlowNodeLogByInstanceId(Long instanceId);
|
||||
|
||||
public int insertFlowNodeLog(WcsFlowNodeLog flowNodeLog);
|
||||
|
||||
public int updateFlowNodeLog(WcsFlowNodeLog flowNodeLog);
|
||||
|
||||
public int deleteFlowNodeLogById(Long id);
|
||||
|
||||
public int deleteFlowNodeLogByIds(Long[] ids);
|
||||
|
||||
public int deleteFlowNodeLogByInstanceId(Long instanceId);
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.ruoyi.wcs.flow.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.wcs.flow.domain.WcsFlowNode;
|
||||
|
||||
/**
|
||||
* <20><><EFBFBD>̽ڵ<CCBD> <20><><EFBFBD>ݲ<EFBFBD>
|
||||
*
|
||||
* @author wcs
|
||||
*/
|
||||
public interface WcsFlowNodeMapper
|
||||
{
|
||||
public List<WcsFlowNode> selectFlowNodeListByFlowId(Long flowId);
|
||||
|
||||
public WcsFlowNode selectFlowNodeById(Long nodeId);
|
||||
|
||||
public int insertFlowNode(WcsFlowNode flowNode);
|
||||
|
||||
public int updateFlowNode(WcsFlowNode flowNode);
|
||||
|
||||
public int deleteFlowNodeById(Long nodeId);
|
||||
|
||||
public int deleteFlowNodeByFlowId(Long flowId);
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
/**
|
||||
* WCS <20><><EFBFBD>̶<EFBFBD><CCB6><EFBFBD><EFBFBD><EFBFBD>ִ<EFBFBD><D6B4>ģ<EFBFBD><C4A3>
|
||||
* <p>
|
||||
* <20>ṩ<EFBFBD><E1B9A9><EFBFBD>ӻ<EFBFBD><D3BB><EFBFBD><EFBFBD>̱<EFBFBD><CCB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̶<EFBFBD><CCB6>塢<EFBFBD>ڵ㶨<DAB5>塢<EFBFBD><E5A1A2><EFBFBD>߶<EFBFBD><DFB6>塢
|
||||
* <20><><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD>С<EFBFBD><D0A1>ڵ<EFBFBD>ִ<EFBFBD><D6B4><EFBFBD><EFBFBD>־<EFBFBD>ȹ<EFBFBD><C8B9>ܡ<EFBFBD>
|
||||
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>棬<EFBFBD><E6A3AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>з<EFBFBD><D0B7><EFBFBD><EFBFBD><EFBFBD>
|
||||
* </p>
|
||||
*
|
||||
* @author WCS
|
||||
*/
|
||||
package com.ruoyi.wcs.flow;
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.ruoyi.wcs.flow.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.wcs.flow.domain.WcsFlowDef;
|
||||
|
||||
/**
|
||||
* <20><><EFBFBD>̶<EFBFBD><CCB6><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
*
|
||||
* @author wcs
|
||||
*/
|
||||
public interface IWcsFlowDefService
|
||||
{
|
||||
public List<WcsFlowDef> selectFlowDefList(WcsFlowDef flowDef);
|
||||
|
||||
public WcsFlowDef selectFlowDefById(Long flowId);
|
||||
|
||||
public int insertFlowDef(WcsFlowDef flowDef);
|
||||
|
||||
public int updateFlowDef(WcsFlowDef flowDef);
|
||||
|
||||
public int deleteFlowDefByIds(Long[] flowIds);
|
||||
|
||||
public boolean checkFlowCodeUnique(WcsFlowDef flowDef);
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.ruoyi.wcs.flow.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.wcs.flow.domain.WcsFlowInstance;
|
||||
|
||||
/**
|
||||
* <20><><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
*
|
||||
* @author wcs
|
||||
*/
|
||||
public interface IWcsFlowInstanceService
|
||||
{
|
||||
public List<WcsFlowInstance> selectFlowInstanceList(WcsFlowInstance flowInstance);
|
||||
|
||||
public WcsFlowInstance selectFlowInstanceById(Long id);
|
||||
|
||||
public int insertFlowInstance(WcsFlowInstance flowInstance);
|
||||
|
||||
public int updateFlowInstance(WcsFlowInstance flowInstance);
|
||||
|
||||
public int deleteFlowInstanceByIds(Long[] ids);
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.ruoyi.wcs.flow.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.wcs.flow.domain.WcsFlowLine;
|
||||
|
||||
/**
|
||||
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
*
|
||||
* @author wcs
|
||||
*/
|
||||
public interface IWcsFlowLineService
|
||||
{
|
||||
public List<WcsFlowLine> selectFlowLineListByFlowId(Long flowId);
|
||||
|
||||
public int insertFlowLine(WcsFlowLine flowLine);
|
||||
|
||||
public int deleteFlowLineById(Long lineId);
|
||||
|
||||
public int deleteFlowLineByFlowId(Long flowId);
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.ruoyi.wcs.flow.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.wcs.flow.domain.WcsFlowNodeLog;
|
||||
|
||||
/**
|
||||
* <20><><EFBFBD>̽ڵ<CCBD>ִ<EFBFBD><D6B4><EFBFBD><EFBFBD>־ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
*
|
||||
* @author wcs
|
||||
*/
|
||||
public interface IWcsFlowNodeLogService
|
||||
{
|
||||
public List<WcsFlowNodeLog> selectFlowNodeLogList(WcsFlowNodeLog flowNodeLog);
|
||||
|
||||
public WcsFlowNodeLog selectFlowNodeLogById(Long id);
|
||||
|
||||
public List<WcsFlowNodeLog> selectFlowNodeLogByInstanceId(Long instanceId);
|
||||
|
||||
public int insertFlowNodeLog(WcsFlowNodeLog flowNodeLog);
|
||||
|
||||
public int updateFlowNodeLog(WcsFlowNodeLog flowNodeLog);
|
||||
|
||||
public int deleteFlowNodeLogByIds(Long[] ids);
|
||||
|
||||
public int deleteFlowNodeLogByInstanceId(Long instanceId);
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.ruoyi.wcs.flow.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.wcs.flow.domain.WcsFlowNode;
|
||||
|
||||
/**
|
||||
* <20><><EFBFBD>̽ڵ<CCBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
*
|
||||
* @author wcs
|
||||
*/
|
||||
public interface IWcsFlowNodeService
|
||||
{
|
||||
public List<WcsFlowNode> selectFlowNodeListByFlowId(Long flowId);
|
||||
|
||||
public WcsFlowNode selectFlowNodeById(Long nodeId);
|
||||
|
||||
public int insertFlowNode(WcsFlowNode flowNode);
|
||||
|
||||
public int updateFlowNode(WcsFlowNode flowNode);
|
||||
|
||||
public int deleteFlowNodeById(Long nodeId);
|
||||
|
||||
public int deleteFlowNodeByFlowId(Long flowId);
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.ruoyi.wcs.flow.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.common.constant.UserConstants;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.wcs.flow.domain.WcsFlowDef;
|
||||
import com.ruoyi.wcs.flow.mapper.WcsFlowDefMapper;
|
||||
import com.ruoyi.wcs.flow.service.IWcsFlowDefService;
|
||||
|
||||
/**
|
||||
* <20><><EFBFBD>̶<EFBFBD><CCB6><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>㴦<EFBFBD><E3B4A6>
|
||||
*
|
||||
* @author wcs
|
||||
*/
|
||||
@Service
|
||||
public class WcsFlowDefServiceImpl implements IWcsFlowDefService
|
||||
{
|
||||
@Autowired
|
||||
private WcsFlowDefMapper flowDefMapper;
|
||||
|
||||
@Override
|
||||
public List<WcsFlowDef> selectFlowDefList(WcsFlowDef flowDef)
|
||||
{
|
||||
return flowDefMapper.selectFlowDefList(flowDef);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WcsFlowDef selectFlowDefById(Long flowId)
|
||||
{
|
||||
return flowDefMapper.selectFlowDefById(flowId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertFlowDef(WcsFlowDef flowDef)
|
||||
{
|
||||
return flowDefMapper.insertFlowDef(flowDef);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateFlowDef(WcsFlowDef flowDef)
|
||||
{
|
||||
return flowDefMapper.updateFlowDef(flowDef);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteFlowDefByIds(Long[] flowIds)
|
||||
{
|
||||
return flowDefMapper.deleteFlowDefByIds(flowIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkFlowCodeUnique(WcsFlowDef flowDef)
|
||||
{
|
||||
Long flowId = StringUtils.isNull(flowDef.getFlowId()) ? -1L : flowDef.getFlowId();
|
||||
WcsFlowDef info = flowDefMapper.checkFlowCodeUnique(flowDef.getFlowCode());
|
||||
if (StringUtils.isNotNull(info) && info.getFlowId().longValue() != flowId.longValue())
|
||||
{
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.ruoyi.wcs.flow.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.wcs.flow.domain.WcsFlowInstance;
|
||||
import com.ruoyi.wcs.flow.mapper.WcsFlowInstanceMapper;
|
||||
import com.ruoyi.wcs.flow.service.IWcsFlowInstanceService;
|
||||
|
||||
/**
|
||||
* <20><><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5> <20><><EFBFBD><EFBFBD><EFBFBD>㴦<EFBFBD><E3B4A6>
|
||||
*
|
||||
* @author wcs
|
||||
*/
|
||||
@Service
|
||||
public class WcsFlowInstanceServiceImpl implements IWcsFlowInstanceService
|
||||
{
|
||||
@Autowired
|
||||
private WcsFlowInstanceMapper flowInstanceMapper;
|
||||
|
||||
@Override
|
||||
public List<WcsFlowInstance> selectFlowInstanceList(WcsFlowInstance flowInstance)
|
||||
{
|
||||
return flowInstanceMapper.selectFlowInstanceList(flowInstance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WcsFlowInstance selectFlowInstanceById(Long id)
|
||||
{
|
||||
return flowInstanceMapper.selectFlowInstanceById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertFlowInstance(WcsFlowInstance flowInstance)
|
||||
{
|
||||
return flowInstanceMapper.insertFlowInstance(flowInstance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateFlowInstance(WcsFlowInstance flowInstance)
|
||||
{
|
||||
return flowInstanceMapper.updateFlowInstance(flowInstance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteFlowInstanceByIds(Long[] ids)
|
||||
{
|
||||
return flowInstanceMapper.deleteFlowInstanceByIds(ids);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.ruoyi.wcs.flow.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.wcs.flow.domain.WcsFlowLine;
|
||||
import com.ruoyi.wcs.flow.mapper.WcsFlowLineMapper;
|
||||
import com.ruoyi.wcs.flow.service.IWcsFlowLineService;
|
||||
|
||||
/**
|
||||
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>㴦<EFBFBD><E3B4A6>
|
||||
*
|
||||
* @author wcs
|
||||
*/
|
||||
@Service
|
||||
public class WcsFlowLineServiceImpl implements IWcsFlowLineService
|
||||
{
|
||||
@Autowired
|
||||
private WcsFlowLineMapper flowLineMapper;
|
||||
|
||||
@Override
|
||||
public List<WcsFlowLine> selectFlowLineListByFlowId(Long flowId)
|
||||
{
|
||||
return flowLineMapper.selectFlowLineListByFlowId(flowId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertFlowLine(WcsFlowLine flowLine)
|
||||
{
|
||||
return flowLineMapper.insertFlowLine(flowLine);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteFlowLineById(Long lineId)
|
||||
{
|
||||
return flowLineMapper.deleteFlowLineById(lineId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteFlowLineByFlowId(Long flowId)
|
||||
{
|
||||
return flowLineMapper.deleteFlowLineByFlowId(flowId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.ruoyi.wcs.flow.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.wcs.flow.domain.WcsFlowNodeLog;
|
||||
import com.ruoyi.wcs.flow.mapper.WcsFlowNodeLogMapper;
|
||||
import com.ruoyi.wcs.flow.service.IWcsFlowNodeLogService;
|
||||
|
||||
/**
|
||||
* <20><><EFBFBD>̽ڵ<CCBD>ִ<EFBFBD><D6B4><EFBFBD><EFBFBD>־ <20><><EFBFBD><EFBFBD><EFBFBD>㴦<EFBFBD><E3B4A6>
|
||||
*
|
||||
* @author wcs
|
||||
*/
|
||||
@Service
|
||||
public class WcsFlowNodeLogServiceImpl implements IWcsFlowNodeLogService
|
||||
{
|
||||
@Autowired
|
||||
private WcsFlowNodeLogMapper flowNodeLogMapper;
|
||||
|
||||
@Override
|
||||
public List<WcsFlowNodeLog> selectFlowNodeLogList(WcsFlowNodeLog flowNodeLog)
|
||||
{
|
||||
return flowNodeLogMapper.selectFlowNodeLogList(flowNodeLog);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WcsFlowNodeLog selectFlowNodeLogById(Long id)
|
||||
{
|
||||
return flowNodeLogMapper.selectFlowNodeLogById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WcsFlowNodeLog> selectFlowNodeLogByInstanceId(Long instanceId)
|
||||
{
|
||||
return flowNodeLogMapper.selectFlowNodeLogByInstanceId(instanceId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertFlowNodeLog(WcsFlowNodeLog flowNodeLog)
|
||||
{
|
||||
return flowNodeLogMapper.insertFlowNodeLog(flowNodeLog);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateFlowNodeLog(WcsFlowNodeLog flowNodeLog)
|
||||
{
|
||||
return flowNodeLogMapper.updateFlowNodeLog(flowNodeLog);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteFlowNodeLogByIds(Long[] ids)
|
||||
{
|
||||
return flowNodeLogMapper.deleteFlowNodeLogByIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteFlowNodeLogByInstanceId(Long instanceId)
|
||||
{
|
||||
return flowNodeLogMapper.deleteFlowNodeLogByInstanceId(instanceId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.ruoyi.wcs.flow.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.wcs.flow.domain.WcsFlowNode;
|
||||
import com.ruoyi.wcs.flow.mapper.WcsFlowNodeMapper;
|
||||
import com.ruoyi.wcs.flow.service.IWcsFlowNodeService;
|
||||
|
||||
/**
|
||||
* <20><><EFBFBD>̽ڵ<CCBD> <20><><EFBFBD><EFBFBD><EFBFBD>㴦<EFBFBD><E3B4A6>
|
||||
*
|
||||
* @author wcs
|
||||
*/
|
||||
@Service
|
||||
public class WcsFlowNodeServiceImpl implements IWcsFlowNodeService
|
||||
{
|
||||
@Autowired
|
||||
private WcsFlowNodeMapper flowNodeMapper;
|
||||
|
||||
@Override
|
||||
public List<WcsFlowNode> selectFlowNodeListByFlowId(Long flowId)
|
||||
{
|
||||
return flowNodeMapper.selectFlowNodeListByFlowId(flowId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WcsFlowNode selectFlowNodeById(Long nodeId)
|
||||
{
|
||||
return flowNodeMapper.selectFlowNodeById(nodeId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertFlowNode(WcsFlowNode flowNode)
|
||||
{
|
||||
return flowNodeMapper.insertFlowNode(flowNode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateFlowNode(WcsFlowNode flowNode)
|
||||
{
|
||||
return flowNodeMapper.updateFlowNode(flowNode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteFlowNodeById(Long nodeId)
|
||||
{
|
||||
return flowNodeMapper.deleteFlowNodeById(nodeId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteFlowNodeByFlowId(Long flowId)
|
||||
{
|
||||
return flowNodeMapper.deleteFlowNodeByFlowId(flowId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* WCS <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3>
|
||||
* <p>
|
||||
* <20><><EFBFBD><EFBFBD> WCS <20><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><C2B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>״̬<D7B4><CCAC><EFBFBD>١<EFBFBD><D9A1>쳣<EFBFBD><ECB3A3><EFBFBD><EFBFBD><EFBFBD>ȡ<EFBFBD>
|
||||
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Quartz ģ<><C4A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD>á<EFBFBD>
|
||||
* </p>
|
||||
*
|
||||
* @author WCS
|
||||
*/
|
||||
package com.ruoyi.wcs.job;
|
||||
20
ruoyi-admin/src/main/java/com/ruoyi/wcs/package-info.java
Normal file
20
ruoyi-admin/src/main/java/com/ruoyi/wcs/package-info.java
Normal file
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* WCS (Warehouse Control System) <20>ֿ<EFBFBD><D6BF><EFBFBD><EFBFBD><EFBFBD>ϵͳģ<CDB3><C4A3>
|
||||
* <p>
|
||||
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> RuoYi-Vue 3.9.1 (SpringBoot 2.5) <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> WCS ҵ<><D2B5>ģ<EFBFBD>顣
|
||||
* <p>
|
||||
* ģ<><C4A3><EFBFBD>ṹ:
|
||||
* <ul>
|
||||
* <li>device - <20>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>豸<EFBFBD><E8B1B8>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD>á<EFBFBD><C3A1><EFBFBD>λֵ<CEBB><D6B5></li>
|
||||
* <li>api - <20>ӿ<EFBFBD><D3BF><EFBFBD><EFBFBD>ã<EFBFBD>WMS/ERP <20><><EFBFBD>ⲿϵͳ<CFB5>Խӣ<D4BD></li>
|
||||
* <li>flow - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>棨<EFBFBD><E6A3A8><EFBFBD>̶<EFBFBD><CCB6>塢<EFBFBD>ڵ㡢<DAB5><E3A1A2><EFBFBD>ߡ<EFBFBD>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>־<EFBFBD><D6BE></li>
|
||||
* <li>job - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȣ<EFBFBD><C8A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>״̬<D7B4><CCAC><EFBFBD>٣<EFBFBD></li>
|
||||
* <li>plc - PLC ͨ<>ţ<EFBFBD>Modbus TCP / OPC UA / S7 Э<><D0AD><EFBFBD><EFBFBD>װ<EFBFBD><D7B0></li>
|
||||
* <li>schedule - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>棨·<E6A3A8><C2B7><EFBFBD>滮<EFBFBD><E6BBAE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>䡢<EFBFBD><E4A1A2>ͻ<EFBFBD><CDBB><EFBFBD>⣩</li>
|
||||
* </ul>
|
||||
* <p>
|
||||
* <20><><EFBFBD>ݿ<EFBFBD><DDBF><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD>ű<EFBFBD>: sql/wcs_init_mysql.sql
|
||||
*
|
||||
* @author WCS
|
||||
*/
|
||||
package com.ruoyi.wcs;
|
||||
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* WCS PLC ͨ<><CDA8>ģ<EFBFBD><C4A3>
|
||||
* <p>
|
||||
* <20><>װ<EFBFBD><D7B0> PLC <20>豸<EFBFBD><E8B1B8>ͨ<EFBFBD><CDA8>Э<EFBFBD>飨<EFBFBD><E9A3A8> Modbus TCP / OPC UA / S7 <20>ȣ<EFBFBD><C8A3><EFBFBD>
|
||||
* <20>ṩͳһ<CDB3>Ķ<EFBFBD>д<EFBFBD>ӿں<D3BF><DABA><EFBFBD><EFBFBD>ӹ<EFBFBD><D3B9><EFBFBD><EFBFBD><EFBFBD>
|
||||
* </p>
|
||||
*
|
||||
* @author WCS
|
||||
*/
|
||||
package com.ruoyi.wcs.plc;
|
||||
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* WCS <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3>
|
||||
* <p>
|
||||
* <20><><EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD><EFBFBD><EFBFBD><DFBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>豸·<E8B1B8><C2B7><EFBFBD>滮<EFBFBD><E6BBAE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>䡢<EFBFBD><E4A1A2>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>ȡ<EFBFBD>
|
||||
* <20><> flow / device / plc ģ<><C4A3>Эͬ<D0AD><CDAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
* </p>
|
||||
*
|
||||
* @author WCS
|
||||
*/
|
||||
package com.ruoyi.wcs.schedule;
|
||||
@@ -4,7 +4,9 @@ spring:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
druid:
|
||||
# 主库数据源
|
||||
# 主库数据源(MySQL)
|
||||
# WCS 项目使用 MySQL,请根据实际环境修改连接参数
|
||||
# 建议数据库名: ry-wcs 或 ry-vue,需先执行 sql/ry_20250522.sql 和 sql/wcs_init_mysql.sql
|
||||
master:
|
||||
url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
username: root
|
||||
|
||||
@@ -133,4 +133,4 @@ xss:
|
||||
# 排除链接(多个用逗号分隔)
|
||||
excludes: /system/notice
|
||||
# 匹配链接
|
||||
urlPatterns: /system/*,/monitor/*,/tool/*
|
||||
urlPatterns: /system/*,/monitor/*,/tool/*,/wcs/*
|
||||
|
||||
125
ruoyi-admin/src/main/resources/mapper/wcs/WcsApiConfigMapper.xml
Normal file
125
ruoyi-admin/src/main/resources/mapper/wcs/WcsApiConfigMapper.xml
Normal file
@@ -0,0 +1,125 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.wcs.api.mapper.WcsApiConfigMapper">
|
||||
|
||||
<resultMap type="com.ruoyi.wcs.api.domain.WcsApiConfig" id="WcsApiConfigResult">
|
||||
<id property="apiId" column="api_id" />
|
||||
<result property="apiCode" column="api_code" />
|
||||
<result property="apiName" column="api_name" />
|
||||
<result property="apiUrl" column="api_url" />
|
||||
<result property="requestMethod" column="request_method" />
|
||||
<result property="contentType" column="content_type" />
|
||||
<result property="timeout" column="timeout" />
|
||||
<result property="retryCount" column="retry_count" />
|
||||
<result property="direction" column="direction" />
|
||||
<result property="status" column="status" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectApiConfigVo">
|
||||
select api_id, api_code, api_name, api_url, request_method, content_type,
|
||||
timeout, retry_count, direction, status, del_flag,
|
||||
create_by, create_time, update_by, update_time, remark
|
||||
from wcs_api_config
|
||||
</sql>
|
||||
|
||||
<select id="selectApiConfigList" parameterType="com.ruoyi.wcs.api.domain.WcsApiConfig" resultMap="WcsApiConfigResult">
|
||||
<include refid="selectApiConfigVo"/>
|
||||
<where>
|
||||
del_flag = '0'
|
||||
<if test="apiCode != null and apiCode != ''">
|
||||
AND api_code like concat('%', #{apiCode}, '%')
|
||||
</if>
|
||||
<if test="apiName != null and apiName != ''">
|
||||
AND api_name like concat('%', #{apiName}, '%')
|
||||
</if>
|
||||
<if test="requestMethod != null and requestMethod != ''">
|
||||
AND request_method = #{requestMethod}
|
||||
</if>
|
||||
<if test="direction != null and direction != ''">
|
||||
AND direction = #{direction}
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectApiConfigById" parameterType="Long" resultMap="WcsApiConfigResult">
|
||||
<include refid="selectApiConfigVo"/>
|
||||
where api_id = #{apiId} and del_flag = '0'
|
||||
</select>
|
||||
|
||||
<select id="checkApiCodeUnique" parameterType="String" resultMap="WcsApiConfigResult">
|
||||
<include refid="selectApiConfigVo"/>
|
||||
where api_code = #{apiCode} and del_flag = '0' limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insertApiConfig" parameterType="com.ruoyi.wcs.api.domain.WcsApiConfig" useGeneratedKeys="true" keyProperty="apiId">
|
||||
insert into wcs_api_config(
|
||||
<if test="apiCode != null and apiCode != ''">api_code,</if>
|
||||
<if test="apiName != null and apiName != ''">api_name,</if>
|
||||
<if test="apiUrl != null and apiUrl != ''">api_url,</if>
|
||||
<if test="requestMethod != null and requestMethod != ''">request_method,</if>
|
||||
<if test="contentType != null and contentType != ''">content_type,</if>
|
||||
<if test="timeout != null">timeout,</if>
|
||||
<if test="retryCount != null">retry_count,</if>
|
||||
<if test="direction != null and direction != ''">direction,</if>
|
||||
<if test="status != null and status != ''">status,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="apiCode != null and apiCode != ''">#{apiCode},</if>
|
||||
<if test="apiName != null and apiName != ''">#{apiName},</if>
|
||||
<if test="apiUrl != null and apiUrl != ''">#{apiUrl},</if>
|
||||
<if test="requestMethod != null and requestMethod != ''">#{requestMethod},</if>
|
||||
<if test="contentType != null and contentType != ''">#{contentType},</if>
|
||||
<if test="timeout != null">#{timeout},</if>
|
||||
<if test="retryCount != null">#{retryCount},</if>
|
||||
<if test="direction != null and direction != ''">#{direction},</if>
|
||||
<if test="status != null and status != ''">#{status},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateApiConfig" parameterType="com.ruoyi.wcs.api.domain.WcsApiConfig">
|
||||
update wcs_api_config
|
||||
<set>
|
||||
<if test="apiCode != null and apiCode != ''">api_code = #{apiCode},</if>
|
||||
<if test="apiName != null">api_name = #{apiName},</if>
|
||||
<if test="apiUrl != null">api_url = #{apiUrl},</if>
|
||||
<if test="requestMethod != null">request_method = #{requestMethod},</if>
|
||||
<if test="contentType != null">content_type = #{contentType},</if>
|
||||
<if test="timeout != null">timeout = #{timeout},</if>
|
||||
<if test="retryCount != null">retry_count = #{retryCount},</if>
|
||||
<if test="direction != null">direction = #{direction},</if>
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where api_id = #{apiId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteApiConfigById" parameterType="Long">
|
||||
update wcs_api_config set del_flag = '2' where api_id = #{apiId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteApiConfigByIds" parameterType="Long">
|
||||
update wcs_api_config set del_flag = '2' where api_id in
|
||||
<foreach collection="array" item="apiId" open="(" separator="," close=")">
|
||||
#{apiId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
121
ruoyi-admin/src/main/resources/mapper/wcs/WcsDeviceMapper.xml
Normal file
121
ruoyi-admin/src/main/resources/mapper/wcs/WcsDeviceMapper.xml
Normal file
@@ -0,0 +1,121 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.wcs.device.mapper.WcsDeviceMapper">
|
||||
|
||||
<resultMap type="com.ruoyi.wcs.device.domain.WcsDevice" id="WcsDeviceResult">
|
||||
<id property="deviceId" column="device_id" />
|
||||
<result property="deviceCode" column="device_code" />
|
||||
<result property="deviceName" column="device_name" />
|
||||
<result property="deviceType" column="device_type" />
|
||||
<result property="areaCode" column="area_code" />
|
||||
<result property="protocolType" column="protocol_type" />
|
||||
<result property="ipAddress" column="ip_address" />
|
||||
<result property="port" column="port" />
|
||||
<result property="status" column="status" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectDeviceVo">
|
||||
select device_id, device_code, device_name, device_type, area_code,
|
||||
protocol_type, ip_address, port, status, del_flag,
|
||||
create_by, create_time, update_by, update_time, remark
|
||||
from wcs_device
|
||||
</sql>
|
||||
|
||||
<select id="selectDeviceList" parameterType="com.ruoyi.wcs.device.domain.WcsDevice" resultMap="WcsDeviceResult">
|
||||
<include refid="selectDeviceVo"/>
|
||||
<where>
|
||||
del_flag = '0'
|
||||
<if test="deviceCode != null and deviceCode != ''">
|
||||
AND device_code like concat('%', #{deviceCode}, '%')
|
||||
</if>
|
||||
<if test="deviceName != null and deviceName != ''">
|
||||
AND device_name like concat('%', #{deviceName}, '%')
|
||||
</if>
|
||||
<if test="deviceType != null and deviceType != ''">
|
||||
AND device_type = #{deviceType}
|
||||
</if>
|
||||
<if test="areaCode != null and areaCode != ''">
|
||||
AND area_code = #{areaCode}
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectDeviceById" parameterType="Long" resultMap="WcsDeviceResult">
|
||||
<include refid="selectDeviceVo"/>
|
||||
where device_id = #{deviceId} and del_flag = '0'
|
||||
</select>
|
||||
|
||||
<select id="checkDeviceCodeUnique" parameterType="String" resultMap="WcsDeviceResult">
|
||||
<include refid="selectDeviceVo"/>
|
||||
where device_code = #{deviceCode} and del_flag = '0' limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insertDevice" parameterType="com.ruoyi.wcs.device.domain.WcsDevice" useGeneratedKeys="true" keyProperty="deviceId">
|
||||
insert into wcs_device(
|
||||
<if test="deviceCode != null and deviceCode != ''">device_code,</if>
|
||||
<if test="deviceName != null and deviceName != ''">device_name,</if>
|
||||
<if test="deviceType != null and deviceType != ''">device_type,</if>
|
||||
<if test="areaCode != null and areaCode != ''">area_code,</if>
|
||||
<if test="protocolType != null and protocolType != ''">protocol_type,</if>
|
||||
<if test="ipAddress != null and ipAddress != ''">ip_address,</if>
|
||||
<if test="port != null">port,</if>
|
||||
<if test="status != null and status != ''">status,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="deviceCode != null and deviceCode != ''">#{deviceCode},</if>
|
||||
<if test="deviceName != null and deviceName != ''">#{deviceName},</if>
|
||||
<if test="deviceType != null and deviceType != ''">#{deviceType},</if>
|
||||
<if test="areaCode != null and areaCode != ''">#{areaCode},</if>
|
||||
<if test="protocolType != null and protocolType != ''">#{protocolType},</if>
|
||||
<if test="ipAddress != null and ipAddress != ''">#{ipAddress},</if>
|
||||
<if test="port != null">#{port},</if>
|
||||
<if test="status != null and status != ''">#{status},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateDevice" parameterType="com.ruoyi.wcs.device.domain.WcsDevice">
|
||||
update wcs_device
|
||||
<set>
|
||||
<if test="deviceCode != null and deviceCode != ''">device_code = #{deviceCode},</if>
|
||||
<if test="deviceName != null">device_name = #{deviceName},</if>
|
||||
<if test="deviceType != null">device_type = #{deviceType},</if>
|
||||
<if test="areaCode != null">area_code = #{areaCode},</if>
|
||||
<if test="protocolType != null">protocol_type = #{protocolType},</if>
|
||||
<if test="ipAddress != null">ip_address = #{ipAddress},</if>
|
||||
<if test="port != null">port = #{port},</if>
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where device_id = #{deviceId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteDeviceById" parameterType="Long">
|
||||
update wcs_device set del_flag = '2' where device_id = #{deviceId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteDeviceByIds" parameterType="Long">
|
||||
update wcs_device set del_flag = '2' where device_id in
|
||||
<foreach collection="array" item="deviceId" open="(" separator="," close=")">
|
||||
#{deviceId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,119 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.wcs.device.mapper.WcsDevicePointMapper">
|
||||
|
||||
<resultMap type="com.ruoyi.wcs.device.domain.WcsDevicePoint" id="WcsDevicePointResult">
|
||||
<id property="pointId" column="point_id" />
|
||||
<result property="deviceId" column="device_id" />
|
||||
<result property="pointCode" column="point_code" />
|
||||
<result property="pointName" column="point_name" />
|
||||
<result property="pointType" column="point_type" />
|
||||
<result property="dataType" column="data_type" />
|
||||
<result property="address" column="address" />
|
||||
<result property="unit" column="unit" />
|
||||
<result property="status" column="status" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="deviceName" column="device_name" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectPointVo">
|
||||
select p.point_id, p.device_id, p.point_code, p.point_name, p.point_type,
|
||||
p.data_type, p.address, p.unit, p.status, p.del_flag,
|
||||
p.create_by, p.create_time, p.update_by, p.update_time, p.remark,
|
||||
d.device_name
|
||||
from wcs_device_point p
|
||||
left join wcs_device d on d.device_id = p.device_id
|
||||
</sql>
|
||||
|
||||
<select id="selectPointList" parameterType="com.ruoyi.wcs.device.domain.WcsDevicePoint" resultMap="WcsDevicePointResult">
|
||||
<include refid="selectPointVo"/>
|
||||
<where>
|
||||
p.del_flag = '0'
|
||||
<if test="deviceId != null">
|
||||
AND p.device_id = #{deviceId}
|
||||
</if>
|
||||
<if test="pointCode != null and pointCode != ''">
|
||||
AND p.point_code like concat('%', #{pointCode}, '%')
|
||||
</if>
|
||||
<if test="pointName != null and pointName != ''">
|
||||
AND p.point_name like concat('%', #{pointName}, '%')
|
||||
</if>
|
||||
<if test="pointType != null and pointType != ''">
|
||||
AND p.point_type = #{pointType}
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND p.status = #{status}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectPointById" parameterType="Long" resultMap="WcsDevicePointResult">
|
||||
<include refid="selectPointVo"/>
|
||||
where p.point_id = #{pointId} and p.del_flag = '0'
|
||||
</select>
|
||||
|
||||
<insert id="insertPoint" parameterType="com.ruoyi.wcs.device.domain.WcsDevicePoint" useGeneratedKeys="true" keyProperty="pointId">
|
||||
insert into wcs_device_point(
|
||||
<if test="deviceId != null">device_id,</if>
|
||||
<if test="pointCode != null and pointCode != ''">point_code,</if>
|
||||
<if test="pointName != null and pointName != ''">point_name,</if>
|
||||
<if test="pointType != null and pointType != ''">point_type,</if>
|
||||
<if test="dataType != null and dataType != ''">data_type,</if>
|
||||
<if test="address != null and address != ''">address,</if>
|
||||
<if test="unit != null and unit != ''">unit,</if>
|
||||
<if test="status != null and status != ''">status,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="deviceId != null">#{deviceId},</if>
|
||||
<if test="pointCode != null and pointCode != ''">#{pointCode},</if>
|
||||
<if test="pointName != null and pointName != ''">#{pointName},</if>
|
||||
<if test="pointType != null and pointType != ''">#{pointType},</if>
|
||||
<if test="dataType != null and dataType != ''">#{dataType},</if>
|
||||
<if test="address != null and address != ''">#{address},</if>
|
||||
<if test="unit != null and unit != ''">#{unit},</if>
|
||||
<if test="status != null and status != ''">#{status},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updatePoint" parameterType="com.ruoyi.wcs.device.domain.WcsDevicePoint">
|
||||
update wcs_device_point
|
||||
<set>
|
||||
<if test="deviceId != null">device_id = #{deviceId},</if>
|
||||
<if test="pointCode != null and pointCode != ''">point_code = #{pointCode},</if>
|
||||
<if test="pointName != null">point_name = #{pointName},</if>
|
||||
<if test="pointType != null">point_type = #{pointType},</if>
|
||||
<if test="dataType != null">data_type = #{dataType},</if>
|
||||
<if test="address != null">address = #{address},</if>
|
||||
<if test="unit != null">unit = #{unit},</if>
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where point_id = #{pointId}
|
||||
</update>
|
||||
|
||||
<delete id="deletePointById" parameterType="Long">
|
||||
update wcs_device_point set del_flag = '2' where point_id = #{pointId}
|
||||
</delete>
|
||||
|
||||
<delete id="deletePointByIds" parameterType="Long">
|
||||
update wcs_device_point set del_flag = '2' where point_id in
|
||||
<foreach collection="array" item="pointId" open="(" separator="," close=")">
|
||||
#{pointId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
110
ruoyi-admin/src/main/resources/mapper/wcs/WcsFlowDefMapper.xml
Normal file
110
ruoyi-admin/src/main/resources/mapper/wcs/WcsFlowDefMapper.xml
Normal file
@@ -0,0 +1,110 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.wcs.flow.mapper.WcsFlowDefMapper">
|
||||
|
||||
<resultMap type="com.ruoyi.wcs.flow.domain.WcsFlowDef" id="WcsFlowDefResult">
|
||||
<id property="flowId" column="flow_id" />
|
||||
<result property="flowCode" column="flow_code" />
|
||||
<result property="flowName" column="flow_name" />
|
||||
<result property="flowType" column="flow_type" />
|
||||
<result property="version" column="version" />
|
||||
<result property="flowJson" column="flow_json" />
|
||||
<result property="status" column="status" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectFlowDefVo">
|
||||
select flow_id, flow_code, flow_name, flow_type, version, flow_json,
|
||||
status, del_flag, create_by, create_time, update_by, update_time, remark
|
||||
from wcs_flow_def
|
||||
</sql>
|
||||
|
||||
<select id="selectFlowDefList" parameterType="com.ruoyi.wcs.flow.domain.WcsFlowDef" resultMap="WcsFlowDefResult">
|
||||
<include refid="selectFlowDefVo"/>
|
||||
<where>
|
||||
del_flag = '0'
|
||||
<if test="flowCode != null and flowCode != ''">
|
||||
AND flow_code like concat('%', #{flowCode}, '%')
|
||||
</if>
|
||||
<if test="flowName != null and flowName != ''">
|
||||
AND flow_name like concat('%', #{flowName}, '%')
|
||||
</if>
|
||||
<if test="flowType != null and flowType != ''">
|
||||
AND flow_type = #{flowType}
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
</where>
|
||||
order by flow_id desc
|
||||
</select>
|
||||
|
||||
<select id="selectFlowDefById" parameterType="Long" resultMap="WcsFlowDefResult">
|
||||
<include refid="selectFlowDefVo"/>
|
||||
where flow_id = #{flowId} and del_flag = '0'
|
||||
</select>
|
||||
|
||||
<select id="checkFlowCodeUnique" parameterType="String" resultMap="WcsFlowDefResult">
|
||||
<include refid="selectFlowDefVo"/>
|
||||
where flow_code = #{flowCode} and del_flag = '0' limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insertFlowDef" parameterType="com.ruoyi.wcs.flow.domain.WcsFlowDef" useGeneratedKeys="true" keyProperty="flowId">
|
||||
insert into wcs_flow_def(
|
||||
<if test="flowCode != null and flowCode != ''">flow_code,</if>
|
||||
<if test="flowName != null and flowName != ''">flow_name,</if>
|
||||
<if test="flowType != null and flowType != ''">flow_type,</if>
|
||||
<if test="version != null">version,</if>
|
||||
<if test="flowJson != null and flowJson != ''">flow_json,</if>
|
||||
<if test="status != null and status != ''">status,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="flowCode != null and flowCode != ''">#{flowCode},</if>
|
||||
<if test="flowName != null and flowName != ''">#{flowName},</if>
|
||||
<if test="flowType != null and flowType != ''">#{flowType},</if>
|
||||
<if test="version != null">#{version},</if>
|
||||
<if test="flowJson != null and flowJson != ''">#{flowJson},</if>
|
||||
<if test="status != null and status != ''">#{status},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateFlowDef" parameterType="com.ruoyi.wcs.flow.domain.WcsFlowDef">
|
||||
update wcs_flow_def
|
||||
<set>
|
||||
<if test="flowCode != null and flowCode != ''">flow_code = #{flowCode},</if>
|
||||
<if test="flowName != null">flow_name = #{flowName},</if>
|
||||
<if test="flowType != null">flow_type = #{flowType},</if>
|
||||
<if test="version != null">version = #{version},</if>
|
||||
<if test="flowJson != null">flow_json = #{flowJson},</if>
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where flow_id = #{flowId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteFlowDefById" parameterType="Long">
|
||||
update wcs_flow_def set del_flag = '2' where flow_id = #{flowId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteFlowDefByIds" parameterType="Long">
|
||||
update wcs_flow_def set del_flag = '2' where flow_id in
|
||||
<foreach collection="array" item="flowId" open="(" separator="," close=")">
|
||||
#{flowId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,95 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.wcs.flow.mapper.WcsFlowInstanceMapper">
|
||||
|
||||
<resultMap type="com.ruoyi.wcs.flow.domain.WcsFlowInstance" id="WcsFlowInstanceResult">
|
||||
<id property="id" column="id" />
|
||||
<result property="flowDefId" column="flow_def_id" />
|
||||
<result property="status" column="status" />
|
||||
<result property="startTime" column="start_time" />
|
||||
<result property="endTime" column="end_time" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectFlowInstanceVo">
|
||||
select id, flow_def_id, status, start_time, end_time, remark,
|
||||
create_by, create_time, update_by, update_time
|
||||
from wcs_flow_instance
|
||||
</sql>
|
||||
|
||||
<select id="selectFlowInstanceList" parameterType="com.ruoyi.wcs.flow.domain.WcsFlowInstance" resultMap="WcsFlowInstanceResult">
|
||||
<include refid="selectFlowInstanceVo"/>
|
||||
<where>
|
||||
<if test="flowDefId != null">
|
||||
AND flow_def_id = #{flowDefId}
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
<if test="params.beginStartTime != null and params.beginStartTime != ''">
|
||||
AND start_time >= #{params.beginStartTime}
|
||||
</if>
|
||||
<if test="params.endStartTime != null and params.endStartTime != ''">
|
||||
AND start_time <= #{params.endStartTime}
|
||||
</if>
|
||||
</where>
|
||||
order by id desc
|
||||
</select>
|
||||
|
||||
<select id="selectFlowInstanceById" parameterType="Long" resultMap="WcsFlowInstanceResult">
|
||||
<include refid="selectFlowInstanceVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertFlowInstance" parameterType="com.ruoyi.wcs.flow.domain.WcsFlowInstance" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into wcs_flow_instance(
|
||||
<if test="flowDefId != null">flow_def_id,</if>
|
||||
<if test="status != null and status != ''">status,</if>
|
||||
<if test="startTime != null">start_time,</if>
|
||||
<if test="endTime != null">end_time,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="flowDefId != null">#{flowDefId},</if>
|
||||
<if test="status != null and status != ''">#{status},</if>
|
||||
<if test="startTime != null">#{startTime},</if>
|
||||
<if test="endTime != null">#{endTime},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateFlowInstance" parameterType="com.ruoyi.wcs.flow.domain.WcsFlowInstance">
|
||||
update wcs_flow_instance
|
||||
<set>
|
||||
<if test="flowDefId != null">flow_def_id = #{flowDefId},</if>
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
<if test="startTime != null">start_time = #{startTime},</if>
|
||||
<if test="endTime != null">end_time = #{endTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteFlowInstanceById" parameterType="Long">
|
||||
delete from wcs_flow_instance where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteFlowInstanceByIds" parameterType="Long">
|
||||
delete from wcs_flow_instance where id in
|
||||
<foreach collection="array" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,63 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.wcs.flow.mapper.WcsFlowLineMapper">
|
||||
|
||||
<resultMap type="com.ruoyi.wcs.flow.domain.WcsFlowLine" id="WcsFlowLineResult">
|
||||
<id property="lineId" column="line_id" />
|
||||
<result property="flowId" column="flow_id" />
|
||||
<result property="sourceNodeId" column="source_node_id" />
|
||||
<result property="targetNodeId" column="target_node_id" />
|
||||
<result property="conditionExpr" column="condition_expr" />
|
||||
<result property="lineLabel" column="line_label" />
|
||||
<result property="sortOrder" column="sort_order" />
|
||||
<result property="createTime" column="create_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectFlowLineVo">
|
||||
select line_id, flow_id, source_node_id, target_node_id, condition_expr,
|
||||
line_label, sort_order, create_time
|
||||
from wcs_flow_line
|
||||
</sql>
|
||||
|
||||
<select id="selectFlowLineListByFlowId" parameterType="Long" resultMap="WcsFlowLineResult">
|
||||
<include refid="selectFlowLineVo"/>
|
||||
where flow_id = #{flowId}
|
||||
order by sort_order
|
||||
</select>
|
||||
|
||||
<select id="selectFlowLineById" parameterType="Long" resultMap="WcsFlowLineResult">
|
||||
<include refid="selectFlowLineVo"/>
|
||||
where line_id = #{lineId}
|
||||
</select>
|
||||
|
||||
<insert id="insertFlowLine" parameterType="com.ruoyi.wcs.flow.domain.WcsFlowLine" useGeneratedKeys="true" keyProperty="lineId">
|
||||
insert into wcs_flow_line(
|
||||
<if test="flowId != null">flow_id,</if>
|
||||
<if test="sourceNodeId != null">source_node_id,</if>
|
||||
<if test="targetNodeId != null">target_node_id,</if>
|
||||
<if test="conditionExpr != null and conditionExpr != ''">condition_expr,</if>
|
||||
<if test="lineLabel != null and lineLabel != ''">line_label,</if>
|
||||
<if test="sortOrder != null">sort_order,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="flowId != null">#{flowId},</if>
|
||||
<if test="sourceNodeId != null">#{sourceNodeId},</if>
|
||||
<if test="targetNodeId != null">#{targetNodeId},</if>
|
||||
<if test="conditionExpr != null and conditionExpr != ''">#{conditionExpr},</if>
|
||||
<if test="lineLabel != null and lineLabel != ''">#{lineLabel},</if>
|
||||
<if test="sortOrder != null">#{sortOrder},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<delete id="deleteFlowLineById" parameterType="Long">
|
||||
delete from wcs_flow_line where line_id = #{lineId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteFlowLineByFlowId" parameterType="Long">
|
||||
delete from wcs_flow_line where flow_id = #{flowId}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,114 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.wcs.flow.mapper.WcsFlowNodeLogMapper">
|
||||
|
||||
<resultMap type="com.ruoyi.wcs.flow.domain.WcsFlowNodeLog" id="WcsFlowNodeLogResult">
|
||||
<id property="id" column="id" />
|
||||
<result property="instanceId" column="instance_id" />
|
||||
<result property="nodeId" column="node_id" />
|
||||
<result property="nodeType" column="node_type" />
|
||||
<result property="status" column="status" />
|
||||
<result property="input" column="input" />
|
||||
<result property="output" column="output" />
|
||||
<result property="errorMsg" column="error_msg" />
|
||||
<result property="startTime" column="start_time" />
|
||||
<result property="endTime" column="end_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectFlowNodeLogVo">
|
||||
select id, instance_id, node_id, node_type, status, input, output,
|
||||
error_msg, start_time, end_time, create_by, create_time
|
||||
from wcs_flow_node_log
|
||||
</sql>
|
||||
|
||||
<select id="selectFlowNodeLogList" parameterType="com.ruoyi.wcs.flow.domain.WcsFlowNodeLog" resultMap="WcsFlowNodeLogResult">
|
||||
<include refid="selectFlowNodeLogVo"/>
|
||||
<where>
|
||||
<if test="instanceId != null">
|
||||
AND instance_id = #{instanceId}
|
||||
</if>
|
||||
<if test="nodeId != null and nodeId != ''">
|
||||
AND node_id = #{nodeId}
|
||||
</if>
|
||||
<if test="nodeType != null and nodeType != ''">
|
||||
AND node_type = #{nodeType}
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
</where>
|
||||
order by id asc
|
||||
</select>
|
||||
|
||||
<select id="selectFlowNodeLogById" parameterType="Long" resultMap="WcsFlowNodeLogResult">
|
||||
<include refid="selectFlowNodeLogVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectFlowNodeLogByInstanceId" parameterType="Long" resultMap="WcsFlowNodeLogResult">
|
||||
<include refid="selectFlowNodeLogVo"/>
|
||||
where instance_id = #{instanceId}
|
||||
order by id asc
|
||||
</select>
|
||||
|
||||
<insert id="insertFlowNodeLog" parameterType="com.ruoyi.wcs.flow.domain.WcsFlowNodeLog" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into wcs_flow_node_log(
|
||||
<if test="instanceId != null">instance_id,</if>
|
||||
<if test="nodeId != null and nodeId != ''">node_id,</if>
|
||||
<if test="nodeType != null and nodeType != ''">node_type,</if>
|
||||
<if test="status != null and status != ''">status,</if>
|
||||
<if test="input != null and input != ''">input,</if>
|
||||
<if test="output != null and output != ''">output,</if>
|
||||
<if test="errorMsg != null and errorMsg != ''">error_msg,</if>
|
||||
<if test="startTime != null">start_time,</if>
|
||||
<if test="endTime != null">end_time,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="instanceId != null">#{instanceId},</if>
|
||||
<if test="nodeId != null and nodeId != ''">#{nodeId},</if>
|
||||
<if test="nodeType != null and nodeType != ''">#{nodeType},</if>
|
||||
<if test="status != null and status != ''">#{status},</if>
|
||||
<if test="input != null and input != ''">#{input},</if>
|
||||
<if test="output != null and output != ''">#{output},</if>
|
||||
<if test="errorMsg != null and errorMsg != ''">#{errorMsg},</if>
|
||||
<if test="startTime != null">#{startTime},</if>
|
||||
<if test="endTime != null">#{endTime},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateFlowNodeLog" parameterType="com.ruoyi.wcs.flow.domain.WcsFlowNodeLog">
|
||||
update wcs_flow_node_log
|
||||
<set>
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
<if test="input != null">input = #{input},</if>
|
||||
<if test="output != null">output = #{output},</if>
|
||||
<if test="errorMsg != null">error_msg = #{errorMsg},</if>
|
||||
<if test="startTime != null">start_time = #{startTime},</if>
|
||||
<if test="endTime != null">end_time = #{endTime},</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteFlowNodeLogById" parameterType="Long">
|
||||
delete from wcs_flow_node_log where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteFlowNodeLogByIds" parameterType="Long">
|
||||
delete from wcs_flow_node_log where id in
|
||||
<foreach collection="array" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteFlowNodeLogByInstanceId" parameterType="Long">
|
||||
delete from wcs_flow_node_log where instance_id = #{instanceId}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,89 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.wcs.flow.mapper.WcsFlowNodeMapper">
|
||||
|
||||
<resultMap type="com.ruoyi.wcs.flow.domain.WcsFlowNode" id="WcsFlowNodeResult">
|
||||
<id property="nodeId" column="node_id" />
|
||||
<result property="flowId" column="flow_id" />
|
||||
<result property="nodeCode" column="node_code" />
|
||||
<result property="nodeName" column="node_name" />
|
||||
<result property="nodeType" column="node_type" />
|
||||
<result property="handlerClass" column="handler_class" />
|
||||
<result property="configJson" column="config_json" />
|
||||
<result property="posX" column="pos_x" />
|
||||
<result property="posY" column="pos_y" />
|
||||
<result property="sortOrder" column="sort_order" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectFlowNodeVo">
|
||||
select node_id, flow_id, node_code, node_name, node_type, handler_class,
|
||||
config_json, pos_x, pos_y, sort_order, create_time, update_time
|
||||
from wcs_flow_node
|
||||
</sql>
|
||||
|
||||
<select id="selectFlowNodeListByFlowId" parameterType="Long" resultMap="WcsFlowNodeResult">
|
||||
<include refid="selectFlowNodeVo"/>
|
||||
where flow_id = #{flowId}
|
||||
order by sort_order
|
||||
</select>
|
||||
|
||||
<select id="selectFlowNodeById" parameterType="Long" resultMap="WcsFlowNodeResult">
|
||||
<include refid="selectFlowNodeVo"/>
|
||||
where node_id = #{nodeId}
|
||||
</select>
|
||||
|
||||
<insert id="insertFlowNode" parameterType="com.ruoyi.wcs.flow.domain.WcsFlowNode" useGeneratedKeys="true" keyProperty="nodeId">
|
||||
insert into wcs_flow_node(
|
||||
<if test="flowId != null">flow_id,</if>
|
||||
<if test="nodeCode != null and nodeCode != ''">node_code,</if>
|
||||
<if test="nodeName != null and nodeName != ''">node_name,</if>
|
||||
<if test="nodeType != null and nodeType != ''">node_type,</if>
|
||||
<if test="handlerClass != null and handlerClass != ''">handler_class,</if>
|
||||
<if test="configJson != null and configJson != ''">config_json,</if>
|
||||
<if test="posX != null">pos_x,</if>
|
||||
<if test="posY != null">pos_y,</if>
|
||||
<if test="sortOrder != null">sort_order,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="flowId != null">#{flowId},</if>
|
||||
<if test="nodeCode != null and nodeCode != ''">#{nodeCode},</if>
|
||||
<if test="nodeName != null and nodeName != ''">#{nodeName},</if>
|
||||
<if test="nodeType != null and nodeType != ''">#{nodeType},</if>
|
||||
<if test="handlerClass != null and handlerClass != ''">#{handlerClass},</if>
|
||||
<if test="configJson != null and configJson != ''">#{configJson},</if>
|
||||
<if test="posX != null">#{posX},</if>
|
||||
<if test="posY != null">#{posY},</if>
|
||||
<if test="sortOrder != null">#{sortOrder},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateFlowNode" parameterType="com.ruoyi.wcs.flow.domain.WcsFlowNode">
|
||||
update wcs_flow_node
|
||||
<set>
|
||||
<if test="nodeCode != null and nodeCode != ''">node_code = #{nodeCode},</if>
|
||||
<if test="nodeName != null">node_name = #{nodeName},</if>
|
||||
<if test="nodeType != null">node_type = #{nodeType},</if>
|
||||
<if test="handlerClass != null">handler_class = #{handlerClass},</if>
|
||||
<if test="configJson != null">config_json = #{configJson},</if>
|
||||
<if test="posX != null">pos_x = #{posX},</if>
|
||||
<if test="posY != null">pos_y = #{posY},</if>
|
||||
<if test="sortOrder != null">sort_order = #{sortOrder},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where node_id = #{nodeId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteFlowNodeById" parameterType="Long">
|
||||
delete from wcs_flow_node where node_id = #{nodeId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteFlowNodeByFlowId" parameterType="Long">
|
||||
delete from wcs_flow_node where flow_id = #{flowId}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
@@ -17,6 +17,7 @@ import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.alibaba.druid.DbType;
|
||||
import com.alibaba.druid.sql.SQLUtils;
|
||||
@@ -112,12 +113,12 @@ public class GenController extends BaseController
|
||||
@PreAuthorize("@ss.hasPermi('tool:gen:import')")
|
||||
@Log(title = "代码生成", businessType = BusinessType.IMPORT)
|
||||
@PostMapping("/importTable")
|
||||
public AjaxResult importTableSave(String tables)
|
||||
public AjaxResult importTableSave(@RequestParam("tables") String tables, @RequestParam("tplWebType") String tplWebType)
|
||||
{
|
||||
String[] tableNames = Convert.toStrArray(tables);
|
||||
// 查询表信息
|
||||
List<GenTable> tableList = genTableService.selectDbTableListByNames(tableNames);
|
||||
genTableService.importGenTable(tableList, SecurityUtils.getUsername());
|
||||
genTableService.importGenTable(tableList, tplWebType, SecurityUtils.getUsername());
|
||||
return success();
|
||||
}
|
||||
|
||||
@@ -127,7 +128,7 @@ public class GenController extends BaseController
|
||||
@PreAuthorize("@ss.hasRole('admin')")
|
||||
@Log(title = "创建表", businessType = BusinessType.OTHER)
|
||||
@PostMapping("/createTable")
|
||||
public AjaxResult createTableSave(String sql)
|
||||
public AjaxResult createTableSave(@RequestParam("sql") String sql, @RequestParam("tplWebType") String tplWebType)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -148,7 +149,7 @@ public class GenController extends BaseController
|
||||
}
|
||||
List<GenTable> tableList = genTableService.selectDbTableListByNames(tableNames.toArray(new String[tableNames.size()]));
|
||||
String operName = SecurityUtils.getUsername();
|
||||
genTableService.importGenTable(tableList, operName);
|
||||
genTableService.importGenTable(tableList, tplWebType, operName);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
catch (Exception e)
|
||||
|
||||
@@ -41,7 +41,7 @@ public class GenTable extends BaseEntity
|
||||
/** 使用的模板(crud单表操作 tree树表操作 sub主子表操作) */
|
||||
private String tplCategory;
|
||||
|
||||
/** 前端类型(element-ui模版 element-plus模版) */
|
||||
/** 前端类型(element-ui模版 element-plus模版 element-plus-typescript模版) */
|
||||
private String tplWebType;
|
||||
|
||||
/** 生成包路径 */
|
||||
|
||||
@@ -168,13 +168,14 @@ public class GenTableServiceImpl implements IGenTableService
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public void importGenTable(List<GenTable> tableList, String operName)
|
||||
public void importGenTable(List<GenTable> tableList, String tplWebType, String operName)
|
||||
{
|
||||
try
|
||||
{
|
||||
for (GenTable table : tableList)
|
||||
{
|
||||
String tableName = table.getTableName();
|
||||
table.setTplWebType(tplWebType);
|
||||
GenUtils.initTable(table, operName);
|
||||
int row = genTableMapper.insertGenTable(table);
|
||||
if (row > 0)
|
||||
|
||||
@@ -78,9 +78,10 @@ public interface IGenTableService
|
||||
* 导入表结构
|
||||
*
|
||||
* @param tableList 导入表列表
|
||||
* @param tplWebType 前端类型
|
||||
* @param operName 操作人员
|
||||
*/
|
||||
public void importGenTable(List<GenTable> tableList, String operName);
|
||||
public void importGenTable(List<GenTable> tableList, String tplWebType, String operName);
|
||||
|
||||
/**
|
||||
* 预览代码
|
||||
|
||||
@@ -29,6 +29,12 @@ public class VelocityUtils
|
||||
/** 默认上级菜单,系统工具 */
|
||||
private static final String DEFAULT_PARENT_MENU_ID = "3";
|
||||
|
||||
/** Vue3 Element Plus 模版 */
|
||||
private static final String ELEMENT_PLUS = "element-plus";
|
||||
|
||||
/** Vue3 Element Plus TypeScript 模版 */
|
||||
private static final String ELEMENT_PLUS_TYPESSRIPT = "element-plus-typescript";
|
||||
|
||||
/**
|
||||
* 设置模板变量信息
|
||||
*
|
||||
@@ -130,10 +136,16 @@ public class VelocityUtils
|
||||
public static List<String> getTemplateList(String tplCategory, String tplWebType)
|
||||
{
|
||||
String useWebType = "vm/vue";
|
||||
if ("element-plus".equals(tplWebType))
|
||||
String apiTemplate = "vm/js/api.js.vm";
|
||||
if (StringUtils.equals(ELEMENT_PLUS, tplWebType))
|
||||
{
|
||||
useWebType = "vm/vue/v3";
|
||||
}
|
||||
else if (StringUtils.equals(ELEMENT_PLUS_TYPESSRIPT, tplWebType))
|
||||
{
|
||||
useWebType = "vm/vue/v3ts";
|
||||
apiTemplate = "vm/ts/api.ts.vm";
|
||||
}
|
||||
List<String> templates = new ArrayList<String>();
|
||||
templates.add("vm/java/domain.java.vm");
|
||||
templates.add("vm/java/mapper.java.vm");
|
||||
@@ -142,7 +154,12 @@ public class VelocityUtils
|
||||
templates.add("vm/java/controller.java.vm");
|
||||
templates.add("vm/xml/mapper.xml.vm");
|
||||
templates.add("vm/sql/sql.vm");
|
||||
templates.add("vm/js/api.js.vm");
|
||||
templates.add(apiTemplate);
|
||||
if (StringUtils.equals(ELEMENT_PLUS_TYPESSRIPT, tplWebType))
|
||||
{
|
||||
templates.add("vm/ts/type.ts.vm");
|
||||
templates.add("vm/ts/index.ts.vm");
|
||||
}
|
||||
if (GenConstants.TPL_CRUD.equals(tplCategory))
|
||||
{
|
||||
templates.add(useWebType + "/index.vue.vm");
|
||||
@@ -215,6 +232,18 @@ public class VelocityUtils
|
||||
{
|
||||
fileName = StringUtils.format("{}/api/{}/{}.js", vuePath, moduleName, businessName);
|
||||
}
|
||||
else if (template.contains("api.ts.vm"))
|
||||
{
|
||||
fileName = StringUtils.format("{}/api/{}/{}.ts", vuePath, moduleName, businessName);
|
||||
}
|
||||
else if (template.contains("type.ts.vm"))
|
||||
{
|
||||
fileName = StringUtils.format("{}/types/api/{}/{}.ts", vuePath, moduleName, businessName);
|
||||
}
|
||||
else if (template.contains("index.ts.vm"))
|
||||
{
|
||||
fileName = StringUtils.format("{}/types/api/index-bak.ts", vuePath);
|
||||
}
|
||||
else if (template.contains("index.vue.vm"))
|
||||
{
|
||||
fileName = StringUtils.format("{}/views/{}/{}/index.vue", vuePath, moduleName, businessName);
|
||||
|
||||
51
ruoyi-generator/src/main/resources/vm/ts/api.ts.vm
Normal file
51
ruoyi-generator/src/main/resources/vm/ts/api.ts.vm
Normal file
@@ -0,0 +1,51 @@
|
||||
import request from '@/utils/request'
|
||||
import type { AjaxResult, TableDataInfo, ${BusinessName}QueryParams, ${ClassName} } from '@/types'
|
||||
|
||||
// 查询${functionName}列表
|
||||
#if($table.tree)
|
||||
export function list${BusinessName}(query?: ${BusinessName}QueryParams): Promise<AjaxResult<${ClassName}[]>> {
|
||||
#else
|
||||
export function list${BusinessName}(query: ${BusinessName}QueryParams): Promise<TableDataInfo<${ClassName}[]>> {
|
||||
#end
|
||||
return request({
|
||||
url: '/${moduleName}/${businessName}/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询${functionName}详细
|
||||
export function get${BusinessName}(${pkColumn.javaField}: number): Promise<AjaxResult<${ClassName}>> {
|
||||
return request({
|
||||
url: '/${moduleName}/${businessName}/' + ${pkColumn.javaField},
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增${functionName}
|
||||
export function add${BusinessName}(data: ${ClassName}): Promise<AjaxResult> {
|
||||
return request({
|
||||
url: '/${moduleName}/${businessName}',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改${functionName}
|
||||
export function update${BusinessName}(data: ${ClassName}): Promise<AjaxResult> {
|
||||
return request({
|
||||
url: '/${moduleName}/${businessName}',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除${functionName}
|
||||
export function del${BusinessName}(${pkColumn.javaField}: number | number[]): Promise<AjaxResult> {
|
||||
return request({
|
||||
url: '/${moduleName}/${businessName}/' + ${pkColumn.javaField},
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
9
ruoyi-generator/src/main/resources/vm/ts/index.ts.vm
Normal file
9
ruoyi-generator/src/main/resources/vm/ts/index.ts.vm
Normal file
@@ -0,0 +1,9 @@
|
||||
/**
|
||||
* API 类型统一导出
|
||||
*/
|
||||
....
|
||||
|
||||
// 防止覆盖,需手动追加下面代码到index.ts文件中,追加好后此文件可删除
|
||||
|
||||
// ${moduleName} 模块
|
||||
export * from "./${moduleName}/${businessName}";
|
||||
51
ruoyi-generator/src/main/resources/vm/ts/type.ts.vm
Normal file
51
ruoyi-generator/src/main/resources/vm/ts/type.ts.vm
Normal file
@@ -0,0 +1,51 @@
|
||||
import type { PageDomain, BaseEntity } from "../common";
|
||||
|
||||
/** ${functionName}配置分页查询参数 */
|
||||
export interface ${BusinessName}QueryParams extends PageDomain {
|
||||
#foreach($column in $columns)
|
||||
#if($column.query)
|
||||
#set($type = "string")
|
||||
#if($column.javaType == "Long" || $column.javaType == "Integer")
|
||||
#set($type = "number")
|
||||
#elseif($column.javaType == "Boolean")
|
||||
#set($type = "boolean")
|
||||
#end
|
||||
/** ${column.columnComment} */
|
||||
${column.javaField}?: ${type};
|
||||
#end
|
||||
#end
|
||||
}
|
||||
|
||||
/** ${functionName}配置信息 */
|
||||
export interface ${ClassName} extends BaseEntity {
|
||||
#foreach($column in $columns)
|
||||
#set($type = "string")
|
||||
#if($column.javaType == "Long" || $column.javaType == "Integer")
|
||||
#set($type = "number")
|
||||
#elseif($column.javaType == "Boolean")
|
||||
#set($type = "boolean")
|
||||
#end
|
||||
/** ${column.columnComment} */
|
||||
${column.javaField}?: ${type};
|
||||
#end
|
||||
#if($table.sub)
|
||||
/** $table.subTable.functionName信息 */
|
||||
${subclassName}List?: ${subClassName}[];
|
||||
#end
|
||||
}
|
||||
#if($table.sub)
|
||||
|
||||
/** ${subTable.functionName}配置信息 */
|
||||
export interface ${subClassName} extends BaseEntity {
|
||||
#foreach ($column in $subTable.columns)
|
||||
#set($type = "string")
|
||||
#if($column.javaType == "Long" || $column.javaType == "Integer")
|
||||
#set($type = "number")
|
||||
#elseif($column.javaType == "Boolean")
|
||||
#set($type = "boolean")
|
||||
#end
|
||||
/** ${column.columnComment} */
|
||||
${column.javaField}?: ${type};
|
||||
#end
|
||||
}
|
||||
#end
|
||||
476
ruoyi-generator/src/main/resources/vm/vue/v3ts/index-tree.vue.vm
Normal file
476
ruoyi-generator/src/main/resources/vm/vue/v3ts/index-tree.vue.vm
Normal file
@@ -0,0 +1,476 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
||||
#foreach($column in $columns)
|
||||
#if($column.query)
|
||||
#set($dictType=$column.dictType)
|
||||
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
||||
#set($parentheseIndex=$column.columnComment.indexOf("("))
|
||||
#if($parentheseIndex != -1)
|
||||
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
|
||||
#else
|
||||
#set($comment=$column.columnComment)
|
||||
#end
|
||||
#if($column.htmlType == "input")
|
||||
<el-form-item label="${comment}" prop="${column.javaField}">
|
||||
<el-input
|
||||
v-model="queryParams.${column.javaField}"
|
||||
placeholder="请输入${comment}"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
#elseif(($column.htmlType == "select" || $column.htmlType == "radio") && "" != $dictType)
|
||||
<el-form-item label="${comment}" prop="${column.javaField}">
|
||||
<el-select v-model="queryParams.${column.javaField}" placeholder="请选择${comment}" clearable>
|
||||
<el-option
|
||||
v-for="dict in ${dictType}"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
#elseif(($column.htmlType == "select" || $column.htmlType == "radio") && $dictType)
|
||||
<el-form-item label="${comment}" prop="${column.javaField}">
|
||||
<el-select v-model="queryParams.${column.javaField}" placeholder="请选择${comment}" clearable>
|
||||
<el-option label="请选择字典生成" value="" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
#elseif($column.htmlType == "datetime" && $column.queryType != "BETWEEN")
|
||||
<el-form-item label="${comment}" prop="${column.javaField}">
|
||||
<el-date-picker clearable
|
||||
v-model="queryParams.${column.javaField}"
|
||||
type="date"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="选择${comment}">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
#elseif($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
||||
<el-form-item label="${comment}" style="width: 308px">
|
||||
<el-date-picker
|
||||
v-model="daterange${AttrName}"
|
||||
value-format="YYYY-MM-DD"
|
||||
type="daterange"
|
||||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
#end
|
||||
#end
|
||||
#end
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['${permissionPrefix}:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="info"
|
||||
plain
|
||||
icon="Sort"
|
||||
@click="toggleExpandAll"
|
||||
>展开/折叠</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table
|
||||
v-if="refreshTable"
|
||||
v-loading="loading"
|
||||
:data="${businessName}List"
|
||||
row-key="${treeCode}"
|
||||
:default-expand-all="isExpandAll"
|
||||
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
||||
>
|
||||
#foreach($column in $columns)
|
||||
#set($javaField=$column.javaField)
|
||||
#set($parentheseIndex=$column.columnComment.indexOf("("))
|
||||
#if($parentheseIndex != -1)
|
||||
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
|
||||
#else
|
||||
#set($comment=$column.columnComment)
|
||||
#end
|
||||
#if($column.pk)
|
||||
#elseif($column.list && $column.htmlType == "datetime")
|
||||
<el-table-column label="${comment}" align="center" prop="${javaField}" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.${javaField}, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
#elseif($column.list && $column.htmlType == "imageUpload")
|
||||
<el-table-column label="${comment}" align="center" prop="${javaField}" width="100">
|
||||
<template #default="scope">
|
||||
<image-preview :src="scope.row.${javaField}" :width="50" :height="50"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
#elseif($column.list && "" != $column.dictType)
|
||||
<el-table-column label="${comment}" align="center" prop="${javaField}">
|
||||
<template #default="scope">
|
||||
#if($column.htmlType == "checkbox")
|
||||
<dict-tag :options="${column.dictType}" :value="scope.row.${javaField} ? scope.row.${javaField}.split(',') : []"/>
|
||||
#else
|
||||
<dict-tag :options="${column.dictType}" :value="scope.row.${javaField}"/>
|
||||
#end
|
||||
</template>
|
||||
</el-table-column>
|
||||
#elseif($column.list && "" != $javaField)
|
||||
#if(${foreach.index} == 1)
|
||||
<el-table-column label="${comment}" prop="${javaField}" />
|
||||
#else
|
||||
<el-table-column label="${comment}" align="center" prop="${javaField}" />
|
||||
#end
|
||||
#end
|
||||
#end
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['${permissionPrefix}:edit']">修改</el-button>
|
||||
<el-button link type="primary" icon="Plus" @click="handleAdd(scope.row)" v-hasPermi="['${permissionPrefix}:add']">新增</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['${permissionPrefix}:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- 添加或修改${functionName}对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
<el-form ref="${businessName}Ref" :model="form" :rules="rules" label-width="80px">
|
||||
#foreach($column in $columns)
|
||||
#set($field=$column.javaField)
|
||||
#if($column.insert && !$column.pk)
|
||||
#if(($column.usableColumn) || (!$column.superColumn))
|
||||
#set($parentheseIndex=$column.columnComment.indexOf("("))
|
||||
#if($parentheseIndex != -1)
|
||||
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
|
||||
#else
|
||||
#set($comment=$column.columnComment)
|
||||
#end
|
||||
#set($dictType=$column.dictType)
|
||||
#if("" != $treeParentCode && $column.javaField == $treeParentCode)
|
||||
<el-form-item label="${comment}" prop="${treeParentCode}">
|
||||
<el-tree-select
|
||||
v-model="form.${treeParentCode}"
|
||||
:data="${businessName}Options"
|
||||
:props="{ value: '${treeCode}', label: '${treeName}', children: 'children' }"
|
||||
value-key="${treeCode}"
|
||||
placeholder="请选择${comment}"
|
||||
check-strictly
|
||||
/>
|
||||
</el-form-item>
|
||||
#elseif($column.htmlType == "input")
|
||||
<el-form-item label="${comment}" prop="${field}">
|
||||
<el-input v-model="form.${field}" placeholder="请输入${comment}" />
|
||||
</el-form-item>
|
||||
#elseif($column.htmlType == "imageUpload")
|
||||
<el-form-item label="${comment}" prop="${field}">
|
||||
<image-upload v-model="form.${field}"/>
|
||||
</el-form-item>
|
||||
#elseif($column.htmlType == "fileUpload")
|
||||
<el-form-item label="${comment}" prop="${field}">
|
||||
<file-upload v-model="form.${field}"/>
|
||||
</el-form-item>
|
||||
#elseif($column.htmlType == "editor")
|
||||
<el-form-item label="${comment}">
|
||||
<editor v-model="form.${field}" :min-height="192"/>
|
||||
</el-form-item>
|
||||
#elseif($column.htmlType == "select" && "" != $dictType)
|
||||
<el-form-item label="${comment}" prop="${field}">
|
||||
<el-select v-model="form.${field}" placeholder="请选择${comment}">
|
||||
<el-option
|
||||
v-for="dict in ${dictType}"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
#if($column.javaType == "Integer" || $column.javaType == "Long")
|
||||
:value="parseInt(dict.value)"
|
||||
#else
|
||||
:value="dict.value"
|
||||
#end
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
#elseif($column.htmlType == "select" && $dictType)
|
||||
<el-form-item label="${comment}" prop="${field}">
|
||||
<el-select v-model="form.${field}" placeholder="请选择${comment}">
|
||||
<el-option label="请选择字典生成" value="" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
#elseif($column.htmlType == "checkbox" && "" != $dictType)
|
||||
<el-form-item label="${comment}" prop="${field}">
|
||||
<el-checkbox-group v-model="form.${field}">
|
||||
<el-checkbox
|
||||
v-for="dict in ${dictType}"
|
||||
:key="dict.value"
|
||||
:label="dict.value">
|
||||
{{dict.label}}
|
||||
</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
#elseif($column.htmlType == "checkbox" && $dictType)
|
||||
<el-form-item label="${comment}" prop="${field}">
|
||||
<el-checkbox-group v-model="form.${field}">
|
||||
<el-checkbox>请选择字典生成</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
#elseif($column.htmlType == "radio" && "" != $dictType)
|
||||
<el-form-item label="${comment}" prop="${field}">
|
||||
<el-radio-group v-model="form.${field}">
|
||||
<el-radio
|
||||
v-for="dict in ${dictType}"
|
||||
:key="dict.value"
|
||||
#if($column.javaType == "Integer" || $column.javaType == "Long")
|
||||
:label="parseInt(dict.value)"
|
||||
#else
|
||||
:label="dict.value"
|
||||
#end
|
||||
>{{dict.label}}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
#elseif($column.htmlType == "radio" && $dictType)
|
||||
<el-form-item label="${comment}" prop="${field}">
|
||||
<el-radio-group v-model="form.${field}">
|
||||
<el-radio label="1">请选择字典生成</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
#elseif($column.htmlType == "datetime")
|
||||
<el-form-item label="${comment}" prop="${field}">
|
||||
<el-date-picker clearable
|
||||
v-model="form.${field}"
|
||||
type="date"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="选择${comment}">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
#elseif($column.htmlType == "textarea")
|
||||
<el-form-item label="${comment}" prop="${field}">
|
||||
<el-input v-model="form.${field}" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
#end
|
||||
#end
|
||||
#end
|
||||
#end
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="${BusinessName}">
|
||||
import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName} } from "@/api/${moduleName}/${businessName}"
|
||||
import type { ${ClassName}, ${BusinessName}QueryParams } from "@/types/api/${moduleName}/${businessName}"
|
||||
import type { TreeSelect } from '@/types/api/common'
|
||||
|
||||
const { proxy } = getCurrentInstance()
|
||||
#if(${dicts} != '')
|
||||
#set($dictsNoSymbol=$dicts.replace("'", ""))
|
||||
const { ${dictsNoSymbol} } = proxy.useDict(${dicts})
|
||||
#end
|
||||
|
||||
const ${businessName}List = ref<any[]>([])
|
||||
const ${businessName}Options = ref<TreeSelect[]>([])
|
||||
const open = ref<boolean>(false)
|
||||
const loading = ref<boolean>(true)
|
||||
const showSearch = ref<boolean>(true)
|
||||
const title = ref<string>("")
|
||||
const isExpandAll = ref<boolean>(true)
|
||||
const refreshTable = ref<boolean>(true)
|
||||
#foreach ($column in $columns)
|
||||
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
||||
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
||||
const daterange${AttrName} = ref([])
|
||||
#end
|
||||
#end
|
||||
|
||||
const data = reactive({
|
||||
form: {} as ${ClassName},
|
||||
queryParams: {
|
||||
#foreach ($column in $columns)
|
||||
#if($column.query)
|
||||
$column.javaField: undefined#if($foreach.count != $columns.size()),#end
|
||||
#end
|
||||
#end
|
||||
} as ${BusinessName}QueryParams,
|
||||
rules: {
|
||||
#foreach ($column in $columns)
|
||||
#if($column.required)
|
||||
#set($parentheseIndex=$column.columnComment.indexOf("("))
|
||||
#if($parentheseIndex != -1)
|
||||
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
|
||||
#else
|
||||
#set($comment=$column.columnComment)
|
||||
#end
|
||||
$column.javaField: [
|
||||
{ required: true, message: "$comment不能为空", trigger: #if($column.htmlType == "select" || $column.htmlType == "radio")"change"#else"blur"#end }
|
||||
]#if($foreach.count != $columns.size()),#end
|
||||
#end
|
||||
#end
|
||||
}
|
||||
})
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data)
|
||||
|
||||
/** 查询${functionName}列表 */
|
||||
function getList() {
|
||||
loading.value = true
|
||||
#foreach ($column in $columns)
|
||||
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
||||
queryParams.value.params = {}
|
||||
#break
|
||||
#end
|
||||
#end
|
||||
#foreach ($column in $columns)
|
||||
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
||||
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
||||
if (null != daterange${AttrName}.value && '' != daterange${AttrName}.value) {
|
||||
queryParams.value.params["begin${AttrName}"] = daterange${AttrName}.value[0]
|
||||
queryParams.value.params["end${AttrName}"] = daterange${AttrName}.value[1]
|
||||
}
|
||||
#end
|
||||
#end
|
||||
list${BusinessName}(queryParams.value).then(response => {
|
||||
${businessName}List.value = proxy.handleTree(response.data, "${treeCode}", "${treeParentCode}")
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
/** 查询${functionName}下拉树结构 */
|
||||
function getTreeselect() {
|
||||
list${BusinessName}().then(response => {
|
||||
${businessName}Options.value = []
|
||||
const data = { ${treeCode}: 0, ${treeName}: '顶级节点', children: [] }
|
||||
data.children = proxy.handleTree(response.data, "${treeCode}", "${treeParentCode}")
|
||||
${businessName}Options.value.push(data)
|
||||
})
|
||||
}
|
||||
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false
|
||||
reset()
|
||||
}
|
||||
|
||||
// 表单重置
|
||||
function reset() {
|
||||
form.value = {
|
||||
#foreach ($column in $columns)
|
||||
#if($column.htmlType == "checkbox")
|
||||
$column.javaField: []#if($foreach.count != $columns.size()),#end
|
||||
#else
|
||||
$column.javaField: null#if($foreach.count != $columns.size()),#end
|
||||
#end
|
||||
#end
|
||||
}
|
||||
proxy.resetForm("${businessName}Ref")
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
getList()
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
#foreach ($column in $columns)
|
||||
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
||||
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
||||
daterange${AttrName}.value = []
|
||||
#end
|
||||
#end
|
||||
proxy.resetForm("queryRef")
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd(row: ${ClassName}) {
|
||||
reset()
|
||||
getTreeselect()
|
||||
if (row != null && row.${treeCode}) {
|
||||
form.value.${treeParentCode} = row.${treeCode}
|
||||
} else {
|
||||
form.value.${treeParentCode} = 0
|
||||
}
|
||||
open.value = true
|
||||
title.value = "添加${functionName}"
|
||||
}
|
||||
|
||||
/** 展开/折叠操作 */
|
||||
function toggleExpandAll() {
|
||||
refreshTable.value = false
|
||||
isExpandAll.value = !isExpandAll.value
|
||||
nextTick(() => {
|
||||
refreshTable.value = true
|
||||
})
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
async function handleUpdate(row: ${ClassName}) {
|
||||
reset()
|
||||
await getTreeselect()
|
||||
if (row != null) {
|
||||
form.value.${treeParentCode} = row.${treeParentCode}
|
||||
}
|
||||
get${BusinessName}(row.${pkColumn.javaField}!).then(response => {
|
||||
form.value = response.data
|
||||
#foreach ($column in $columns)
|
||||
#if($column.htmlType == "checkbox")
|
||||
form.value.$column.javaField = form.value.${column.javaField}.split(",")
|
||||
#end
|
||||
#end
|
||||
open.value = true
|
||||
title.value = "修改${functionName}"
|
||||
})
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.#[[$]]#refs["${businessName}Ref"].validate((valid: boolean) => {
|
||||
if (valid) {
|
||||
#foreach ($column in $columns)
|
||||
#if($column.htmlType == "checkbox")
|
||||
form.value.$column.javaField = form.value.${column.javaField}.join(",")
|
||||
#end
|
||||
#end
|
||||
if (form.value.${pkColumn.javaField} != null) {
|
||||
update${BusinessName}(form.value).then(() => {
|
||||
proxy.#[[$modal]]#.msgSuccess("修改成功")
|
||||
open.value = false
|
||||
getList()
|
||||
})
|
||||
} else {
|
||||
add${BusinessName}(form.value).then(() => {
|
||||
proxy.#[[$modal]]#.msgSuccess("新增成功")
|
||||
open.value = false
|
||||
getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row: ${ClassName}) {
|
||||
proxy.#[[$modal]]#.confirm('是否确认删除${functionName}编号为"' + row.${pkColumn.javaField} + '"的数据项?').then(function() {
|
||||
return del${BusinessName}(row.${pkColumn.javaField}!)
|
||||
}).then(() => {
|
||||
getList()
|
||||
proxy.#[[$modal]]#.msgSuccess("删除成功")
|
||||
}).catch(() => {})
|
||||
}
|
||||
|
||||
getList()
|
||||
</script>
|
||||
594
ruoyi-generator/src/main/resources/vm/vue/v3ts/index.vue.vm
Normal file
594
ruoyi-generator/src/main/resources/vm/vue/v3ts/index.vue.vm
Normal file
@@ -0,0 +1,594 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
||||
#foreach($column in $columns)
|
||||
#if($column.query)
|
||||
#set($dictType=$column.dictType)
|
||||
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
||||
#set($parentheseIndex=$column.columnComment.indexOf("("))
|
||||
#if($parentheseIndex != -1)
|
||||
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
|
||||
#else
|
||||
#set($comment=$column.columnComment)
|
||||
#end
|
||||
#if($column.htmlType == "input")
|
||||
<el-form-item label="${comment}" prop="${column.javaField}">
|
||||
<el-input
|
||||
v-model="queryParams.${column.javaField}"
|
||||
placeholder="请输入${comment}"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
#elseif(($column.htmlType == "select" || $column.htmlType == "radio") && "" != $dictType)
|
||||
<el-form-item label="${comment}" prop="${column.javaField}">
|
||||
<el-select v-model="queryParams.${column.javaField}" placeholder="请选择${comment}" clearable>
|
||||
<el-option
|
||||
v-for="dict in ${dictType}"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
#elseif(($column.htmlType == "select" || $column.htmlType == "radio") && $dictType)
|
||||
<el-form-item label="${comment}" prop="${column.javaField}">
|
||||
<el-select v-model="queryParams.${column.javaField}" placeholder="请选择${comment}" clearable>
|
||||
<el-option label="请选择字典生成" value="" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
#elseif($column.htmlType == "datetime" && $column.queryType != "BETWEEN")
|
||||
<el-form-item label="${comment}" prop="${column.javaField}">
|
||||
<el-date-picker clearable
|
||||
v-model="queryParams.${column.javaField}"
|
||||
type="date"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="请选择${comment}">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
#elseif($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
||||
<el-form-item label="${comment}" style="width: 308px">
|
||||
<el-date-picker
|
||||
v-model="daterange${AttrName}"
|
||||
value-format="YYYY-MM-DD"
|
||||
type="daterange"
|
||||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
#end
|
||||
#end
|
||||
#end
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['${permissionPrefix}:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="Edit"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['${permissionPrefix}:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['${permissionPrefix}:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="Download"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['${permissionPrefix}:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="${businessName}List" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
#foreach($column in $columns)
|
||||
#set($javaField=$column.javaField)
|
||||
#set($parentheseIndex=$column.columnComment.indexOf("("))
|
||||
#if($parentheseIndex != -1)
|
||||
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
|
||||
#else
|
||||
#set($comment=$column.columnComment)
|
||||
#end
|
||||
#if($column.pk)
|
||||
<el-table-column label="${comment}" align="center" prop="${javaField}" />
|
||||
#elseif($column.list && $column.htmlType == "datetime")
|
||||
<el-table-column label="${comment}" align="center" prop="${javaField}" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.${javaField}, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
#elseif($column.list && $column.htmlType == "imageUpload")
|
||||
<el-table-column label="${comment}" align="center" prop="${javaField}" width="100">
|
||||
<template #default="scope">
|
||||
<image-preview :src="scope.row.${javaField}" :width="50" :height="50"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
#elseif($column.list && "" != $column.dictType)
|
||||
<el-table-column label="${comment}" align="center" prop="${javaField}">
|
||||
<template #default="scope">
|
||||
#if($column.htmlType == "checkbox")
|
||||
<dict-tag :options="${column.dictType}" :value="scope.row.${javaField} ? scope.row.${javaField}.split(',') : []"/>
|
||||
#else
|
||||
<dict-tag :options="${column.dictType}" :value="scope.row.${javaField}"/>
|
||||
#end
|
||||
</template>
|
||||
</el-table-column>
|
||||
#elseif($column.list && "" != $javaField)
|
||||
<el-table-column label="${comment}" align="center" prop="${javaField}" />
|
||||
#end
|
||||
#end
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['${permissionPrefix}:edit']">修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['${permissionPrefix}:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改${functionName}对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
<el-form ref="${businessName}Ref" :model="form" :rules="rules" label-width="80px">
|
||||
#foreach($column in $columns)
|
||||
#set($field=$column.javaField)
|
||||
#if($column.insert && !$column.pk)
|
||||
#if(($column.usableColumn) || (!$column.superColumn))
|
||||
#set($parentheseIndex=$column.columnComment.indexOf("("))
|
||||
#if($parentheseIndex != -1)
|
||||
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
|
||||
#else
|
||||
#set($comment=$column.columnComment)
|
||||
#end
|
||||
#set($dictType=$column.dictType)
|
||||
#if($column.htmlType == "input")
|
||||
<el-form-item label="${comment}" prop="${field}">
|
||||
<el-input v-model="form.${field}" placeholder="请输入${comment}" />
|
||||
</el-form-item>
|
||||
#elseif($column.htmlType == "imageUpload")
|
||||
<el-form-item label="${comment}" prop="${field}">
|
||||
<image-upload v-model="form.${field}"/>
|
||||
</el-form-item>
|
||||
#elseif($column.htmlType == "fileUpload")
|
||||
<el-form-item label="${comment}" prop="${field}">
|
||||
<file-upload v-model="form.${field}"/>
|
||||
</el-form-item>
|
||||
#elseif($column.htmlType == "editor")
|
||||
<el-form-item label="${comment}">
|
||||
<editor v-model="form.${field}" :min-height="192"/>
|
||||
</el-form-item>
|
||||
#elseif($column.htmlType == "select" && "" != $dictType)
|
||||
<el-form-item label="${comment}" prop="${field}">
|
||||
<el-select v-model="form.${field}" placeholder="请选择${comment}">
|
||||
<el-option
|
||||
v-for="dict in ${dictType}"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
#if($column.javaType == "Integer" || $column.javaType == "Long")
|
||||
:value="parseInt(dict.value)"
|
||||
#else
|
||||
:value="dict.value"
|
||||
#end
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
#elseif($column.htmlType == "select" && $dictType)
|
||||
<el-form-item label="${comment}" prop="${field}">
|
||||
<el-select v-model="form.${field}" placeholder="请选择${comment}">
|
||||
<el-option label="请选择字典生成" value="" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
#elseif($column.htmlType == "checkbox" && "" != $dictType)
|
||||
<el-form-item label="${comment}" prop="${field}">
|
||||
<el-checkbox-group v-model="form.${field}">
|
||||
<el-checkbox
|
||||
v-for="dict in ${dictType}"
|
||||
:key="dict.value"
|
||||
:label="dict.value">
|
||||
{{dict.label}}
|
||||
</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
#elseif($column.htmlType == "checkbox" && $dictType)
|
||||
<el-form-item label="${comment}" prop="${field}">
|
||||
<el-checkbox-group v-model="form.${field}">
|
||||
<el-checkbox>请选择字典生成</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
#elseif($column.htmlType == "radio" && "" != $dictType)
|
||||
<el-form-item label="${comment}" prop="${field}">
|
||||
<el-radio-group v-model="form.${field}">
|
||||
<el-radio
|
||||
v-for="dict in ${dictType}"
|
||||
:key="dict.value"
|
||||
#if($column.javaType == "Integer" || $column.javaType == "Long")
|
||||
:label="parseInt(dict.value)"
|
||||
#else
|
||||
:label="dict.value"
|
||||
#end
|
||||
>{{dict.label}}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
#elseif($column.htmlType == "radio" && $dictType)
|
||||
<el-form-item label="${comment}" prop="${field}">
|
||||
<el-radio-group v-model="form.${field}">
|
||||
<el-radio label="1">请选择字典生成</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
#elseif($column.htmlType == "datetime")
|
||||
<el-form-item label="${comment}" prop="${field}">
|
||||
<el-date-picker clearable
|
||||
v-model="form.${field}"
|
||||
type="date"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="请选择${comment}">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
#elseif($column.htmlType == "textarea")
|
||||
<el-form-item label="${comment}" prop="${field}">
|
||||
<el-input v-model="form.${field}" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
#end
|
||||
#end
|
||||
#end
|
||||
#end
|
||||
#if($table.sub)
|
||||
<el-divider content-position="center">${subTable.functionName}信息</el-divider>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" icon="Plus" @click="handleAdd${subClassName}">添加</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" icon="Delete" @click="handleDelete${subClassName}">删除</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-table :data="${subclassName}List" @selection-change="handle${subClassName}SelectionChange" ref="${subclassName}">
|
||||
<el-table-column type="selection" width="50" align="center" />
|
||||
<el-table-column label="序号" width="60">
|
||||
<template #default="{ $index }">
|
||||
{{ $index + 1 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
#foreach($column in $subTable.columns)
|
||||
#set($javaField=$column.javaField)
|
||||
#set($parentheseIndex=$column.columnComment.indexOf("("))
|
||||
#if($parentheseIndex != -1)
|
||||
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
|
||||
#else
|
||||
#set($comment=$column.columnComment)
|
||||
#end
|
||||
#if($column.pk || $javaField == ${subTableFkclassName})
|
||||
#elseif($column.list && $column.htmlType == "input")
|
||||
<el-table-column label="$comment" prop="${javaField}" width="150">
|
||||
<template #default="scope">
|
||||
<el-input v-model="scope.row.$javaField" placeholder="请输入$comment" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
#elseif($column.list && $column.htmlType == "datetime")
|
||||
<el-table-column label="$comment" prop="${javaField}" width="240">
|
||||
<template #default="scope">
|
||||
<el-date-picker clearable
|
||||
v-model="scope.row.$javaField"
|
||||
type="date"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="请选择$comment">
|
||||
</el-date-picker>
|
||||
</template>
|
||||
</el-table-column>
|
||||
#elseif($column.list && ($column.htmlType == "select" || $column.htmlType == "radio") && "" != $column.dictType)
|
||||
<el-table-column label="$comment" prop="${javaField}" width="150">
|
||||
<template #default="scope">
|
||||
<el-select v-model="scope.row.$javaField" placeholder="请选择$comment">
|
||||
<el-option
|
||||
v-for="dict in $column.dictType"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
#elseif($column.list && ($column.htmlType == "select" || $column.htmlType == "radio") && "" == $column.dictType)
|
||||
<el-table-column label="$comment" prop="${javaField}" width="150">
|
||||
<template #default="scope">
|
||||
<el-select v-model="scope.row.$javaField" placeholder="请选择$comment">
|
||||
<el-option label="请选择字典生成" value="" />
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
#end
|
||||
#end
|
||||
</el-table>
|
||||
#end
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="Config">
|
||||
#if($table.sub)
|
||||
import type { ${ClassName}, ${subClassName}, ${BusinessName}QueryParams } from "@/types/api/${moduleName}/${businessName}"
|
||||
#else
|
||||
import type { ${ClassName}, ${BusinessName}QueryParams } from "@/types/api/${moduleName}/${businessName}"
|
||||
#end
|
||||
import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName} } from "@/api/${moduleName}/${businessName}"
|
||||
|
||||
const { proxy } = getCurrentInstance()
|
||||
#if(${dicts} != '')
|
||||
#set($dictsNoSymbol=$dicts.replace("'", ""))
|
||||
const { ${dictsNoSymbol} } = proxy.useDict(${dicts})
|
||||
#end
|
||||
|
||||
const ${businessName}List = ref<${ClassName}[]>([])
|
||||
#if($table.sub)
|
||||
const ${subclassName}List = ref([])
|
||||
#end
|
||||
const open = ref<boolean>(false)
|
||||
const loading = ref<boolean>(true)
|
||||
const showSearch = ref<boolean>(true)
|
||||
const ids = ref<number[]>([])
|
||||
#if($table.sub)
|
||||
const checked${subClassName} = ref([])
|
||||
#end
|
||||
const single = ref<boolean>(true)
|
||||
const multiple = ref<boolean>(true)
|
||||
const total = ref<number>(0)
|
||||
const title = ref<string>("")
|
||||
#foreach ($column in $columns)
|
||||
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
||||
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
||||
const daterange${AttrName} = ref<string[]>([])
|
||||
#end
|
||||
#end
|
||||
|
||||
const data = reactive({
|
||||
form: {} as ${ClassName},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
#foreach ($column in $columns)
|
||||
#if($column.query)
|
||||
$column.javaField: undefined#if($foreach.count != $columns.size()),#end
|
||||
#end
|
||||
#end
|
||||
} as ${BusinessName}QueryParams,
|
||||
rules: {
|
||||
#foreach ($column in $columns)
|
||||
#if($column.required)
|
||||
#set($parentheseIndex=$column.columnComment.indexOf("("))
|
||||
#if($parentheseIndex != -1)
|
||||
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
|
||||
#else
|
||||
#set($comment=$column.columnComment)
|
||||
#end
|
||||
$column.javaField: [
|
||||
{ required: true, message: "$comment不能为空", trigger: #if($column.htmlType == "select" || $column.htmlType == "radio")"change"#else"blur"#end }
|
||||
]#if($foreach.count != $columns.size()),#end
|
||||
#end
|
||||
#end
|
||||
}
|
||||
})
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data)
|
||||
|
||||
/** 查询${functionName}列表 */
|
||||
function getList() {
|
||||
loading.value = true
|
||||
#foreach ($column in $columns)
|
||||
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
||||
queryParams.value.params = {}
|
||||
#break
|
||||
#end
|
||||
#end
|
||||
#foreach ($column in $columns)
|
||||
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
||||
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
||||
if (null != daterange${AttrName}.value && '' != daterange${AttrName}.value) {
|
||||
queryParams.value.params["begin${AttrName}"] = daterange${AttrName}.value[0]
|
||||
queryParams.value.params["end${AttrName}"] = daterange${AttrName}.value[1]
|
||||
}
|
||||
#end
|
||||
#end
|
||||
list${BusinessName}(queryParams.value).then(response => {
|
||||
${businessName}List.value = response.rows
|
||||
total.value = response.total
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false
|
||||
reset()
|
||||
}
|
||||
|
||||
// 表单重置
|
||||
function reset() {
|
||||
form.value = {
|
||||
#foreach ($column in $columns)
|
||||
#if($column.htmlType == "checkbox")
|
||||
$column.javaField: []#if($foreach.count != $columns.size()),#end
|
||||
#else
|
||||
$column.javaField: null#if($foreach.count != $columns.size()),#end
|
||||
#end
|
||||
#end
|
||||
}
|
||||
#if($table.sub)
|
||||
${subclassName}List.value = []
|
||||
#end
|
||||
proxy.resetForm("${businessName}Ref")
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
#foreach ($column in $columns)
|
||||
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
||||
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
||||
daterange${AttrName}.value = []
|
||||
#end
|
||||
#end
|
||||
proxy.resetForm("queryRef")
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection: ${ClassName}[]) {
|
||||
ids.value = selection.map(item => item.${pkColumn.javaField})
|
||||
single.value = selection.length != 1
|
||||
multiple.value = !selection.length
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset()
|
||||
open.value = true
|
||||
title.value = "添加${functionName}"
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row: ${ClassName}) {
|
||||
reset()
|
||||
const _${pkColumn.javaField} = row.${pkColumn.javaField} || ids.value[0]
|
||||
get${BusinessName}(_${pkColumn.javaField}).then(response => {
|
||||
form.value = response.data
|
||||
#foreach ($column in $columns)
|
||||
#if($column.htmlType == "checkbox")
|
||||
form.value.$column.javaField = form.value.${column.javaField}.split(",")
|
||||
#end
|
||||
#end
|
||||
#if($table.sub)
|
||||
${subclassName}List.value = response.data?.${subclassName}List ?? []
|
||||
#end
|
||||
open.value = true
|
||||
title.value = "修改${functionName}"
|
||||
})
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.#[[$]]#refs["${businessName}Ref"].validate((valid: boolean) => {
|
||||
if (valid) {
|
||||
#foreach ($column in $columns)
|
||||
#if($column.htmlType == "checkbox")
|
||||
form.value.$column.javaField = form.value.${column.javaField}.join(",")
|
||||
#end
|
||||
#end
|
||||
#if($table.sub)
|
||||
form.value.${subclassName}List = ${subclassName}List.value
|
||||
#end
|
||||
if (form.value.${pkColumn.javaField} != null) {
|
||||
update${BusinessName}(form.value).then(() => {
|
||||
proxy.#[[$modal]]#.msgSuccess("修改成功")
|
||||
open.value = false
|
||||
getList()
|
||||
})
|
||||
} else {
|
||||
add${BusinessName}(form.value).then(() => {
|
||||
proxy.#[[$modal]]#.msgSuccess("新增成功")
|
||||
open.value = false
|
||||
getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row: ${ClassName}) {
|
||||
const _${pkColumn.javaField}s = row.${pkColumn.javaField} || ids.value
|
||||
proxy.#[[$modal]]#.confirm('是否确认删除${functionName}编号为"' + _${pkColumn.javaField}s + '"的数据项?').then(function() {
|
||||
return del${BusinessName}(_${pkColumn.javaField}s)
|
||||
}).then(() => {
|
||||
getList()
|
||||
proxy.#[[$modal]]#.msgSuccess("删除成功")
|
||||
}).catch(() => {})
|
||||
}
|
||||
|
||||
#if($table.sub)
|
||||
/** ${subTable.functionName}添加按钮操作 */
|
||||
function handleAdd${subClassName}() {
|
||||
let obj: ${subClassName} = {}
|
||||
#foreach($column in $subTable.columns)
|
||||
#if($column.pk || $column.javaField == ${subTableFkclassName})
|
||||
#elseif($column.list && "" != $javaField)
|
||||
obj.$column.javaField = undefined
|
||||
#end
|
||||
#end
|
||||
${subclassName}List.value.push(obj)
|
||||
}
|
||||
|
||||
/** ${subTable.functionName}删除按钮操作 */
|
||||
function handleDelete${subClassName}() {
|
||||
if (checked${subClassName}.value.length == 0) {
|
||||
proxy.#[[$modal]]#.msgError("请先选择要删除的${subTable.functionName}数据")
|
||||
} else {
|
||||
const ${subclassName}s = ${subclassName}List.value
|
||||
const checked${subClassName}s = checked${subClassName}.value
|
||||
${subclassName}List.value = ${subclassName}s.filter(function(item: any) {
|
||||
return checked${subClassName}s.indexOf(item.index) == -1
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/** 复选框选中数据 */
|
||||
function handle${subClassName}SelectionChange(selection: any[]) {
|
||||
checked${subClassName}.value = selection.map(item => item.index)
|
||||
}
|
||||
|
||||
#end
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download('${moduleName}/${businessName}/export', {
|
||||
...queryParams.value
|
||||
}, `${businessName}_#[[${new Date().getTime()}]]#.xlsx`)
|
||||
}
|
||||
|
||||
getList()
|
||||
</script>
|
||||
39
ruoyi-ui/src/api/wcs/apiconfig.js
Normal file
39
ruoyi-ui/src/api/wcs/apiconfig.js
Normal file
@@ -0,0 +1,39 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function listApiConfig(query) {
|
||||
return request({
|
||||
url: '/wcs/api/config/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function getApiConfig(apiId) {
|
||||
return request({
|
||||
url: '/wcs/api/config/' + apiId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function addApiConfig(data) {
|
||||
return request({
|
||||
url: '/wcs/api/config',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function updateApiConfig(data) {
|
||||
return request({
|
||||
url: '/wcs/api/config',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function delApiConfig(apiId) {
|
||||
return request({
|
||||
url: '/wcs/api/config/' + apiId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
39
ruoyi-ui/src/api/wcs/device.js
Normal file
39
ruoyi-ui/src/api/wcs/device.js
Normal file
@@ -0,0 +1,39 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function listDevice(query) {
|
||||
return request({
|
||||
url: '/wcs/device/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function getDevice(deviceId) {
|
||||
return request({
|
||||
url: '/wcs/device/' + deviceId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function addDevice(data) {
|
||||
return request({
|
||||
url: '/wcs/device',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function updateDevice(data) {
|
||||
return request({
|
||||
url: '/wcs/device',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function delDevice(deviceId) {
|
||||
return request({
|
||||
url: '/wcs/device/' + deviceId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
55
ruoyi-ui/src/api/wcs/flow.js
Normal file
55
ruoyi-ui/src/api/wcs/flow.js
Normal file
@@ -0,0 +1,55 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function listFlowDef(query) {
|
||||
return request({
|
||||
url: '/wcs/flow/def/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function getFlowDef(flowId) {
|
||||
return request({
|
||||
url: '/wcs/flow/def/' + flowId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function addFlowDef(data) {
|
||||
return request({
|
||||
url: '/wcs/flow/def',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function updateFlowDef(data) {
|
||||
return request({
|
||||
url: '/wcs/flow/def',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function delFlowDef(flowId) {
|
||||
return request({
|
||||
url: '/wcs/flow/def/' + flowId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
export function listFlowInstance(query) {
|
||||
return request({
|
||||
url: '/wcs/flow/instance/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function listFlowLog(query) {
|
||||
return request({
|
||||
url: '/wcs/flow/log/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
52
ruoyi-ui/src/api/wcs/flowinstance.js
Normal file
52
ruoyi-ui/src/api/wcs/flowinstance.js
Normal file
@@ -0,0 +1,52 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询流程实例列表
|
||||
export function listFlowInstance(query) {
|
||||
return request({
|
||||
url: '/wcs/flow/instance/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询流程实例详细
|
||||
export function getFlowInstance(id) {
|
||||
return request({
|
||||
url: '/wcs/flow/instance/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增流程实例
|
||||
export function addFlowInstance(data) {
|
||||
return request({
|
||||
url: '/wcs/flow/instance',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改流程实例
|
||||
export function updateFlowInstance(data) {
|
||||
return request({
|
||||
url: '/wcs/flow/instance',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除流程实例
|
||||
export function delFlowInstance(id) {
|
||||
return request({
|
||||
url: '/wcs/flow/instance/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 执行流程
|
||||
export function executeFlowInstance(flowDefId) {
|
||||
return request({
|
||||
url: '/wcs/flow/instance/execute/' + flowDefId,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
26
ruoyi-ui/src/api/wcs/flowlog.js
Normal file
26
ruoyi-ui/src/api/wcs/flowlog.js
Normal file
@@ -0,0 +1,26 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询流程节点日志列表
|
||||
export function listFlowLog(query) {
|
||||
return request({
|
||||
url: '/wcs/flow/log/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询流程节点日志详细
|
||||
export function getFlowLog(id) {
|
||||
return request({
|
||||
url: '/wcs/flow/log/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 删除流程节点日志
|
||||
export function delFlowLog(id) {
|
||||
return request({
|
||||
url: '/wcs/flow/log/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
39
ruoyi-ui/src/api/wcs/point.js
Normal file
39
ruoyi-ui/src/api/wcs/point.js
Normal file
@@ -0,0 +1,39 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function listPoint(query) {
|
||||
return request({
|
||||
url: '/wcs/device/point/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function getPoint(pointId) {
|
||||
return request({
|
||||
url: '/wcs/device/point/' + pointId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function addPoint(data) {
|
||||
return request({
|
||||
url: '/wcs/device/point',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function updatePoint(data) {
|
||||
return request({
|
||||
url: '/wcs/device/point',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function delPoint(pointId) {
|
||||
return request({
|
||||
url: '/wcs/device/point/' + pointId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
400
ruoyi-ui/src/views/wcs/apiconfig/index.vue
Normal file
400
ruoyi-ui/src/views/wcs/apiconfig/index.vue
Normal file
@@ -0,0 +1,400 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
|
||||
<el-form-item label="<22>ӿڱ<D3BF><DAB1><EFBFBD>" prop="apiCode">
|
||||
<el-input
|
||||
v-model="queryParams.apiCode"
|
||||
placeholder="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӿڱ<D3BF><DAB1><EFBFBD>"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="<22>ӿ<EFBFBD><D3BF><EFBFBD><EFBFBD><EFBFBD>" prop="apiName">
|
||||
<el-input
|
||||
v-model="queryParams.apiName"
|
||||
placeholder="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӿ<EFBFBD><D3BF><EFBFBD><EFBFBD><EFBFBD>"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ" prop="requestMethod">
|
||||
<el-select v-model="queryParams.requestMethod" placeholder="<22><>ѡ<EFBFBD><D1A1>" clearable>
|
||||
<el-option label="GET" value="GET" />
|
||||
<el-option label="POST" value="POST" />
|
||||
<el-option label="PUT" value="PUT" />
|
||||
<el-option label="DELETE" value="DELETE" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="<22><><EFBFBD><EFBFBD>" prop="direction">
|
||||
<el-select v-model="queryParams.direction" placeholder="<22><>ѡ<EFBFBD><D1A1>" clearable>
|
||||
<el-option label="<22><>վ" value="inbound" />
|
||||
<el-option label="<22><>վ" value="outbound" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="״̬" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="<22>ӿ<EFBFBD>״̬" clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.sys_normal_disable"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"><EFBFBD><EFBFBD><EFBFBD><EFBFBD></el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"><EFBFBD><EFBFBD><EFBFBD><EFBFBD></el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['wcs:api:add']"
|
||||
><EFBFBD><EFBFBD><EFBFBD><EFBFBD></el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['wcs:api:edit']"
|
||||
><EFBFBD><EFBFBD></el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['wcs:api:remove']"
|
||||
>ɾ<EFBFBD><EFBFBD></el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['wcs:api:export']"
|
||||
><EFBFBD><EFBFBD><EFBFBD><EFBFBD></el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="apiList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="<22>ӿ<EFBFBD>ID" align="center" prop="apiId" width="70" />
|
||||
<el-table-column label="<22>ӿڱ<D3BF><DAB1><EFBFBD>" align="center" prop="apiCode" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="<22>ӿ<EFBFBD><D3BF><EFBFBD><EFBFBD><EFBFBD>" align="center" prop="apiName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="<22>ӿڵ<D3BF>ַ" align="center" prop="apiUrl" :show-overflow-tooltip="true" min-width="180" />
|
||||
<el-table-column label="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ" align="center" prop="requestMethod" width="90">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="methodTagType(scope.row.requestMethod)" size="small">{{ scope.row.requestMethod }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="<22><><EFBFBD><EFBFBD>" align="center" prop="direction" width="80">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.direction === 'inbound'"><EFBFBD><EFBFBD>վ</span>
|
||||
<span v-else-if="scope.row.direction === 'outbound'"><EFBFBD><EFBFBD>վ</span>
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="<22><>ʱ(ms)" align="center" prop="timeout" width="90" />
|
||||
<el-table-column label="<22><><EFBFBD><EFBFBD>" align="center" prop="retryCount" width="60" />
|
||||
<el-table-column label="״̬" align="center" prop="status" width="80">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="<22><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>" align="center" prop="createTime" width="160">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="<22><><EFBFBD><EFBFBD>" align="center" class-name="small-padding fixed-width" width="160">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['wcs:api:edit']"
|
||||
><EFBFBD><EFBFBD></el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['wcs:api:remove']"
|
||||
>ɾ<EFBFBD><EFBFBD></el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- <EFBFBD><EFBFBD><EFBFBD>ӻ<EFBFBD><EFBFBD>Ľӿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>öԻ<EFBFBD><EFBFBD><EFBFBD> -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="650px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="<22>ӿڱ<D3BF><DAB1><EFBFBD>" prop="apiCode">
|
||||
<el-input v-model="form.apiCode" placeholder="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӿڱ<D3BF><DAB1><EFBFBD>" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="<22>ӿ<EFBFBD><D3BF><EFBFBD><EFBFBD><EFBFBD>" prop="apiName">
|
||||
<el-input v-model="form.apiName" placeholder="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӿ<EFBFBD><D3BF><EFBFBD><EFBFBD><EFBFBD>" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="<22>ӿڵ<D3BF>ַ" prop="apiUrl">
|
||||
<el-input v-model="form.apiUrl" placeholder="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӿڵ<D3BF>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD> http://wms-server/api/task" />
|
||||
</el-form-item>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ" prop="requestMethod">
|
||||
<el-select v-model="form.requestMethod" placeholder="<22><>ѡ<EFBFBD><D1A1>">
|
||||
<el-option label="GET" value="GET" />
|
||||
<el-option label="POST" value="POST" />
|
||||
<el-option label="PUT" value="PUT" />
|
||||
<el-option label="DELETE" value="DELETE" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" prop="contentType">
|
||||
<el-select v-model="form.contentType" placeholder="<22><>ѡ<EFBFBD><D1A1>">
|
||||
<el-option label="application/json" value="application/json" />
|
||||
<el-option label="application/xml" value="application/xml" />
|
||||
<el-option label="application/x-www-form-urlencoded" value="application/x-www-form-urlencoded" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="<22><><EFBFBD><EFBFBD>" prop="direction">
|
||||
<el-select v-model="form.direction" placeholder="<22><>ѡ<EFBFBD><D1A1>">
|
||||
<el-option label="<22><>վ" value="inbound" />
|
||||
<el-option label="<22><>վ" value="outbound" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="<22><>ʱ(ms)" prop="timeout">
|
||||
<el-input-number v-model="form.timeout" controls-position="right" :min="1000" :max="300000" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="<22><><EFBFBD>Դ<EFBFBD><D4B4><EFBFBD>" prop="retryCount">
|
||||
<el-input-number v-model="form.retryCount" controls-position="right" :min="0" :max="10" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="״̬" prop="status">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio
|
||||
v-for="dict in dict.type.sys_normal_disable"
|
||||
:key="dict.value"
|
||||
:label="dict.value"
|
||||
>{{dict.label}}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="<22><>ע" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">ȷ <EFBFBD><EFBFBD></el-button>
|
||||
<el-button @click="cancel">ȡ <EFBFBD><EFBFBD></el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listApiConfig, getApiConfig, addApiConfig, updateApiConfig, delApiConfig } from "@/api/wcs/apiconfig"
|
||||
|
||||
export default {
|
||||
name: "WcsApiConfig",
|
||||
dicts: ['sys_normal_disable'],
|
||||
data() {
|
||||
return {
|
||||
// <20><><EFBFBD>ֲ<EFBFBD>
|
||||
loading: true,
|
||||
// ѡ<><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
ids: [],
|
||||
// <20>ǵ<EFBFBD><C7B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
single: true,
|
||||
// <20>Ƕ<EFBFBD><C7B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
multiple: true,
|
||||
// <20><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
showSearch: true,
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
total: 0,
|
||||
// <20>ӿ<EFBFBD><D3BF><EFBFBD><EFBFBD>ñ<EFBFBD><C3B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
apiList: [],
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
title: "",
|
||||
// <20>Ƿ<EFBFBD><C7B7><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
open: false,
|
||||
// <20><>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD>
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
apiCode: undefined,
|
||||
apiName: undefined,
|
||||
requestMethod: undefined,
|
||||
direction: undefined,
|
||||
status: undefined
|
||||
},
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
form: {},
|
||||
// <20><><EFBFBD><EFBFBD>У<EFBFBD><D0A3>
|
||||
rules: {
|
||||
apiCode: [
|
||||
{ required: true, message: "<22>ӿڱ<D3BF><DAB1>벻<EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>", trigger: "blur" }
|
||||
],
|
||||
apiName: [
|
||||
{ required: true, message: "<22>ӿ<EFBFBD><D3BF><EFBFBD><EFBFBD>Ʋ<EFBFBD><C6B2><EFBFBD>Ϊ<EFBFBD><CEAA>", trigger: "blur" }
|
||||
],
|
||||
apiUrl: [
|
||||
{ required: true, message: "<22>ӿڵ<D3BF>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>", trigger: "blur" }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
/** <20><>ѯ<EFBFBD>ӿ<EFBFBD><D3BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD> */
|
||||
getList() {
|
||||
this.loading = true
|
||||
listApiConfig(this.queryParams).then(response => {
|
||||
this.apiList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><CABD>ǩ<EFBFBD><C7A9>ɫ
|
||||
methodTagType(method) {
|
||||
const map = { GET: '', POST: 'success', PUT: 'warning', DELETE: 'danger' }
|
||||
return map[method] || 'info'
|
||||
},
|
||||
// ȡ<><C8A1><EFBFBD><EFBFBD>ť
|
||||
cancel() {
|
||||
this.open = false
|
||||
this.reset()
|
||||
},
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
reset() {
|
||||
this.form = {
|
||||
apiId: undefined,
|
||||
apiCode: undefined,
|
||||
apiName: undefined,
|
||||
apiUrl: undefined,
|
||||
requestMethod: "POST",
|
||||
contentType: "application/json",
|
||||
timeout: 30000,
|
||||
retryCount: 0,
|
||||
direction: undefined,
|
||||
status: "0",
|
||||
remark: undefined
|
||||
}
|
||||
this.resetForm("form")
|
||||
},
|
||||
/** <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ť<EFBFBD><C5A5><EFBFBD><EFBFBD> */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1
|
||||
this.getList()
|
||||
},
|
||||
/** <20><><EFBFBD>ð<EFBFBD>ť<EFBFBD><C5A5><EFBFBD><EFBFBD> */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm")
|
||||
this.handleQuery()
|
||||
},
|
||||
// <20><>ѡ<EFBFBD><D1A1>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.apiId)
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ť<EFBFBD><C5A5><EFBFBD><EFBFBD> */
|
||||
handleAdd() {
|
||||
this.reset()
|
||||
this.open = true
|
||||
this.title = "<22><><EFBFBD>ӽӿ<D3BD><D3BF><EFBFBD><EFBFBD><EFBFBD>"
|
||||
},
|
||||
/** <20>İ<DEB8>ť<EFBFBD><C5A5><EFBFBD><EFBFBD> */
|
||||
handleUpdate(row) {
|
||||
this.reset()
|
||||
const apiId = row.apiId || this.ids
|
||||
getApiConfig(apiId).then(response => {
|
||||
this.form = response.data
|
||||
this.open = true
|
||||
this.title = "<22>Ľӿ<C4BD><D3BF><EFBFBD><EFBFBD><EFBFBD>"
|
||||
})
|
||||
},
|
||||
/** <20>ύ<EFBFBD><E1BDBB>ť */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.apiId != undefined) {
|
||||
updateApiConfig(this.form).then(() => {
|
||||
this.$modal.msgSuccess("<22>ijɹ<C4B3>")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
} else {
|
||||
addApiConfig(this.form).then(() => {
|
||||
this.$modal.msgSuccess("<22><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
/** ɾ<><C9BE><EFBFBD><EFBFBD>ť<EFBFBD><C5A5><EFBFBD><EFBFBD> */
|
||||
handleDelete(row) {
|
||||
const apiIds = row.apiId || this.ids
|
||||
this.$modal.confirm('<27>Ƿ<EFBFBD>ȷ<EFBFBD><C8B7>ɾ<EFBFBD><C9BE><EFBFBD>ӿڱ<D3BF><DAB1><EFBFBD>Ϊ"' + apiIds + '"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').then(function() {
|
||||
return delApiConfig(apiIds)
|
||||
}).then(() => {
|
||||
this.getList()
|
||||
this.$modal.msgSuccess("ɾ<><C9BE><EFBFBD>ɹ<EFBFBD>")
|
||||
}).catch(() => {})
|
||||
},
|
||||
/** <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ť<EFBFBD><C5A5><EFBFBD><EFBFBD> */
|
||||
handleExport() {
|
||||
this.download('wcs/api/config/export', {
|
||||
...this.queryParams
|
||||
}, `apiconfig_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
330
ruoyi-ui/src/views/wcs/device/index.vue
Normal file
330
ruoyi-ui/src/views/wcs/device/index.vue
Normal file
@@ -0,0 +1,330 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
|
||||
<el-form-item label="<22>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>" prop="deviceCode">
|
||||
<el-input
|
||||
v-model="queryParams.deviceCode"
|
||||
placeholder="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="<22>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>" prop="deviceName">
|
||||
<el-input
|
||||
v-model="queryParams.deviceName"
|
||||
placeholder="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="<22>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>" prop="deviceType">
|
||||
<el-select v-model="queryParams.deviceType" placeholder="<22><>ѡ<EFBFBD><D1A1><EFBFBD>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>" clearable>
|
||||
<el-option label="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" value="conveyor" />
|
||||
<el-option label="AGV" value="agv" />
|
||||
<el-option label="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" value="elevator" />
|
||||
<el-option label="<22>Ѷ<EFBFBD><D1B6><EFBFBD>" value="stacker" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="״̬" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="<22>豸״̬" clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.sys_normal_disable"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"><EFBFBD><EFBFBD><EFBFBD><EFBFBD></el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"><EFBFBD><EFBFBD><EFBFBD><EFBFBD></el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['wcs:device:add']"
|
||||
><EFBFBD><EFBFBD><EFBFBD><EFBFBD></el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['wcs:device:edit']"
|
||||
><EFBFBD><EFBFBD></el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['wcs:device:remove']"
|
||||
>ɾ<EFBFBD><EFBFBD></el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="deviceList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="<22>豸ID" align="center" prop="deviceId" width="80" />
|
||||
<el-table-column label="<22>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>" align="center" prop="deviceCode" />
|
||||
<el-table-column label="<22>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>" align="center" prop="deviceName" />
|
||||
<el-table-column label="<22>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>" align="center" prop="deviceType" />
|
||||
<el-table-column label="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" align="center" prop="areaCode" />
|
||||
<el-table-column label="ͨ<><CDA8>Э<EFBFBD><D0AD>" align="center" prop="protocolType" />
|
||||
<el-table-column label="IP<49><50>ַ" align="center" prop="ipAddress" />
|
||||
<el-table-column label="<22>˿<EFBFBD>" align="center" prop="port" width="80" />
|
||||
<el-table-column label="״̬" align="center" prop="status" width="80">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="<22><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>" align="center" prop="createTime" width="160">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="<22><><EFBFBD><EFBFBD>" align="center" class-name="small-padding fixed-width" width="160">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['wcs:device:edit']"
|
||||
><EFBFBD><EFBFBD></el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['wcs:device:remove']"
|
||||
>ɾ<EFBFBD><EFBFBD></el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- <EFBFBD><EFBFBD><EFBFBD>ӻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>豸<EFBFBD>Ի<EFBFBD><EFBFBD><EFBFBD> -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="<22>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>" prop="deviceCode">
|
||||
<el-input v-model="form.deviceCode" placeholder="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="<22>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>" prop="deviceName">
|
||||
<el-input v-model="form.deviceName" placeholder="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="<22>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>" prop="deviceType">
|
||||
<el-select v-model="form.deviceType" placeholder="<22><>ѡ<EFBFBD><D1A1><EFBFBD>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>">
|
||||
<el-option label="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" value="conveyor" />
|
||||
<el-option label="AGV" value="agv" />
|
||||
<el-option label="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" value="elevator" />
|
||||
<el-option label="<22>Ѷ<EFBFBD><D1B6><EFBFBD>" value="stacker" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" prop="areaCode">
|
||||
<el-input v-model="form.areaCode" placeholder="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="ͨ<><CDA8>Э<EFBFBD><D0AD>" prop="protocolType">
|
||||
<el-select v-model="form.protocolType" placeholder="<22><>ѡ<EFBFBD><D1A1>ͨ<EFBFBD><CDA8>Э<EFBFBD><D0AD>">
|
||||
<el-option label="Modbus TCP" value="modbus_tcp" />
|
||||
<el-option label="OPC UA" value="opc_ua" />
|
||||
<el-option label="S7" value="s7" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="״̬" prop="status">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio
|
||||
v-for="dict in dict.type.sys_normal_disable"
|
||||
:key="dict.value"
|
||||
:label="dict.value"
|
||||
>{{dict.label}}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="IP<49><50>ַ" prop="ipAddress">
|
||||
<el-input v-model="form.ipAddress" placeholder="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>IP<49><50>ַ" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="<22>˿<EFBFBD>" prop="port">
|
||||
<el-input-number v-model="form.port" controls-position="right" :min="1" :max="65535" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="<22><>ע" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">ȷ <EFBFBD><EFBFBD></el-button>
|
||||
<el-button @click="cancel">ȡ <EFBFBD><EFBFBD></el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listDevice, getDevice, addDevice, updateDevice, delDevice } from "@/api/wcs/device"
|
||||
|
||||
export default {
|
||||
name: "WcsDevice",
|
||||
dicts: ['sys_normal_disable'],
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
ids: [],
|
||||
single: true,
|
||||
multiple: true,
|
||||
showSearch: true,
|
||||
total: 0,
|
||||
deviceList: [],
|
||||
title: "",
|
||||
open: false,
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
deviceCode: undefined,
|
||||
deviceName: undefined,
|
||||
deviceType: undefined,
|
||||
status: undefined
|
||||
},
|
||||
form: {},
|
||||
rules: {
|
||||
deviceCode: [
|
||||
{ required: true, message: "<22>豸<EFBFBD><E8B1B8><EFBFBD>벻<EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>", trigger: "blur" }
|
||||
],
|
||||
deviceName: [
|
||||
{ required: true, message: "<22>豸<EFBFBD><E8B1B8><EFBFBD>Ʋ<EFBFBD><C6B2><EFBFBD>Ϊ<EFBFBD><CEAA>", trigger: "blur" }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.loading = true
|
||||
listDevice(this.queryParams).then(response => {
|
||||
this.deviceList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
cancel() {
|
||||
this.open = false
|
||||
this.reset()
|
||||
},
|
||||
reset() {
|
||||
this.form = {
|
||||
deviceId: undefined,
|
||||
deviceCode: undefined,
|
||||
deviceName: undefined,
|
||||
deviceType: undefined,
|
||||
areaCode: undefined,
|
||||
protocolType: undefined,
|
||||
ipAddress: undefined,
|
||||
port: undefined,
|
||||
status: "0",
|
||||
remark: undefined
|
||||
}
|
||||
this.resetForm("form")
|
||||
},
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1
|
||||
this.getList()
|
||||
},
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm")
|
||||
this.handleQuery()
|
||||
},
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.deviceId)
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
handleAdd() {
|
||||
this.reset()
|
||||
this.open = true
|
||||
this.title = "<22><><EFBFBD><EFBFBD><EFBFBD>豸"
|
||||
},
|
||||
handleUpdate(row) {
|
||||
this.reset()
|
||||
const deviceId = row.deviceId || this.ids
|
||||
getDevice(deviceId).then(response => {
|
||||
this.form = response.data
|
||||
this.open = true
|
||||
this.title = "<22><EFBFBD><DEB8>豸"
|
||||
})
|
||||
},
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.deviceId != undefined) {
|
||||
updateDevice(this.form).then(() => {
|
||||
this.$modal.msgSuccess("<22>ijɹ<C4B3>")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
} else {
|
||||
addDevice(this.form).then(() => {
|
||||
this.$modal.msgSuccess("<22><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
handleDelete(row) {
|
||||
const deviceIds = row.deviceId || this.ids
|
||||
this.$modal.confirm('<27>Ƿ<EFBFBD>ȷ<EFBFBD><C8B7>ɾ<EFBFBD><C9BE><EFBFBD>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>Ϊ"' + deviceIds + '"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').then(function() {
|
||||
return delDevice(deviceIds)
|
||||
}).then(() => {
|
||||
this.getList()
|
||||
this.$modal.msgSuccess("ɾ<><C9BE><EFBFBD>ɹ<EFBFBD>")
|
||||
}).catch(() => {})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
353
ruoyi-ui/src/views/wcs/flowdef/index.vue
Normal file
353
ruoyi-ui/src/views/wcs/flowdef/index.vue
Normal file
@@ -0,0 +1,353 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
|
||||
<el-form-item label="流程编码" prop="flowCode">
|
||||
<el-input
|
||||
v-model="queryParams.flowCode"
|
||||
placeholder="请输入流程编码"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="流程名称" prop="flowName">
|
||||
<el-input
|
||||
v-model="queryParams.flowName"
|
||||
placeholder="请输入流程名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="流程类型" prop="flowType">
|
||||
<el-select v-model="queryParams.flowType" placeholder="请选择流程类型" clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.wcs_flow_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.wcs_flow_status"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['wcs:flow:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['wcs:flow:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['wcs:flow:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['wcs:flow:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="flowList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="流程ID" align="center" prop="flowId" width="70" />
|
||||
<el-table-column label="流程编码" align="center" prop="flowCode" />
|
||||
<el-table-column label="流程名称" align="center" prop="flowName" />
|
||||
<el-table-column label="流程类型" align="center" prop="flowType" width="100">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.wcs_flow_type" :value="scope.row.flowType"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="版本" align="center" prop="version" width="70" />
|
||||
<el-table-column label="状态" align="center" prop="status" width="80">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.wcs_flow_status" :value="scope.row.status"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['wcs:flow:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['wcs:flow:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改流程定义对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="流程编码" prop="flowCode">
|
||||
<el-input v-model="form.flowCode" placeholder="请输入流程编码" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="流程名称" prop="flowName">
|
||||
<el-input v-model="form.flowName" placeholder="请输入流程名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="流程类型" prop="flowType">
|
||||
<el-select v-model="form.flowType" placeholder="请选择流程类型">
|
||||
<el-option
|
||||
v-for="dict in dict.type.wcs_flow_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="版本" prop="version">
|
||||
<el-input-number v-model="form.version" controls-position="right" :min="1" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio
|
||||
v-for="dict in dict.type.wcs_flow_status"
|
||||
:key="dict.value"
|
||||
:label="dict.value"
|
||||
>{{dict.label}}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listFlowDef, getFlowDef, addFlowDef, updateFlowDef, delFlowDef } from "@/api/wcs/flow"
|
||||
|
||||
export default {
|
||||
name: "WcsFlowDef",
|
||||
dicts: ['wcs_flow_type', 'wcs_flow_status'],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 流程定义表格数据
|
||||
flowList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
flowCode: undefined,
|
||||
flowName: undefined,
|
||||
flowType: undefined,
|
||||
status: undefined
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
flowCode: [
|
||||
{ required: true, message: "流程编码不能为空", trigger: "blur" }
|
||||
],
|
||||
flowName: [
|
||||
{ required: true, message: "流程名称不能为空", trigger: "blur" }
|
||||
],
|
||||
flowType: [
|
||||
{ required: true, message: "流程类型不能为空", trigger: "change" }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
/** 查询流程定义列表 */
|
||||
getList() {
|
||||
this.loading = true
|
||||
listFlowDef(this.queryParams).then(response => {
|
||||
this.flowList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false
|
||||
this.reset()
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
flowId: undefined,
|
||||
flowCode: undefined,
|
||||
flowName: undefined,
|
||||
flowType: undefined,
|
||||
version: 1,
|
||||
status: "0",
|
||||
remark: undefined
|
||||
}
|
||||
this.resetForm("form")
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1
|
||||
this.getList()
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm")
|
||||
this.handleQuery()
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.flowId)
|
||||
this.single = selection.length != 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset()
|
||||
this.open = true
|
||||
this.title = "添加流程定义"
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset()
|
||||
const flowId = row.flowId || this.ids
|
||||
getFlowDef(flowId).then(response => {
|
||||
this.form = response.data
|
||||
this.open = true
|
||||
this.title = "修改流程定义"
|
||||
})
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm: function() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.flowId != undefined) {
|
||||
updateFlowDef(this.form).then(() => {
|
||||
this.$modal.msgSuccess("修改成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
} else {
|
||||
addFlowDef(this.form).then(() => {
|
||||
this.$modal.msgSuccess("新增成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const flowIds = row.flowId || this.ids
|
||||
this.$modal.confirm('是否确认删除流程定义编号为"' + flowIds + '"的数据项?').then(function() {
|
||||
return delFlowDef(flowIds)
|
||||
}).then(() => {
|
||||
this.getList()
|
||||
this.$modal.msgSuccess("删除成功")
|
||||
}).catch(() => {})
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('wcs/flow/def/export', {
|
||||
...this.queryParams
|
||||
}, `flowdef_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
320
ruoyi-ui/src/views/wcs/flowinstance/index.vue
Normal file
320
ruoyi-ui/src/views/wcs/flowinstance/index.vue
Normal file
@@ -0,0 +1,320 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
|
||||
<el-form-item label="<22><><EFBFBD>̶<EFBFBD><CCB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" prop="processDefName">
|
||||
<el-input
|
||||
v-model="queryParams.processDefName"
|
||||
placeholder="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̶<EFBFBD><CCB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="״̬" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="ʵ<><CAB5>״̬" clearable>
|
||||
<el-option
|
||||
v-for="dict in statusOptions"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"><EFBFBD><EFBFBD><EFBFBD><EFBFBD></el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"><EFBFBD><EFBFBD><EFBFBD><EFBFBD></el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['wcs:flowinstance:add']"
|
||||
><EFBFBD><EFBFBD><EFBFBD><EFBFBD></el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['wcs:flowinstance:edit']"
|
||||
><EFBFBD><EFBFBD></el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['wcs:flowinstance:remove']"
|
||||
>ɾ<EFBFBD><EFBFBD></el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['wcs:flowinstance:export']"
|
||||
><EFBFBD><EFBFBD><EFBFBD><EFBFBD></el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="instanceList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="ʵ<><CAB5>ID" align="center" prop="instanceId" />
|
||||
<el-table-column label="<22><><EFBFBD>̶<EFBFBD><CCB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" align="center" prop="processDefName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="״̬" align="center" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="statusTagType(scope.row.status)">{{ statusLabel(scope.row.status) }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="<22><>ʼʱ<CABC><CAB1>" align="center" prop="startTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.startTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="<22><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>" align="center" prop="endTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.endTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="<22><>ע" align="center" prop="remark" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="<22><><EFBFBD><EFBFBD>" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['wcs:flowinstance:edit']"
|
||||
><EFBFBD><EFBFBD></el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['wcs:flowinstance:remove']"
|
||||
>ɾ<EFBFBD><EFBFBD></el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-video-play"
|
||||
@click="handleExecute(scope.row)"
|
||||
v-hasPermi="['wcs:flowinstance:execute']"
|
||||
>执行</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- <EFBFBD><EFBFBD><EFBFBD>ӻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD><EFBFBD><EFBFBD>Ի<EFBFBD><EFBFBD><EFBFBD> -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="550px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="110px">
|
||||
<el-form-item label="<22><><EFBFBD>̶<EFBFBD><CCB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" prop="processDefName">
|
||||
<el-input v-model="form.processDefName" placeholder="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̶<EFBFBD><CCB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" />
|
||||
</el-form-item>
|
||||
<el-form-item label="״̬" prop="status">
|
||||
<el-select v-model="form.status" placeholder="<22><>ѡ<EFBFBD><D1A1>״̬">
|
||||
<el-option
|
||||
v-for="dict in statusOptions"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="<22><>ʼʱ<CABC><CAB1>" prop="startTime">
|
||||
<el-date-picker
|
||||
v-model="form.startTime"
|
||||
type="datetime"
|
||||
placeholder="ѡ<><D1A1>ʼʱ<CABC><CAB1>"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="<22><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>" prop="endTime">
|
||||
<el-date-picker
|
||||
v-model="form.endTime"
|
||||
type="datetime"
|
||||
placeholder="ѡ<><D1A1><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="<22><>ע" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">ȷ <EFBFBD><EFBFBD></el-button>
|
||||
<el-button @click="cancel">ȡ <EFBFBD><EFBFBD></el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listFlowInstance, getFlowInstance, delFlowInstance, addFlowInstance, updateFlowInstance, executeFlowInstance } from "@/api/wcs/flowinstance"
|
||||
|
||||
export default {
|
||||
name: "WcsFlowInstance",
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
ids: [],
|
||||
single: true,
|
||||
multiple: true,
|
||||
showSearch: true,
|
||||
total: 0,
|
||||
instanceList: [],
|
||||
title: "",
|
||||
open: false,
|
||||
statusOptions: [
|
||||
{ value: "0", label: "<22><>ִ<EFBFBD><D6B4>" },
|
||||
{ value: "1", label: "ִ<><D6B4><EFBFBD><EFBFBD>" },
|
||||
{ value: "2", label: "<22><><EFBFBD><EFBFBD><EFBFBD>" },
|
||||
{ value: "3", label: "<22>쳣<EFBFBD><ECB3A3>ֹ" }
|
||||
],
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
processDefName: undefined,
|
||||
status: undefined
|
||||
},
|
||||
form: {},
|
||||
rules: {
|
||||
processDefName: [
|
||||
{ required: true, message: "<22><><EFBFBD>̶<EFBFBD><CCB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʋ<EFBFBD><C6B2><EFBFBD>Ϊ<EFBFBD><CEAA>", trigger: "blur" }
|
||||
],
|
||||
status: [
|
||||
{ required: true, message: "״̬<D7B4><CCAC><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>", trigger: "change" }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.loading = true
|
||||
listFlowInstance(this.queryParams).then(response => {
|
||||
this.instanceList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
statusLabel(status) {
|
||||
const map = { "0": "<22><>ִ<EFBFBD><D6B4>", "1": "ִ<><D6B4><EFBFBD><EFBFBD>", "2": "<22><><EFBFBD><EFBFBD><EFBFBD>", "3": "<22>쳣<EFBFBD><ECB3A3>ֹ" }
|
||||
return map[status] || "δ֪"
|
||||
},
|
||||
statusTagType(status) {
|
||||
const map = { "0": "info", "1": "", "2": "success", "3": "danger" }
|
||||
return map[status] || "info"
|
||||
},
|
||||
cancel() {
|
||||
this.open = false
|
||||
this.reset()
|
||||
},
|
||||
reset() {
|
||||
this.form = {
|
||||
instanceId: undefined,
|
||||
processDefName: undefined,
|
||||
status: "0",
|
||||
startTime: undefined,
|
||||
endTime: undefined,
|
||||
remark: undefined
|
||||
}
|
||||
this.resetForm("form")
|
||||
},
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1
|
||||
this.getList()
|
||||
},
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm")
|
||||
this.handleQuery()
|
||||
},
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.instanceId)
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
handleAdd() {
|
||||
this.reset()
|
||||
this.open = true
|
||||
this.title = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5>"
|
||||
},
|
||||
handleUpdate(row) {
|
||||
this.reset()
|
||||
const instanceId = row.instanceId || this.ids
|
||||
getFlowInstance(instanceId).then(response => {
|
||||
this.form = response.data
|
||||
this.open = true
|
||||
this.title = "<22><EFBFBD><DEB8><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5>"
|
||||
})
|
||||
},
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.instanceId != undefined) {
|
||||
updateFlowInstance(this.form).then(() => {
|
||||
this.$modal.msgSuccess("<22>ijɹ<C4B3>")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
} else {
|
||||
addFlowInstance(this.form).then(() => {
|
||||
this.$modal.msgSuccess("<22><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
handleDelete(row) {
|
||||
const instanceIds = row.instanceId || this.ids
|
||||
this.$modal.confirm('<27>Ƿ<EFBFBD>ȷ<EFBFBD><C8B7>ɾ<EFBFBD><C9BE>ʵ<EFBFBD><CAB5>IDΪ"' + instanceIds + '"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').then(function() {
|
||||
return delFlowInstance(instanceIds)
|
||||
}).then(() => {
|
||||
this.getList()
|
||||
this.$modal.msgSuccess("ɾ<><C9BE><EFBFBD>ɹ<EFBFBD>")
|
||||
}).catch(() => {})
|
||||
},
|
||||
handleExecute(row) {
|
||||
const flowDefId = row.flowDefId
|
||||
this.$modal.confirm('是否确认执行流程定义ID为"' + flowDefId + '"的流程?').then(() => {
|
||||
return executeFlowInstance(flowDefId)
|
||||
}).then((response) => {
|
||||
this.$modal.msgSuccess("流程已启动,实例ID:" + response.data)
|
||||
this.getList()
|
||||
}).catch(() => {})
|
||||
},
|
||||
handleExport() {
|
||||
this.download('wcs/flowinstance/export', {
|
||||
...this.queryParams
|
||||
}, `flowinstance_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
263
ruoyi-ui/src/views/wcs/flowlog/index.vue
Normal file
263
ruoyi-ui/src/views/wcs/flowlog/index.vue
Normal file
@@ -0,0 +1,263 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
|
||||
<el-form-item label="实例ID" prop="instanceId">
|
||||
<el-input
|
||||
v-model="queryParams.instanceId"
|
||||
placeholder="请输入实例ID"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="节点类型" prop="nodeType">
|
||||
<el-select v-model="queryParams.nodeType" placeholder="请选择" clearable>
|
||||
<el-option label="开始" value="start" />
|
||||
<el-option label="API调用" value="api" />
|
||||
<el-option label="PLC读写" value="plc" />
|
||||
<el-option label="条件判断" value="condition" />
|
||||
<el-option label="等待" value="wait" />
|
||||
<el-option label="结束" value="end" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择" clearable>
|
||||
<el-option label="待执行" value="0" />
|
||||
<el-option label="执行中" value="1" />
|
||||
<el-option label="成功" value="2" />
|
||||
<el-option label="失败" value="3" />
|
||||
<el-option label="跳过" value="4" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['wcs:flowlog:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['wcs:flowlog:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="logList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="日志ID" align="center" prop="id" width="70" />
|
||||
<el-table-column label="实例ID" align="center" prop="instanceId" width="80" />
|
||||
<el-table-column label="节点ID" align="center" prop="nodeId" width="100" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="节点类型" align="center" prop="nodeType" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="nodeTypeTag(scope.row.nodeType)" size="small">{{ nodeTypeLabel(scope.row.nodeType) }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center" prop="status" width="80">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="statusTagType(scope.row.status)" size="small">{{ statusLabel(scope.row.status) }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="开始时间" align="center" prop="startTime" width="160">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.startTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="结束时间" align="center" prop="endTime" width="160">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.endTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="错误信息" align="center" prop="errorMsg" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-view"
|
||||
@click="handleView(scope.row)"
|
||||
>详情</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['wcs:flowlog:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 日志详情对话框 -->
|
||||
<el-dialog title="日志详情" :visible.sync="openView" width="700px" append-to-body>
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="日志ID">{{ viewForm.id }}</el-descriptions-item>
|
||||
<el-descriptions-item label="实例ID">{{ viewForm.instanceId }}</el-descriptions-item>
|
||||
<el-descriptions-item label="节点ID">{{ viewForm.nodeId }}</el-descriptions-item>
|
||||
<el-descriptions-item label="节点类型">{{ nodeTypeLabel(viewForm.nodeType) }}</el-descriptions-item>
|
||||
<el-descriptions-item label="状态">{{ statusLabel(viewForm.status) }}</el-descriptions-item>
|
||||
<el-descriptions-item label="开始时间">{{ parseTime(viewForm.startTime) }}</el-descriptions-item>
|
||||
<el-descriptions-item label="结束时间">{{ parseTime(viewForm.endTime) }}</el-descriptions-item>
|
||||
<el-descriptions-item label="创建时间">{{ parseTime(viewForm.createTime) }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-divider content-position="left">输入参数</el-divider>
|
||||
<pre class="log-content">{{ viewForm.input || '无' }}</pre>
|
||||
<el-divider content-position="left">输出结果</el-divider>
|
||||
<pre class="log-content">{{ viewForm.output || '无' }}</pre>
|
||||
<el-divider content-position="left" v-if="viewForm.errorMsg">错误信息</el-divider>
|
||||
<pre class="log-content log-error" v-if="viewForm.errorMsg">{{ viewForm.errorMsg }}</pre>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="openView = false">关 闭</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listFlowLog, getFlowLog, delFlowLog } from "@/api/wcs/flowlog"
|
||||
|
||||
export default {
|
||||
name: "WcsFlowLog",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 日志表格数据
|
||||
logList: [],
|
||||
// 详情弹出层
|
||||
openView: false,
|
||||
// 详情表单
|
||||
viewForm: {},
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
instanceId: undefined,
|
||||
nodeType: undefined,
|
||||
status: undefined
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
/** 查询日志列表 */
|
||||
getList() {
|
||||
this.loading = true
|
||||
listFlowLog(this.queryParams).then(response => {
|
||||
this.logList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
/** 节点类型标签 */
|
||||
nodeTypeLabel(type) {
|
||||
const map = { start: '开始', api: 'API调用', plc: 'PLC读写', condition: '条件判断', wait: '等待', end: '结束' }
|
||||
return map[type] || type || '-'
|
||||
},
|
||||
/** 节点类型标签颜色 */
|
||||
nodeTypeTag(type) {
|
||||
const map = { start: '', api: 'success', plc: 'warning', condition: 'info', wait: '', end: 'info' }
|
||||
return map[type] || ''
|
||||
},
|
||||
/** 状态标签 */
|
||||
statusLabel(status) {
|
||||
const map = { '0': '待执行', '1': '执行中', '2': '成功', '3': '失败', '4': '跳过' }
|
||||
return map[status] || '未知'
|
||||
},
|
||||
/** 状态标签颜色 */
|
||||
statusTagType(status) {
|
||||
const map = { '0': 'info', '1': '', '2': 'success', '3': 'danger', '4': 'warning' }
|
||||
return map[status] || 'info'
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1
|
||||
this.getList()
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm")
|
||||
this.handleQuery()
|
||||
},
|
||||
/** 多选框选中数据 */
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 查看详情 */
|
||||
handleView(row) {
|
||||
getFlowLog(row.id).then(response => {
|
||||
this.viewForm = response.data
|
||||
this.openView = true
|
||||
})
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const logIds = row.id || this.ids
|
||||
this.$modal.confirm('是否确认删除日志ID为"' + logIds + '"的数据项?').then(function() {
|
||||
return delFlowLog(logIds)
|
||||
}).then(() => {
|
||||
this.getList()
|
||||
this.$modal.msgSuccess("删除成功")
|
||||
}).catch(() => {})
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('wcs/flow/log/export', {
|
||||
...this.queryParams
|
||||
}, `flowlog_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.log-content {
|
||||
background: #f5f7fa;
|
||||
padding: 12px;
|
||||
border-radius: 4px;
|
||||
font-size: 13px;
|
||||
max-height: 200px;
|
||||
overflow: auto;
|
||||
white-space: pre-wrap;
|
||||
word-break: break-all;
|
||||
}
|
||||
.log-error {
|
||||
background: #fef0f0;
|
||||
color: #f56c6c;
|
||||
}
|
||||
</style>
|
||||
347
ruoyi-ui/src/views/wcs/point/index.vue
Normal file
347
ruoyi-ui/src/views/wcs/point/index.vue
Normal file
@@ -0,0 +1,347 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
|
||||
<el-form-item label="<22><><EFBFBD><EFBFBD><EFBFBD>豸" prop="deviceId">
|
||||
<el-select v-model="queryParams.deviceId" placeholder="<22><>ѡ<EFBFBD><D1A1><EFBFBD>豸" clearable>
|
||||
<el-option
|
||||
v-for="item in deviceOptions"
|
||||
:key="item.deviceId"
|
||||
:label="item.deviceName"
|
||||
:value="item.deviceId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="<22><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>" prop="pointCode">
|
||||
<el-input
|
||||
v-model="queryParams.pointCode"
|
||||
placeholder="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="<22><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>" prop="pointName">
|
||||
<el-input
|
||||
v-model="queryParams.pointName"
|
||||
placeholder="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="״̬" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="<22><>λ״̬" clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.sys_normal_disable"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"><EFBFBD><EFBFBD><EFBFBD><EFBFBD></el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"><EFBFBD><EFBFBD><EFBFBD><EFBFBD></el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['wcs:point:add']"
|
||||
><EFBFBD><EFBFBD><EFBFBD><EFBFBD></el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['wcs:point:edit']"
|
||||
><EFBFBD><EFBFBD></el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['wcs:point:remove']"
|
||||
>ɾ<EFBFBD><EFBFBD></el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="pointList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="<22><>λID" align="center" prop="pointId" width="80" />
|
||||
<el-table-column label="<22><><EFBFBD><EFBFBD><EFBFBD>豸" align="center" prop="deviceName" />
|
||||
<el-table-column label="<22><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>" align="center" prop="pointCode" />
|
||||
<el-table-column label="<22><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>" align="center" prop="pointName" />
|
||||
<el-table-column label="<22><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>" align="center" prop="pointType" />
|
||||
<el-table-column label="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" align="center" prop="dataType" />
|
||||
<el-table-column label="<22><>ַ" align="center" prop="address" />
|
||||
<el-table-column label="<22><>λ" align="center" prop="unit" width="80" />
|
||||
<el-table-column label="״̬" align="center" prop="status" width="80">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="<22><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>" align="center" prop="createTime" width="160">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="<22><><EFBFBD><EFBFBD>" align="center" class-name="small-padding fixed-width" width="160">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['wcs:point:edit']"
|
||||
><EFBFBD><EFBFBD></el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['wcs:point:remove']"
|
||||
>ɾ<EFBFBD><EFBFBD></el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- <EFBFBD><EFBFBD><EFBFBD>ӻ<EFBFBD><EFBFBD>ĵ<EFBFBD>λ<EFBFBD>Ի<EFBFBD><EFBFBD><EFBFBD> -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="<22><><EFBFBD><EFBFBD><EFBFBD>豸" prop="deviceId">
|
||||
<el-select v-model="form.deviceId" placeholder="<22><>ѡ<EFBFBD><D1A1><EFBFBD>豸">
|
||||
<el-option
|
||||
v-for="item in deviceOptions"
|
||||
:key="item.deviceId"
|
||||
:label="item.deviceName"
|
||||
:value="item.deviceId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="<22><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>" prop="pointCode">
|
||||
<el-input v-model="form.pointCode" placeholder="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="<22><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>" prop="pointName">
|
||||
<el-input v-model="form.pointName" placeholder="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="<22><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>" prop="pointType">
|
||||
<el-select v-model="form.pointType" placeholder="<22><>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>">
|
||||
<el-option label="ֻ<><D6BB>" value="read" />
|
||||
<el-option label="ֻд" value="write" />
|
||||
<el-option label="<22><>д" value="read_write" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" prop="dataType">
|
||||
<el-select v-model="form.dataType" placeholder="<22><>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>">
|
||||
<el-option label="<22><><EFBFBD><EFBFBD>" value="int" />
|
||||
<el-option label="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" value="float" />
|
||||
<el-option label="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" value="bool" />
|
||||
<el-option label="<22>ַ<EFBFBD><D6B7><EFBFBD>" value="string" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="<22><>ַ" prop="address">
|
||||
<el-input v-model="form.address" placeholder="<22>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD>ַ/OPC<50>ڵ<EFBFBD>" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="<22><>λ" prop="unit">
|
||||
<el-input v-model="form.unit" placeholder="<22><><EFBFBD><EFBFBD><EFBFBD>뵥λ" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="״̬" prop="status">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio
|
||||
v-for="dict in dict.type.sys_normal_disable"
|
||||
:key="dict.value"
|
||||
:label="dict.value"
|
||||
>{{dict.label}}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="<22><>ע" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">ȷ <EFBFBD><EFBFBD></el-button>
|
||||
<el-button @click="cancel">ȡ <EFBFBD><EFBFBD></el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listPoint, getPoint, addPoint, updatePoint, delPoint } from "@/api/wcs/point"
|
||||
import { listDevice } from "@/api/wcs/device"
|
||||
|
||||
export default {
|
||||
name: "WcsPoint",
|
||||
dicts: ['sys_normal_disable'],
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
ids: [],
|
||||
single: true,
|
||||
multiple: true,
|
||||
showSearch: true,
|
||||
total: 0,
|
||||
pointList: [],
|
||||
deviceOptions: [],
|
||||
title: "",
|
||||
open: false,
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
deviceId: undefined,
|
||||
pointCode: undefined,
|
||||
pointName: undefined,
|
||||
status: undefined
|
||||
},
|
||||
form: {},
|
||||
rules: {
|
||||
deviceId: [
|
||||
{ required: true, message: "<22><><EFBFBD><EFBFBD><EFBFBD>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>", trigger: "change" }
|
||||
],
|
||||
pointCode: [
|
||||
{ required: true, message: "<22><>λ<EFBFBD><CEBB><EFBFBD>벻<EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>", trigger: "blur" }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
this.getDeviceOptions()
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.loading = true
|
||||
listPoint(this.queryParams).then(response => {
|
||||
this.pointList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
getDeviceOptions() {
|
||||
listDevice({ pageNum: 1, pageSize: 1000 }).then(response => {
|
||||
this.deviceOptions = response.rows || []
|
||||
})
|
||||
},
|
||||
cancel() {
|
||||
this.open = false
|
||||
this.reset()
|
||||
},
|
||||
reset() {
|
||||
this.form = {
|
||||
pointId: undefined,
|
||||
deviceId: undefined,
|
||||
pointCode: undefined,
|
||||
pointName: undefined,
|
||||
pointType: undefined,
|
||||
dataType: undefined,
|
||||
address: undefined,
|
||||
unit: undefined,
|
||||
status: "0",
|
||||
remark: undefined
|
||||
}
|
||||
this.resetForm("form")
|
||||
},
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1
|
||||
this.getList()
|
||||
},
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm")
|
||||
this.handleQuery()
|
||||
},
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.pointId)
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
handleAdd() {
|
||||
this.reset()
|
||||
this.open = true
|
||||
this.title = "<22><><EFBFBD>ӵ<EFBFBD>λ"
|
||||
},
|
||||
handleUpdate(row) {
|
||||
this.reset()
|
||||
const pointId = row.pointId || this.ids
|
||||
getPoint(pointId).then(response => {
|
||||
this.form = response.data
|
||||
this.open = true
|
||||
this.title = "<22>ĵ<DEB8>λ"
|
||||
})
|
||||
},
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.pointId != undefined) {
|
||||
updatePoint(this.form).then(() => {
|
||||
this.$modal.msgSuccess("<22>ijɹ<C4B3>")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
} else {
|
||||
addPoint(this.form).then(() => {
|
||||
this.$modal.msgSuccess("<22><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
handleDelete(row) {
|
||||
const pointIds = row.pointId || this.ids
|
||||
this.$modal.confirm('<27>Ƿ<EFBFBD>ȷ<EFBFBD><C8B7>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>Ϊ"' + pointIds + '"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').then(function() {
|
||||
return delPoint(pointIds)
|
||||
}).then(() => {
|
||||
this.getList()
|
||||
this.$modal.msgSuccess("ɾ<><C9BE><EFBFBD>ɹ<EFBFBD>")
|
||||
}).catch(() => {})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
286
sql/wcs_init_mysql.sql
Normal file
286
sql/wcs_init_mysql.sql
Normal file
@@ -0,0 +1,286 @@
|
||||
-- =============================================
|
||||
-- WCS <20>ֿ<EFBFBD><D6BF><EFBFBD><EFBFBD>ϵͳ - MySQL <20><>ʼ<EFBFBD><CABC><EFBFBD>ű<EFBFBD>
|
||||
-- <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݿ<EFBFBD>: MySQL 5.7+ / 8.0+
|
||||
-- <20>ַ<EFBFBD><D6B7><EFBFBD>: utf8mb4
|
||||
-- ˵<><CBB5>: <20>Ǽܽ<DCBD><D7B6><EFBFBD>С<EFBFBD>ֶμ<D6B6><CEBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>չ
|
||||
-- =============================================
|
||||
|
||||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- ----------------------------
|
||||
-- 1. <20>豸<EFBFBD><E8B1B8>Ϣ<EFBFBD><CFA2>
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `wcs_device`;
|
||||
CREATE TABLE `wcs_device` (
|
||||
`device_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '<EFBFBD>豸ID',
|
||||
`device_code` varchar(64) NOT NULL COMMENT '<EFBFBD>豸<EFBFBD><EFBFBD><EFBFBD><EFBFBD>',
|
||||
`device_name` varchar(128) DEFAULT NULL COMMENT '<EFBFBD>豸<EFBFBD><EFBFBD><EFBFBD><EFBFBD>',
|
||||
`device_type` varchar(32) DEFAULT NULL COMMENT '<EFBFBD>豸<EFBFBD><EFBFBD><EFBFBD>ͣ<EFBFBD>conveyor/agv/elevator/stacker<65>ȣ<EFBFBD>',
|
||||
`area_code` varchar(64) DEFAULT NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',
|
||||
`protocol_type` varchar(32) DEFAULT NULL COMMENT 'ͨ<EFBFBD><EFBFBD>Э<EFBFBD>飨modbus_tcp/opc_ua/s7<73>ȣ<EFBFBD>',
|
||||
`ip_address` varchar(64) DEFAULT NULL COMMENT '<EFBFBD>豸IP<EFBFBD><EFBFBD>ַ',
|
||||
`port` int(11) DEFAULT NULL COMMENT 'ͨ<EFBFBD>Ŷ˿<EFBFBD>',
|
||||
`status` char(1) DEFAULT '0' COMMENT '<EFBFBD>豸״̬<EFBFBD><EFBFBD>0<EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1ͣ<31>ã<EFBFBD>',
|
||||
`del_flag` char(1) DEFAULT '0' COMMENT 'ɾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>־<EFBFBD><EFBFBD>0<EFBFBD><EFBFBD><EFBFBD><EFBFBD> 2ɾ<32><C9BE><EFBFBD><EFBFBD>',
|
||||
`create_by` varchar(64) DEFAULT '' COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>',
|
||||
`update_by` varchar(64) DEFAULT '' COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>',
|
||||
`remark` varchar(500) DEFAULT NULL COMMENT '<EFBFBD><EFBFBD>ע',
|
||||
PRIMARY KEY (`device_id`),
|
||||
UNIQUE KEY `uk_device_code` (`device_code`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='WCS <20>豸<EFBFBD><E8B1B8>Ϣ<EFBFBD><CFA2>';
|
||||
|
||||
-- ----------------------------
|
||||
-- 2. <20>豸<EFBFBD><E8B1B8>λ<EFBFBD><CEBB>
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `wcs_device_point`;
|
||||
CREATE TABLE `wcs_device_point` (
|
||||
`point_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '<EFBFBD><EFBFBD>λID',
|
||||
`device_id` bigint(20) NOT NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>豸ID',
|
||||
`point_code` varchar(64) NOT NULL COMMENT '<EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>',
|
||||
`point_name` varchar(128) DEFAULT NULL COMMENT '<EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>',
|
||||
`point_type` varchar(32) DEFAULT NULL COMMENT '<EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD><EFBFBD>ͣ<EFBFBD>read/write/read_write<74><65>',
|
||||
`data_type` varchar(32) DEFAULT NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͣ<EFBFBD>int/float/bool/string<6E><67>',
|
||||
`address` varchar(128) DEFAULT NULL COMMENT '<EFBFBD>Ĵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ/OPC<50>ڵ<EFBFBD>',
|
||||
`unit` varchar(32) DEFAULT NULL COMMENT '<EFBFBD><EFBFBD>λ',
|
||||
`status` char(1) DEFAULT '0' COMMENT '״̬<EFBFBD><EFBFBD>0<EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1ͣ<31>ã<EFBFBD>',
|
||||
`del_flag` char(1) DEFAULT '0' COMMENT 'ɾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>־<EFBFBD><EFBFBD>0<EFBFBD><EFBFBD><EFBFBD><EFBFBD> 2ɾ<32><C9BE><EFBFBD><EFBFBD>',
|
||||
`create_by` varchar(64) DEFAULT '' COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>',
|
||||
`update_by` varchar(64) DEFAULT '' COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>',
|
||||
`remark` varchar(500) DEFAULT NULL COMMENT '<EFBFBD><EFBFBD>ע',
|
||||
PRIMARY KEY (`point_id`),
|
||||
KEY `idx_device_id` (`device_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='WCS <20>豸<EFBFBD><E8B1B8>λ<EFBFBD><CEBB>';
|
||||
|
||||
-- ----------------------------
|
||||
-- 3. <20>豸<EFBFBD><E8B1B8>λֵ<CEBB><D6B5>¼<EFBFBD><C2BC>
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `wcs_device_point_value`;
|
||||
CREATE TABLE `wcs_device_point_value` (
|
||||
`value_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '<EFBFBD><EFBFBD>¼ID',
|
||||
`point_id` bigint(20) NOT NULL COMMENT '<EFBFBD><EFBFBD>λID',
|
||||
`device_id` bigint(20) NOT NULL COMMENT '<EFBFBD>豸ID',
|
||||
`point_value` varchar(256) DEFAULT NULL COMMENT '<EFBFBD><EFBFBD>λֵ',
|
||||
`quality` varchar(16) DEFAULT NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>good/bad/uncertain<69><6E>',
|
||||
`collect_time` datetime DEFAULT NULL COMMENT '<EFBFBD>ɼ<EFBFBD>ʱ<EFBFBD><EFBFBD>',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '<EFBFBD><EFBFBD>¼ʱ<EFBFBD><EFBFBD>',
|
||||
PRIMARY KEY (`value_id`),
|
||||
KEY `idx_point_id` (`point_id`),
|
||||
KEY `idx_collect_time` (`collect_time`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='WCS <20>豸<EFBFBD><E8B1B8>λֵ<CEBB><D6B5>¼<EFBFBD><C2BC>';
|
||||
|
||||
-- ----------------------------
|
||||
-- 4. <20>ӿ<EFBFBD><D3BF><EFBFBD><EFBFBD>ñ<EFBFBD>
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `wcs_api_config`;
|
||||
CREATE TABLE `wcs_api_config` (
|
||||
`api_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '<EFBFBD>ӿ<EFBFBD>ID',
|
||||
`api_code` varchar(64) NOT NULL COMMENT '<EFBFBD>ӿڱ<EFBFBD><EFBFBD><EFBFBD>',
|
||||
`api_name` varchar(128) DEFAULT NULL COMMENT '<EFBFBD>ӿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',
|
||||
`api_url` varchar(512) DEFAULT NULL COMMENT '<EFBFBD>ӿڵ<EFBFBD>ַ',
|
||||
`request_method` varchar(16) DEFAULT 'POST' COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><EFBFBD>GET/POST/PUT/DELETE<54><45>',
|
||||
`content_type` varchar(64) DEFAULT 'application/json' COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',
|
||||
`timeout` int(11) DEFAULT 30000 COMMENT '<EFBFBD><EFBFBD>ʱʱ<EFBFBD>䣨<EFBFBD><EFBFBD><EFBFBD>룩',
|
||||
`retry_count` int(11) DEFAULT 0 COMMENT '<EFBFBD><EFBFBD><EFBFBD>Դ<EFBFBD><EFBFBD><EFBFBD>',
|
||||
`direction` varchar(16) DEFAULT NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD>inbound/outbound<6E><64>',
|
||||
`status` char(1) DEFAULT '0' COMMENT '״̬<EFBFBD><EFBFBD>0<EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1ͣ<31>ã<EFBFBD>',
|
||||
`del_flag` char(1) DEFAULT '0' COMMENT 'ɾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>־<EFBFBD><EFBFBD>0<EFBFBD><EFBFBD><EFBFBD><EFBFBD> 2ɾ<32><C9BE><EFBFBD><EFBFBD>',
|
||||
`create_by` varchar(64) DEFAULT '' COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>',
|
||||
`update_by` varchar(64) DEFAULT '' COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>',
|
||||
`remark` varchar(500) DEFAULT NULL COMMENT '<EFBFBD><EFBFBD>ע',
|
||||
PRIMARY KEY (`api_id`),
|
||||
UNIQUE KEY `uk_api_code` (`api_code`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='WCS <20>ӿ<EFBFBD><D3BF><EFBFBD><EFBFBD>ñ<EFBFBD>';
|
||||
|
||||
-- ----------------------------
|
||||
-- 5. <20><><EFBFBD>̶<EFBFBD><CCB6><EFBFBD><EFBFBD>
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `wcs_flow_def`;
|
||||
CREATE TABLE `wcs_flow_def` (
|
||||
`flow_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ID',
|
||||
`flow_code` varchar(64) NOT NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD>̱<EFBFBD><EFBFBD><EFBFBD>',
|
||||
`flow_name` varchar(128) DEFAULT NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',
|
||||
`flow_type` varchar(32) DEFAULT NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',
|
||||
`version` int(11) DEFAULT 1 COMMENT '<EFBFBD>汾<EFBFBD><EFBFBD>',
|
||||
`flow_json` text COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD>JSON<EFBFBD><EFBFBD><EFBFBD>壨<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD>',
|
||||
`status` char(1) DEFAULT '0' COMMENT '״̬<EFBFBD><EFBFBD>0<EFBFBD>ݸ<EFBFBD> 1<>ѷ<EFBFBD><D1B7><EFBFBD> 2<><32>ͣ<EFBFBD>ã<EFBFBD>',
|
||||
`del_flag` char(1) DEFAULT '0' COMMENT 'ɾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>־<EFBFBD><EFBFBD>0<EFBFBD><EFBFBD><EFBFBD><EFBFBD> 2ɾ<32><C9BE><EFBFBD><EFBFBD>',
|
||||
`create_by` varchar(64) DEFAULT '' COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>',
|
||||
`update_by` varchar(64) DEFAULT '' COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>',
|
||||
`remark` varchar(500) DEFAULT NULL COMMENT '<EFBFBD><EFBFBD>ע',
|
||||
PRIMARY KEY (`flow_id`),
|
||||
UNIQUE KEY `uk_flow_code_version` (`flow_code`, `version`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='WCS <20><><EFBFBD>̶<EFBFBD><CCB6><EFBFBD><EFBFBD>';
|
||||
|
||||
-- ----------------------------
|
||||
-- 6. <20><><EFBFBD>̽ڵ<CCBD><DAB5>
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `wcs_flow_node`;
|
||||
CREATE TABLE `wcs_flow_node` (
|
||||
`node_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '<EFBFBD>ڵ<EFBFBD>ID',
|
||||
`flow_id` bigint(20) NOT NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ID',
|
||||
`node_code` varchar(64) NOT NULL COMMENT '<EFBFBD>ڵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>',
|
||||
`node_name` varchar(128) DEFAULT NULL COMMENT '<EFBFBD>ڵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',
|
||||
`node_type` varchar(32) DEFAULT NULL COMMENT '<EFBFBD>ڵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͣ<EFBFBD>start/end/task/condition/parallel<65>ȣ<EFBFBD>',
|
||||
`handler_class` varchar(256) DEFAULT NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',
|
||||
`config_json` text COMMENT '<EFBFBD>ڵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>JSON',
|
||||
`pos_x` int(11) DEFAULT 0 COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD>X<EFBFBD><EFBFBD><EFBFBD><EFBFBD>',
|
||||
`pos_y` int(11) DEFAULT 0 COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Y<EFBFBD><EFBFBD><EFBFBD><EFBFBD>',
|
||||
`sort_order` int(11) DEFAULT 0 COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD>',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>',
|
||||
PRIMARY KEY (`node_id`),
|
||||
KEY `idx_flow_id` (`flow_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='WCS <20><><EFBFBD>̽ڵ<CCBD><DAB5>';
|
||||
|
||||
-- ----------------------------
|
||||
-- 7. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߱<EFBFBD>
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `wcs_flow_line`;
|
||||
CREATE TABLE `wcs_flow_line` (
|
||||
`line_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ID',
|
||||
`flow_id` bigint(20) NOT NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ID',
|
||||
`source_node_id` bigint(20) NOT NULL COMMENT 'Դ<EFBFBD>ڵ<EFBFBD>ID',
|
||||
`target_node_id` bigint(20) NOT NULL COMMENT 'Ŀ<EFBFBD><EFBFBD>ڵ<EFBFBD>ID',
|
||||
`condition_expr` varchar(512) DEFAULT NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ',
|
||||
`line_label` varchar(128) DEFAULT NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD>߱<EFBFBD>ǩ',
|
||||
`sort_order` int(11) DEFAULT 0 COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD>',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>',
|
||||
PRIMARY KEY (`line_id`),
|
||||
KEY `idx_flow_id` (`flow_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='WCS <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߱<EFBFBD>';
|
||||
|
||||
-- ----------------------------
|
||||
-- 8. <20><><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD>
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `wcs_flow_instance`;
|
||||
CREATE TABLE `wcs_flow_instance` (
|
||||
`instance_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ʵ<EFBFBD><EFBFBD>ID',
|
||||
`flow_id` bigint(20) NOT NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD>̶<EFBFBD><EFBFBD><EFBFBD>ID',
|
||||
`instance_code` varchar(64) DEFAULT NULL COMMENT 'ʵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',
|
||||
`trigger_source` varchar(64) DEFAULT NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Դ',
|
||||
`current_node_id` bigint(20) DEFAULT NULL COMMENT '<EFBFBD><EFBFBD>ǰ<EFBFBD>ڵ<EFBFBD>ID',
|
||||
`instance_status` varchar(16) DEFAULT 'running' COMMENT 'ʵ<EFBFBD><EFBFBD>״̬<EFBFBD><EFBFBD>running/completed/failed/cancelled<65><64>',
|
||||
`context_json` text COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>JSON',
|
||||
`start_time` datetime DEFAULT NULL COMMENT '<EFBFBD><EFBFBD>ʼʱ<EFBFBD><EFBFBD>',
|
||||
`end_time` datetime DEFAULT NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>',
|
||||
`error_msg` varchar(2000) DEFAULT NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ',
|
||||
`create_by` varchar(64) DEFAULT '' COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>',
|
||||
PRIMARY KEY (`instance_id`),
|
||||
KEY `idx_flow_id` (`flow_id`),
|
||||
KEY `idx_instance_status` (`instance_status`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='WCS <20><><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD>';
|
||||
|
||||
-- ----------------------------
|
||||
-- 9. <20><><EFBFBD>̽ڵ<CCBD>ִ<EFBFBD><D6B4><EFBFBD><EFBFBD>־<EFBFBD><D6BE>
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `wcs_flow_node_log`;
|
||||
CREATE TABLE `wcs_flow_node_log` (
|
||||
`log_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '<EFBFBD><EFBFBD>־ID',
|
||||
`instance_id` bigint(20) NOT NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD><EFBFBD>ID',
|
||||
`node_id` bigint(20) NOT NULL COMMENT '<EFBFBD>ڵ<EFBFBD>ID',
|
||||
`node_name` varchar(128) DEFAULT NULL COMMENT '<EFBFBD>ڵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',
|
||||
`execute_status` varchar(16) DEFAULT NULL COMMENT 'ִ<EFBFBD><EFBFBD>״̬<EFBFBD><EFBFBD>success/fail/skip<69><70>',
|
||||
`input_data` text COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>JSON',
|
||||
`output_data` text COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>JSON',
|
||||
`error_msg` varchar(2000) DEFAULT NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ',
|
||||
`start_time` datetime DEFAULT NULL COMMENT '<EFBFBD><EFBFBD>ʼʱ<EFBFBD><EFBFBD>',
|
||||
`end_time` datetime DEFAULT NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>',
|
||||
`duration` bigint(20) DEFAULT NULL COMMENT 'ִ<EFBFBD>к<EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>룩',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>',
|
||||
PRIMARY KEY (`log_id`),
|
||||
KEY `idx_instance_id` (`instance_id`),
|
||||
KEY `idx_node_id` (`node_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='WCS <20><><EFBFBD>̽ڵ<CCBD>ִ<EFBFBD><D6B4><EFBFBD><EFBFBD>־<EFBFBD><D6BE>';
|
||||
|
||||
-- ----------------------------
|
||||
-- WCS <20>˵<EFBFBD><CBB5><EFBFBD><EFBFBD>ݳ<EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD><EFBFBD>
|
||||
-- <20>˵<EFBFBD>ID <20><> 2000 <20>𣬱<EFBFBD><F0A3ACB1><EFBFBD><EFBFBD><EFBFBD>ϵͳ<CFB5>˵<EFBFBD><CBB5><EFBFBD>ͻ
|
||||
-- ----------------------------
|
||||
|
||||
-- WCS һ<><D2BB><EFBFBD>˵<EFBFBD>
|
||||
INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `route_name`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`)
|
||||
VALUES (2000, 'WCS<EFBFBD>ֿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>', 0, 5, 'wcs', NULL, '', '', 1, 0, 'M', '0', '0', '', 'server', 'admin', sysdate(), '', NULL, 'WCS<EFBFBD>ֿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵͳ');
|
||||
|
||||
-- <20>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>
|
||||
INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `route_name`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`)
|
||||
VALUES (2001, '<EFBFBD>豸<EFBFBD><EFBFBD><EFBFBD><EFBFBD>', 2000, 1, 'device', 'wcs/device/index', '', '', 1, 0, 'C', '0', '0', 'wcs:device:list', 'component', 'admin', sysdate(), '', NULL, 'WCS<EFBFBD>豸<EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
||||
|
||||
-- <20><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>
|
||||
INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `route_name`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`)
|
||||
VALUES (2002, '<EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>', 2000, 2, 'point', 'wcs/point/index', '', '', 1, 0, 'C', '0', '0', 'wcs:point:list', 'edit', 'admin', sysdate(), '', NULL, 'WCS<EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
||||
|
||||
-- <20>ӿ<EFBFBD><D3BF><EFBFBD><EFBFBD><EFBFBD>
|
||||
INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `route_name`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`)
|
||||
VALUES (2003, '<EFBFBD>ӿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', 2000, 3, 'apiconfig', 'wcs/apiconfig/index', '', '', 1, 0, 'C', '0', '0', 'wcs:api:list', 'link', 'admin', sysdate(), '', NULL, 'WCS<EFBFBD>ӿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
||||
|
||||
-- <20><><EFBFBD>̶<EFBFBD><CCB6><EFBFBD>
|
||||
INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `route_name`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`)
|
||||
VALUES (2004, '<EFBFBD><EFBFBD><EFBFBD>̶<EFBFBD><EFBFBD><EFBFBD>', 2000, 4, 'flowdef', 'wcs/flowdef/index', '', '', 1, 0, 'C', '0', '0', 'wcs:flow:list', 'cascader', 'admin', sysdate(), '', NULL, 'WCS<EFBFBD><EFBFBD><EFBFBD>̶<EFBFBD><EFBFBD><EFBFBD>');
|
||||
|
||||
-- <20><><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5>
|
||||
INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `route_name`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`)
|
||||
VALUES (2005, '<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD><EFBFBD>', 2000, 5, 'flowinstance', 'wcs/flowinstance/index', '', '', 1, 0, 'C', '0', '0', 'wcs:flowinstance:list', 'list', 'admin', sysdate(), '', NULL, 'WCS<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD><EFBFBD>');
|
||||
|
||||
-- <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>־
|
||||
INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `route_name`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`)
|
||||
VALUES (2006, '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>־', 2000, 6, 'flowlog', 'wcs/flowlog/index', '', '', 1, 0, 'C', '0', '0', 'wcs:flowlog:list', 'log', 'admin', sysdate(), '', NULL, 'WCS<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>־');
|
||||
|
||||
-- ----------------------------
|
||||
-- <20><>ťȨ<C5A5>ޣ<EFBFBD>menu_type='F'<27><>
|
||||
-- menuId <20><> 2010 <20><>ÿ<EFBFBD><C3BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD> 5 <20><><EFBFBD><EFBFBD>ť<EFBFBD><C5A5><EFBFBD><EFBFBD>ѯ/<2F><><EFBFBD><EFBFBD>/<2F><EFBFBD>/ɾ<><C9BE>/<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
-- ----------------------------
|
||||
|
||||
-- <20>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ť
|
||||
insert into sys_menu values('2010', '<EFBFBD>豸<EFBFBD><EFBFBD>ѯ', '2001', '1', '', '', '', '', 1, 0, 'F', '0', '0', 'wcs:device:query', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('2011', '<EFBFBD>豸<EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '2001', '2', '', '', '', '', 1, 0, 'F', '0', '0', 'wcs:device:add', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('2012', '<EFBFBD>豸<EFBFBD><EFBFBD>', '2001', '3', '', '', '', '', 1, 0, 'F', '0', '0', 'wcs:device:edit', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('2013', '<EFBFBD>豸ɾ<EFBFBD><EFBFBD>', '2001', '4', '', '', '', '', 1, 0, 'F', '0', '0', 'wcs:device:remove', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('2014', '<EFBFBD>豸<EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '2001', '5', '', '', '', '', 1, 0, 'F', '0', '0', 'wcs:device:export', '#', 'admin', sysdate(), '', null, '');
|
||||
|
||||
-- <20><>λ<EFBFBD><CEBB><EFBFBD>ð<EFBFBD>ť
|
||||
insert into sys_menu values('2015', '<EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD>ѯ', '2002', '1', '', '', '', '', 1, 0, 'F', '0', '0', 'wcs:point:query', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('2016', '<EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '2002', '2', '', '', '', '', 1, 0, 'F', '0', '0', 'wcs:point:add', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('2017', '<EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD>', '2002', '3', '', '', '', '', 1, 0, 'F', '0', '0', 'wcs:point:edit', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('2018', '<EFBFBD><EFBFBD>λɾ<EFBFBD><EFBFBD>', '2002', '4', '', '', '', '', 1, 0, 'F', '0', '0', 'wcs:point:remove', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('2019', '<EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '2002', '5', '', '', '', '', 1, 0, 'F', '0', '0', 'wcs:point:export', '#', 'admin', sysdate(), '', null, '');
|
||||
|
||||
-- <20>ӿ<EFBFBD><D3BF><EFBFBD><EFBFBD>ð<EFBFBD>ť
|
||||
insert into sys_menu values('2020', '<EFBFBD>ӿڲ<EFBFBD>ѯ', '2003', '1', '', '', '', '', 1, 0, 'F', '0', '0', 'wcs:api:query', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('2021', '<EFBFBD>ӿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '2003', '2', '', '', '', '', 1, 0, 'F', '0', '0', 'wcs:api:add', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('2022', '<EFBFBD>ӿ<EFBFBD><EFBFBD><EFBFBD>', '2003', '3', '', '', '', '', 1, 0, 'F', '0', '0', 'wcs:api:edit', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('2023', '<EFBFBD>ӿ<EFBFBD>ɾ<EFBFBD><EFBFBD>', '2003', '4', '', '', '', '', 1, 0, 'F', '0', '0', 'wcs:api:remove', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('2024', '<EFBFBD>ӿڵ<EFBFBD><EFBFBD><EFBFBD>', '2003', '5', '', '', '', '', 1, 0, 'F', '0', '0', 'wcs:api:export', '#', 'admin', sysdate(), '', null, '');
|
||||
|
||||
-- <20><><EFBFBD>̶<EFBFBD><CCB6>尴ť
|
||||
insert into sys_menu values('2025', '<EFBFBD><EFBFBD><EFBFBD>̲<EFBFBD>ѯ', '2004', '1', '', '', '', '', 1, 0, 'F', '0', '0', 'wcs:flow:query', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('2026', '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '2004', '2', '', '', '', '', 1, 0, 'F', '0', '0', 'wcs:flow:add', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('2027', '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '2004', '3', '', '', '', '', 1, 0, 'F', '0', '0', 'wcs:flow:edit', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('2028', '<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><EFBFBD>', '2004', '4', '', '', '', '', 1, 0, 'F', '0', '0', 'wcs:flow:remove', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('2029', '<EFBFBD><EFBFBD><EFBFBD>̵<EFBFBD><EFBFBD><EFBFBD>', '2004', '5', '', '', '', '', 1, 0, 'F', '0', '0', 'wcs:flow:export', '#', 'admin', sysdate(), '', null, '');
|
||||
|
||||
-- <20><><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD>ť
|
||||
insert into sys_menu values('2030', 'ʵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѯ', '2005', '1', '', '', '', '', 1, 0, 'F', '0', '0', 'wcs:flowinstance:query', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('2031', 'ʵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '2005', '2', '', '', '', '', 1, 0, 'F', '0', '0', 'wcs:flowinstance:add', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('2032', 'ʵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '2005', '3', '', '', '', '', 1, 0, 'F', '0', '0', 'wcs:flowinstance:edit', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('2033', 'ʵ<EFBFBD><EFBFBD>ɾ<EFBFBD><EFBFBD>', '2005', '4', '', '', '', '', 1, 0, 'F', '0', '0', 'wcs:flowinstance:remove', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('2034', 'ʵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '2005', '5', '', '', '', '', 1, 0, 'F', '0', '0', 'wcs:flowinstance:export', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('2040', 'ʵ<EFBFBD><EFBFBD>ִ<EFBFBD><EFBFBD>', '2005', '6', '', '', '', '', 1, 0, 'F', '0', '0', 'wcs:flowinstance:execute', '#', 'admin', sysdate(), '', null, '');
|
||||
|
||||
-- <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>־<EFBFBD><D6BE>ť
|
||||
insert into sys_menu values('2035', '<EFBFBD><EFBFBD>־<EFBFBD><EFBFBD>ѯ', '2006', '1', '', '', '', '', 1, 0, 'F', '0', '0', 'wcs:flowlog:query', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('2036', '<EFBFBD><EFBFBD>־<EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '2006', '2', '', '', '', '', 1, 0, 'F', '0', '0', 'wcs:flowlog:add', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('2037', '<EFBFBD><EFBFBD>־<EFBFBD><EFBFBD>', '2006', '3', '', '', '', '', 1, 0, 'F', '0', '0', 'wcs:flowlog:edit', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('2038', '<EFBFBD><EFBFBD>־ɾ<EFBFBD><EFBFBD>', '2006', '4', '', '', '', '', 1, 0, 'F', '0', '0', 'wcs:flowlog:remove', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('2039', '<EFBFBD><EFBFBD>־<EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '2006', '5', '', '', '', '', 1, 0, 'F', '0', '0', 'wcs:flowlog:export', '#', 'admin', sysdate(), '', null, '');
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
Reference in New Issue
Block a user