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