diff --git a/yudao-module-iot/yudao-module-iot-biz/src/test/java/cn/iocoder/yudao/module/iot/service/iotorganization/IotOrganizationServiceImplTest.java b/yudao-module-iot/yudao-module-iot-biz/src/test/java/cn/iocoder/yudao/module/iot/service/iotorganization/IotOrganizationServiceImplTest.java index a4058ae0f..6250c4d91 100644 --- a/yudao-module-iot/yudao-module-iot-biz/src/test/java/cn/iocoder/yudao/module/iot/service/iotorganization/IotOrganizationServiceImplTest.java +++ b/yudao-module-iot/yudao-module-iot-biz/src/test/java/cn/iocoder/yudao/module/iot/service/iotorganization/IotOrganizationServiceImplTest.java @@ -46,7 +46,7 @@ public class IotOrganizationServiceImplTest extends BaseDbUnitTest { public void testCreateOrganization_success() { // 准备参数 IotOrganizationSaveReqVO createReqVO = randomPojo(IotOrganizationSaveReqVO.class).setId(null); - + createReqVO.setParentId(0L); // 调用 Long organizationId = organizationService.createOrganization(createReqVO); // 断言 @@ -66,6 +66,7 @@ public class IotOrganizationServiceImplTest extends BaseDbUnitTest { o.setId(dbOrganization.getId()); // 设置更新的 ID }); + updateReqVO.setParentId(0L); // 调用 organizationService.updateOrganization(updateReqVO); // 校验是否更新正确 diff --git a/yudao-module-iot/yudao-module-iot-biz/src/test/resources/sql/clean.sql b/yudao-module-iot/yudao-module-iot-biz/src/test/resources/sql/clean.sql index 3e1936e76..32bae7e31 100644 --- a/yudao-module-iot/yudao-module-iot-biz/src/test/resources/sql/clean.sql +++ b/yudao-module-iot/yudao-module-iot-biz/src/test/resources/sql/clean.sql @@ -18,6 +18,3 @@ DELETE FROM "iot_gateway"; DELETE FROM "iot_iot_organization"; -- 将该删表 SQL 语句,添加到 yudao-module-iot-biz 模块的 test/resources/sql/clean.sql 文件里 DELETE FROM "iot_kanban"; - --- 将该删表 SQL 语句,添加到 yudao-module-mes-biz 模块的 test/resources/sql/clean.sql 文件里 -DELETE FROM "mes_machine_component"; \ No newline at end of file diff --git a/yudao-module-iot/yudao-module-iot-biz/src/test/resources/sql/create_tables.sql b/yudao-module-iot/yudao-module-iot-biz/src/test/resources/sql/create_tables.sql index 575033d30..1dba4572d 100644 --- a/yudao-module-iot/yudao-module-iot-biz/src/test/resources/sql/create_tables.sql +++ b/yudao-module-iot/yudao-module-iot-biz/src/test/resources/sql/create_tables.sql @@ -155,7 +155,7 @@ CREATE TABLE IF NOT EXISTS "iot_iot_organization" "updater" varchar DEFAULT '', "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, "deleted" bit NOT NULL DEFAULT FALSE, - "tenant_id" bigint NOT NULL, + "tenant_id" bigint , "name" varchar NOT NULL, "parent_id" bigint NOT NULL, "status" int, @@ -183,27 +183,4 @@ CREATE TABLE IF NOT EXISTS "iot_kanban" PRIMARY KEY ("id") ) COMMENT '物联看板'; -CREATE TABLE IF NOT EXISTS "mes_machine_component" -( - "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, - "name" varchar NOT NULL, - "parent_id" bigint NOT NULL, - "sort" int NOT NULL, - "org_id" bigint NOT NULL, - "serial_code" varchar, - "outgoing_time" varchar, - "outgoing_report" varchar, - "position" varchar, - "standard" varchar, - "remark" varchar, - "creator" varchar DEFAULT '', - "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updater" varchar DEFAULT '', - "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - "deleted" bit NOT NULL DEFAULT FALSE, - "tenant_id" bigint NOT NULL, - "status" int NOT NULL, - "component_type" int NOT NULL, - "machine_type" varchar, - PRIMARY KEY ("id") -) COMMENT '机台组织表'; + diff --git a/yudao-module-mes/yudao-module-mes-biz/src/test/java/cn/iocoder/yudao/module/mes/service/machine/MachineComponentServiceImplTest.java b/yudao-module-mes/yudao-module-mes-biz/src/test/java/cn/iocoder/yudao/module/mes/service/machine/MachineComponentServiceImplTest.java index 73ebacbfd..b6b30df53 100644 --- a/yudao-module-mes/yudao-module-mes-biz/src/test/java/cn/iocoder/yudao/module/mes/service/machine/MachineComponentServiceImplTest.java +++ b/yudao-module-mes/yudao-module-mes-biz/src/test/java/cn/iocoder/yudao/module/mes/service/machine/MachineComponentServiceImplTest.java @@ -46,7 +46,7 @@ public class MachineComponentServiceImplTest extends BaseDbUnitTest { public void testCreateMachineComponent_success() { // 准备参数 MachineComponentSaveReqVO createReqVO = randomPojo(MachineComponentSaveReqVO.class).setId(null); - + createReqVO.setParentId(0L); // 调用 Long machineComponentId = machineComponentService.createMachineComponent(createReqVO); // 断言 @@ -65,7 +65,7 @@ public class MachineComponentServiceImplTest extends BaseDbUnitTest { MachineComponentSaveReqVO updateReqVO = randomPojo(MachineComponentSaveReqVO.class, o -> { o.setId(dbMachineComponent.getId()); // 设置更新的 ID }); - + updateReqVO.setParentId(0L); // 调用 machineComponentService.updateMachineComponent(updateReqVO); // 校验是否更新正确 diff --git a/yudao-module-mes/yudao-module-mes-biz/src/test/resources/sql/clean.sql b/yudao-module-mes/yudao-module-mes-biz/src/test/resources/sql/clean.sql index 3563fbc12..3d98bbdd0 100644 --- a/yudao-module-mes/yudao-module-mes-biz/src/test/resources/sql/clean.sql +++ b/yudao-module-mes/yudao-module-mes-biz/src/test/resources/sql/clean.sql @@ -31,7 +31,8 @@ DELETE FROM "mes_produce_report"; -- 将该删表 SQL 语句,添加到 yudao-module-mes-biz 模块的 test/resources/sql/clean.sql 文件里 DELETE FROM "mes_produce_report_detail"; - +-- 将该删表 SQL 语句,添加到 yudao-module-mes-biz 模块的 test/resources/sql/clean.sql 文件里 +DELETE FROM "mes_machine_component"; diff --git a/yudao-module-mes/yudao-module-mes-biz/src/test/resources/sql/create_tables.sql b/yudao-module-mes/yudao-module-mes-biz/src/test/resources/sql/create_tables.sql index 995e2d155..7df31e500 100644 --- a/yudao-module-mes/yudao-module-mes-biz/src/test/resources/sql/create_tables.sql +++ b/yudao-module-mes/yudao-module-mes-biz/src/test/resources/sql/create_tables.sql @@ -228,7 +228,7 @@ CREATE TABLE IF NOT EXISTS "mes_record_suijiang" "updater" varchar DEFAULT '', "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, "deleted" bit NOT NULL DEFAULT FALSE, - "tenant_id" bigint NOT NULL, + "tenant_id" bigint , PRIMARY KEY ("id") ) COMMENT '碎浆记录表'; @@ -312,3 +312,27 @@ CREATE TABLE IF NOT EXISTS "mes_produce_report_detail" PRIMARY KEY ("id") ) COMMENT '生产报工明细'; +CREATE TABLE IF NOT EXISTS "mes_machine_component" +( + "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, + "name" varchar NOT NULL, + "parent_id" bigint NOT NULL, + "sort" int NOT NULL, + "org_id" bigint NOT NULL, + "serial_code" varchar, + "outgoing_time" varchar, + "outgoing_report" varchar, + "position" varchar, + "standard" varchar, + "remark" varchar, + "creator" varchar DEFAULT '', + "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updater" varchar DEFAULT '', + "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + "deleted" bit NOT NULL DEFAULT FALSE, + "tenant_id" bigint , + "status" int NOT NULL, + "component_type" int NOT NULL, + "machine_type" varchar, + PRIMARY KEY ("id") +) COMMENT '机台组织表'; \ No newline at end of file