This commit is contained in:
rnchg
2026-07-14 21:33:39 +08:00
commit 4b28b75e57
2227 changed files with 768410 additions and 0 deletions
View File
+2
View File
@@ -0,0 +1,2 @@
ALTER TABLE "data_car"
ADD COLUMN "is_lock" bool NOT NULL DEFAULT FALSE;
@@ -0,0 +1,2 @@
UPDATE "flow_task_template_parameter" SET "value" = '2' WHERE "id" = 'ChargeNodeStartChargingParameter';
UPDATE "flow_task_template_parameter" SET "value" = '1' WHERE "id" = 'ChargeNodeStopChargingParameter';
+16
View File
@@ -0,0 +1,16 @@
WITH dict AS (
SELECT "id" AS dict_id FROM "frame_dict" WHERE "code" = 'CarType' LIMIT 1
),
_deleted AS (
DELETE FROM "frame_dict_item"
WHERE "dict_id" IN (SELECT dict_id FROM dict)
)
INSERT INTO "frame_dict_item"
("id", "dict_id", "code", "name", "value", "sort_number", "is_enable", "is_delete", "create_at", "create_by", "update_at", "update_by")
VALUES
(gen_random_uuid(), (SELECT dict_id FROM dict), 'Fairyland.Plc', '法睿兰达 [ PLC ]', 0, 1, TRUE, FALSE, CURRENT_TIMESTAMP, 'FASS.Mvc', CURRENT_TIMESTAMP, 'FASS.Mvc'),
(gen_random_uuid(), (SELECT dict_id FROM dict), 'Fairyland.Plc_v1', '法睿兰达 [ PLC_v1 ]', 1, 2, TRUE, FALSE, CURRENT_TIMESTAMP, 'FASS.Mvc', CURRENT_TIMESTAMP, 'FASS.Mvc'),
(gen_random_uuid(), (SELECT dict_id FROM dict), 'Fairyland.Pcb', '法睿兰达 [ PCB ]', 2, 3, TRUE, FALSE, CURRENT_TIMESTAMP, 'FASS.Mvc', CURRENT_TIMESTAMP, 'FASS.Mvc'),
(gen_random_uuid(), (SELECT dict_id FROM dict), 'Fairyland.Pc', '法睿兰达 [ PC ]', 3, 4, TRUE, FALSE, CURRENT_TIMESTAMP, 'FASS.Mvc', CURRENT_TIMESTAMP, 'FASS.Mvc'),
(gen_random_uuid(), (SELECT dict_id FROM dict), 'Standard.Vda5050', '行业标准 [ VDA5050 ]', 4, 5, TRUE, FALSE, CURRENT_TIMESTAMP, 'FASS.Mvc', CURRENT_TIMESTAMP, 'FASS.Mvc');
+4
View File
@@ -0,0 +1,4 @@
ALTER TABLE "data_avoid"
ALTER COLUMN "node_id" DROP NOT NULL,
DROP CONSTRAINT "FK_data_avoid_base_node_node_id",
ADD CONSTRAINT "FK_data_avoid_base_node_node_id" FOREIGN KEY ("node_id") REFERENCES "base_node" ("id") ON DELETE SET NULL ON UPDATE NO ACTION;
+4
View File
@@ -0,0 +1,4 @@
ALTER TABLE "data_charge"
ALTER COLUMN "node_id" DROP NOT NULL,
DROP CONSTRAINT "FK_data_charge_base_node_node_id",
ADD CONSTRAINT "FK_data_charge_base_node_node_id" FOREIGN KEY ("node_id") REFERENCES "base_node" ("id") ON DELETE SET NULL ON UPDATE NO ACTION;
+4
View File
@@ -0,0 +1,4 @@
ALTER TABLE "data_standby"
ALTER COLUMN "node_id" DROP NOT NULL,
DROP CONSTRAINT "FK_data_standby_base_node_node_id",
ADD CONSTRAINT "FK_data_standby_base_node_node_id" FOREIGN KEY ("node_id") REFERENCES "base_node" ("id") ON DELETE SET NULL ON UPDATE NO ACTION;
@@ -0,0 +1,3 @@
ALTER TABLE "data_car_traffic"
ADD COLUMN "start_time" timestamp(6),
ADD COLUMN "end_time" timestamp(6);
+50
View File
@@ -0,0 +1,50 @@
DROP TABLE IF EXISTS "frame_notice";
CREATE TABLE "frame_notice" (
"id" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
"user_id" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
"title" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
"content" text COLLATE "pg_catalog"."default",
"type" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
"level" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
"state" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
"target" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
"target_users" jsonb,
"publish_time" timestamp(6),
"revoke_time" timestamp(6),
"sort_number" float8 NOT NULL,
"is_enable" bool NOT NULL,
"is_delete" bool NOT NULL,
"create_at" timestamp(6) NOT NULL,
"create_by" varchar(50) COLLATE "pg_catalog"."default",
"update_at" timestamp(6) NOT NULL,
"update_by" varchar(50) COLLATE "pg_catalog"."default",
"remark" text COLLATE "pg_catalog"."default",
"extend" text COLLATE "pg_catalog"."default"
)
;
-- ----------------------------
-- Indexes structure for table frame_notice
-- ----------------------------
CREATE INDEX "IX_frame_notice_create_at" ON "frame_notice" USING btree (
"create_at" "pg_catalog"."timestamp_ops" ASC NULLS LAST
);
CREATE INDEX "IX_frame_notice_sort_number" ON "frame_notice" USING btree (
"sort_number" "pg_catalog"."float8_ops" ASC NULLS LAST
);
CREATE INDEX "IX_frame_notice_update_at" ON "frame_notice" USING btree (
"update_at" "pg_catalog"."timestamp_ops" ASC NULLS LAST
);
CREATE INDEX "IX_frame_notice_user_id" ON "frame_notice" USING btree (
"user_id" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
-- ----------------------------
-- Primary Key structure for table frame_notice
-- ----------------------------
ALTER TABLE "frame_notice" ADD CONSTRAINT "PK_frame_notice" PRIMARY KEY ("id");
-- ----------------------------
-- Foreign Keys structure for table frame_notice
-- ----------------------------
ALTER TABLE "frame_notice" ADD CONSTRAINT "FK_frame_notice_account_user_user_id" FOREIGN KEY ("user_id") REFERENCES "account_user" ("id") ON DELETE CASCADE ON UPDATE NO ACTION;
@@ -0,0 +1,48 @@
DROP TABLE IF EXISTS "frame_user_notice";
CREATE TABLE "frame_user_notice" (
"id" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
"user_id" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
"notice_id" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
"is_read" bool NOT NULL,
"read_time" timestamp(6),
"sort_number" float8 NOT NULL,
"is_enable" bool NOT NULL,
"is_delete" bool NOT NULL,
"create_at" timestamp(6) NOT NULL,
"create_by" varchar(50) COLLATE "pg_catalog"."default",
"update_at" timestamp(6) NOT NULL,
"update_by" varchar(50) COLLATE "pg_catalog"."default",
"remark" text COLLATE "pg_catalog"."default",
"extend" text COLLATE "pg_catalog"."default"
)
;
-- ----------------------------
-- Indexes structure for table frame_user_notice
-- ----------------------------
CREATE INDEX "IX_frame_user_notice_create_at" ON "frame_user_notice" USING btree (
"create_at" "pg_catalog"."timestamp_ops" ASC NULLS LAST
);
CREATE INDEX "IX_frame_user_notice_notice_id" ON "frame_user_notice" USING btree (
"notice_id" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE INDEX "IX_frame_user_notice_sort_number" ON "frame_user_notice" USING btree (
"sort_number" "pg_catalog"."float8_ops" ASC NULLS LAST
);
CREATE INDEX "IX_frame_user_notice_update_at" ON "frame_user_notice" USING btree (
"update_at" "pg_catalog"."timestamp_ops" ASC NULLS LAST
);
CREATE INDEX "IX_frame_user_notice_user_id" ON "frame_user_notice" USING btree (
"user_id" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
-- ----------------------------
-- Primary Key structure for table frame_user_notice
-- ----------------------------
ALTER TABLE "frame_user_notice" ADD CONSTRAINT "PK_frame_user_notice" PRIMARY KEY ("id");
-- ----------------------------
-- Foreign Keys structure for table frame_user_notice
-- ----------------------------
ALTER TABLE "frame_user_notice" ADD CONSTRAINT "FK_frame_user_notice_account_user_user_id" FOREIGN KEY ("user_id") REFERENCES "account_user" ("id") ON DELETE CASCADE ON UPDATE NO ACTION;
ALTER TABLE "frame_user_notice" ADD CONSTRAINT "FK_frame_user_notice_frame_notice_notice_id" FOREIGN KEY ("notice_id") REFERENCES "frame_notice" ("id") ON DELETE CASCADE ON UPDATE NO ACTION;
@@ -0,0 +1,9 @@
ALTER TABLE "flow_task_template"
ADD COLUMN "is_break" bool,
ADD COLUMN "is_preempt" bool;
UPDATE "flow_task_template" SET "is_break" = TRUE, "is_preempt" = FALSE WHERE "id" = 'Standby';
UPDATE "flow_task_template" SET "is_break" = FALSE, "is_preempt" = FALSE WHERE "id" = 'Charge';
UPDATE "flow_task_template" SET "is_break" = TRUE, "is_preempt" = TRUE WHERE "id" = 'Avoid';
UPDATE "flow_task_template" SET "is_break" = TRUE, "is_preempt" = FALSE WHERE "id" = 'Single';
UPDATE "flow_task_template" SET "is_break" = TRUE, "is_preempt" = FALSE WHERE "id" = 'Double';
@@ -0,0 +1,3 @@
ALTER TABLE "flow_task_instance"
ADD COLUMN "is_break" bool,
ADD COLUMN "is_preempt" bool;
+30
View File
@@ -0,0 +1,30 @@
INSERT INTO
"public"."frame_config" (
"id",
"key",
"value",
"sort_number",
"is_enable",
"is_delete",
"create_at",
"create_by",
"update_at",
"update_by",
"remark",
"extend"
)
VALUES
(
gen_random_uuid (),
'PreemptMode',
'CurrAndAction',
'0',
't',
'f',
'2026-03-12 12:00:00.00000',
'FASS.Mvc',
'2026-03-12 12:00:00.00000',
'FASS.Mvc',
NULL,
NULL
);
+4
View File
@@ -0,0 +1,4 @@
ALTER TABLE "record_diary"
ADD COLUMN "count" int4 NOT NULL DEFAULT 0,
ADD COLUMN "start_time" timestamp,
ADD COLUMN "end_time" timestamp;
+4
View File
@@ -0,0 +1,4 @@
ALTER TABLE "record_alarm"
ADD COLUMN "count" int4 NOT NULL DEFAULT 0,
ADD COLUMN "start_time" timestamp,
ADD COLUMN "end_time" timestamp;
+92
View File
@@ -0,0 +1,92 @@
INSERT INTO
"public"."frame_config" (
"id",
"key",
"value",
"sort_number",
"is_enable",
"is_delete",
"create_at",
"create_by",
"update_at",
"update_by",
"remark",
"extend"
)
VALUES
(
gen_random_uuid (),
'DiaryWindowSeconds',
'60',
'0',
't',
'f',
'2026-03-12 12:00:00.00000',
'FASS.Mvc',
'2026-03-12 12:00:00.00000',
'FASS.Mvc',
NULL,
NULL
);
INSERT INTO
"public"."frame_config" (
"id",
"key",
"value",
"sort_number",
"is_enable",
"is_delete",
"create_at",
"create_by",
"update_at",
"update_by",
"remark",
"extend"
)
VALUES
(
gen_random_uuid (),
'AlarmWindowSeconds',
'60',
'0',
't',
'f',
'2026-03-12 12:00:00.00000',
'FASS.Mvc',
'2026-03-12 12:00:00.00000',
'FASS.Mvc',
NULL,
NULL
);
INSERT INTO
"public"."frame_config" (
"id",
"key",
"value",
"sort_number",
"is_enable",
"is_delete",
"create_at",
"create_by",
"update_at",
"update_by",
"remark",
"extend"
)
VALUES
(
gen_random_uuid (),
'TrafficWindowSeconds',
'30',
'0',
't',
'f',
'2026-03-12 12:00:00.00000',
'FASS.Mvc',
'2026-03-12 12:00:00.00000',
'FASS.Mvc',
NULL,
NULL
);
@@ -0,0 +1,3 @@
ALTER TABLE "flow_task_instance"
ADD COLUMN "interrupt_mode" varchar(50),
ADD COLUMN "interrupt_time" timestamp;
@@ -0,0 +1,64 @@
BEGIN;
DO $$
DECLARE
current_schema_name text := current_schema();
unique_constraint_name text;
unique_index_name text;
BEGIN
SELECT tc.constraint_name
INTO unique_constraint_name
FROM information_schema.table_constraints AS tc
JOIN information_schema.constraint_column_usage AS ccu
ON ccu.constraint_schema = tc.constraint_schema
AND ccu.constraint_name = tc.constraint_name
WHERE tc.table_schema = current_schema_name
AND tc.table_name = 'flow_task_instance'
AND tc.constraint_type = 'UNIQUE'
AND ccu.column_name = 'append_id'
ORDER BY tc.constraint_name
LIMIT 1;
IF unique_constraint_name IS NOT NULL THEN
EXECUTE format(
'ALTER TABLE %I.%I DROP CONSTRAINT %I',
current_schema_name,
'flow_task_instance',
unique_constraint_name);
END IF;
SELECT indexname
INTO unique_index_name
FROM pg_indexes
WHERE schemaname = current_schema_name
AND tablename = 'flow_task_instance'
AND indexname = 'IX_flow_task_instance_append_id'
AND indexdef LIKE '%UNIQUE INDEX%'
LIMIT 1;
IF unique_index_name IS NOT NULL THEN
EXECUTE format(
'DROP INDEX IF EXISTS %I.%I',
current_schema_name,
unique_index_name);
END IF;
IF NOT EXISTS (
SELECT 1
FROM pg_indexes
WHERE schemaname = current_schema_name
AND tablename = 'flow_task_instance'
AND indexname = 'IX_flow_task_instance_append_id'
) THEN
EXECUTE format(
'CREATE INDEX %I ON %I.%I (%I)',
'IX_flow_task_instance_append_id',
current_schema_name,
'flow_task_instance',
'append_id');
END IF;
END
$$;
COMMIT;
@@ -0,0 +1,21 @@
ALTER TABLE public.flow_task_instance
ADD COLUMN IF NOT EXISTS task_template_code varchar(100),
ADD COLUMN IF NOT EXISTS is_loop bool NOT NULL DEFAULT false;
UPDATE public.flow_task_instance AS ti
SET
task_template_code = tt.code,
is_loop = COALESCE(tt.is_loop, false)
FROM public.flow_task_template AS tt
WHERE ti.task_template_id = tt.id
AND (
ti.task_template_code IS DISTINCT FROM tt.code
OR ti.is_loop IS DISTINCT FROM COALESCE(tt.is_loop, false)
);
UPDATE public.flow_task_instance
SET task_template_code = COALESCE(task_template_code, task_template_id)
WHERE task_template_code IS NULL;
CREATE INDEX IF NOT EXISTS ix_flow_task_instance_task_template_code
ON public.flow_task_instance (task_template_code);
+115
View File
@@ -0,0 +1,115 @@
CREATE TABLE
"record_message" (
"id" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
"type" varchar(50) COLLATE "pg_catalog"."default",
"text" varchar(1000) COLLATE "pg_catalog"."default",
"data" text COLLATE "pg_catalog"."default",
"sort_number" float8 NOT NULL,
"is_enable" bool NOT NULL,
"is_delete" bool NOT NULL,
"create_at" timestamp(6) NOT NULL,
"create_by" varchar(50) COLLATE "pg_catalog"."default",
"update_at" timestamp(6) NOT NULL,
"update_by" varchar(50) COLLATE "pg_catalog"."default",
"remark" text COLLATE "pg_catalog"."default",
"extend" text COLLATE "pg_catalog"."default"
);
CREATE INDEX "IX_record_message_create_at" ON "record_message" USING btree (
"create_at" "pg_catalog"."timestamp_ops" ASC NULLS LAST
);
CREATE INDEX "IX_record_message_sort_number" ON "record_message" USING btree (
"sort_number" "pg_catalog"."float8_ops" ASC NULLS LAST
);
CREATE INDEX "IX_record_message_type" ON "record_message" USING btree (
"type" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE INDEX "IX_record_message_update_at" ON "record_message" USING btree (
"update_at" "pg_catalog"."timestamp_ops" ASC NULLS LAST
);
ALTER TABLE "record_message" ADD CONSTRAINT "PK_record_message" PRIMARY KEY ("id");
INSERT INTO
"account_permission" (
"id",
"parent_id",
"type",
"code",
"name",
"icon",
"method",
"target",
"address",
"sort_number",
"is_enable",
"is_delete",
"create_at",
"create_by",
"update_at",
"update_by",
"remark",
"extend"
)
VALUES
(
gen_random_uuid (),
(
SELECT
"id"
FROM
"account_permission"
WHERE
"code" = 'Record'
),
'Menu',
'RecordMessage',
'消息记录',
'fa-fw fa-solid fa-caret-right',
'Get',
'/Record/Message/Index',
NULL,
'3',
't',
'f',
'2026-05-07 22:03:19.685512',
'FASS.Mvc',
'2026-05-07 22:03:19.685512',
'FASS.Mvc',
NULL,
NULL
);
INSERT INTO
"frame_config" (
"id",
"key",
"value",
"sort_number",
"is_enable",
"is_delete",
"create_at",
"create_by",
"update_at",
"update_by",
"remark",
"extend"
)
VALUES
(
gen_random_uuid (),
'MessageDayLimit',
'10',
'0',
't',
'f',
'2026-05-07 22:03:19.685512',
'FASS.Mvc',
'2026-05-07 22:03:19.685512',
'FASS.Mvc',
NULL,
NULL
);
+2
View File
@@ -0,0 +1,2 @@
ALTER TABLE "flow_task_instance"
ADD COLUMN "recovery" text;
@@ -0,0 +1 @@
ALTER TABLE "flow_task_template" ALTER COLUMN "car_type_Id" DROP NOT NULL;