From 9c47f0219cadc626ef7d26af22935b94505090e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=A2=A6=E8=BF=9C?= <1063331231@qq.com> Date: Tue, 27 May 2025 17:14:09 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=AE=B9=E5=99=A8=20=E6=BA=B6=E6=B6=B2?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bo/status/device/SolutionContainerState.java | 9 ++--- .../iflytop/sgs/common/enums/ContainerType.java | 2 +- src/main/resources/sql/init.sql | 39 +++++++++++++++++++++- 3 files changed, 44 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/iflytop/sgs/app/model/bo/status/device/SolutionContainerState.java b/src/main/java/com/iflytop/sgs/app/model/bo/status/device/SolutionContainerState.java index b308a2d..f68ae53 100644 --- a/src/main/java/com/iflytop/sgs/app/model/bo/status/device/SolutionContainerState.java +++ b/src/main/java/com/iflytop/sgs/app/model/bo/status/device/SolutionContainerState.java @@ -8,12 +8,12 @@ import lombok.Data; @Schema(description = "溶液容器") @Data public class SolutionContainerState { + @Schema(description = "容器数据id") + private Long id; + @Schema(description = "容器code") private ContainerCode containerCode; - @Schema(description = "容器名称") - private String containerName; - @Schema(description = "容器类型 solution溶液容器 neutralization中和容器") private ContainerType type; @@ -26,7 +26,8 @@ public class SolutionContainerState { @Schema(description = "是否完成预充,true为预充,false为排空") private boolean filledSolution = false; - public SolutionContainerState(ContainerCode containerCode, ContainerType type) { + public SolutionContainerState(Long id, ContainerCode containerCode, ContainerType type) { + this.id = id; this.containerCode = containerCode; this.type = type; } diff --git a/src/main/java/com/iflytop/sgs/common/enums/ContainerType.java b/src/main/java/com/iflytop/sgs/common/enums/ContainerType.java index 678516d..8b992c9 100644 --- a/src/main/java/com/iflytop/sgs/common/enums/ContainerType.java +++ b/src/main/java/com/iflytop/sgs/common/enums/ContainerType.java @@ -12,7 +12,7 @@ public enum ContainerType { */ solution, /** - * 中和容器 + * 废液容器 */ neutralization } diff --git a/src/main/resources/sql/init.sql b/src/main/resources/sql/init.sql index 63e4879..02bd5fa 100644 --- a/src/main/resources/sql/init.sql +++ b/src/main/resources/sql/init.sql @@ -106,4 +106,41 @@ CREATE TABLE IF NOT EXISTS task_steps task_id INTEGER, step_description TEXT, create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP -); \ No newline at end of file +); + +-- container 容器 表 +CREATE TABLE IF NOT EXISTS container +( + id INTEGER PRIMARY KEY AUTOINCREMENT, + type INTEGER, + code TEXT, + solution_id INTEGER, + pump_id TEXT, + capacity_total INTEGER, + capacity_used INTEGER, + filled REAL, + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP +); + +INSERT OR IGNORE INTO container (id, type, code, solution_id, pump_id, capacity_total, capacity_used) +VALUES (1, 0, 'container_01', 1, 'liquid_pump', 5000, 0), + (2, 0, 'container_02', 2, 'liquid_pump', 5000, 2500), + (3, 0, 'container_03', 3, 'liquid_pump', 5000, 2600), + (4, 1, 'container_04', 4, 'liquid_pump', 5000, 0); + + +-- solutions 溶液 表 +CREATE TABLE IF NOT EXISTS solutions +( + id INTEGER PRIMARY KEY AUTOINCREMENT, + name VARCHAR NOT NULL, + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP +); + +INSERT OR IGNORE INTO solutions (id, name, create_time, update_time) +VALUES (1, '稀硝酸', '2025-02-18 02:44:07', '2025-02-18 02:44:07'), + (2, '浓硝酸', '2025-02-18 02:44:07', '2025-02-18 02:44:07'), + (3, '蒸馏水', '2025-02-18 02:44:07', '2025-02-18 02:44:07'), + (4, '废液', '2025-02-18 02:46:23', '2025-02-18 02:46:23'); \ No newline at end of file