diff --git a/script/0.26/schema/1.create_maintenance.sql b/script/0.26/schema/1.create_maintenance.sql new file mode 100644 index 0000000..d408ba8 --- /dev/null +++ b/script/0.26/schema/1.create_maintenance.sql @@ -0,0 +1,98 @@ +create table if not exists maintenance_plan +( + id serial not null + constraint maintenance_plan_pk + primary key, + mission_name varchar(1024) not null, + remark varchar(1024), + reason varchar(1024), + plan_finish_time timestamp with time zone, + actual_finish_time timestamp with time zone, + type varchar(32) not null, + state varchar(32) not null +); + +comment on table maintenance_plan is '维护计划'; + +comment on column maintenance_plan.mission_name is '任务名称'; + +comment on column maintenance_plan.remark is '备注'; + +comment on column maintenance_plan.reason is '操作/故障原因'; + +comment on column maintenance_plan.plan_finish_time is '计划完成时间'; + +comment on column maintenance_plan.actual_finish_time is '实际完成时间 +'; + +comment on column maintenance_plan.type is '分类 period 周期 / temp 临时'; + +comment on column maintenance_plan.state is '完成状态 unfinished 未完成 / underway 进行中 / completed 已完成 / suspend 挂起暂停 / inspected 已检查'; + +create unique index if not exists maintenance_plan_id_uindex + on maintenance_plan (id); + +create table if not exists maintenance_plan_execute_user +( + id serial not null + constraint maintenance_plan_execute_user_pk + primary key, + maintenance_plan_id integer not null + constraint maintenance_plan_execute_user_maintenance_plan_id_fk + references maintenance_plan, + pep_user_id integer not null +); + +comment on table maintenance_plan_execute_user is '维护计划执行人'; + +comment on column maintenance_plan_execute_user.pep_user_id is '项企用户id'; + +create unique index if not exists maintenance_plan_execute_user_id_uindex + on maintenance_plan_execute_user (id); + +create table if not exists maintenance_record +( + id serial not null + constraint maintenance_record_pk + primary key, + sketch varchar(512) not null, + occurrence_time timestamp with time zone, + solving_time timestamp with time zone, + interrupt_duration integer, + type varchar(32), + record varchar(1024) +); + +comment on table maintenance_record is '运维服务记录'; + +comment on column maintenance_record.sketch is '简述'; + +comment on column maintenance_record.occurrence_time is '发生时间'; + +comment on column maintenance_record.solving_time is '解决时间'; + +comment on column maintenance_record.interrupt_duration is '中断时长 / 秒'; + +comment on column maintenance_record.type is '故障类型'; + +comment on column maintenance_record.record is '故障记录'; + +create unique index if not exists maintenance_record_id_uindex + on maintenance_record (id); + +create table if not exists maintenance_record_execute_user +( + id serial not null + constraint maintenance_record_execute_user_pk + primary key, + maintenance_record_id integer not null + constraint maintenance_record_execute_user_maintenance_record_id_fk + references maintenance_record, + pep_user_id integer not null +); + +comment on table maintenance_record_execute_user is '运维服务记录解决者'; + +create unique index if not exists maintenance_record_execute_user_id_uindex + on maintenance_record_execute_user (id); + diff --git a/web/client/src/sections/workOrder/containers/aboutMe.jsx b/web/client/src/sections/workOrder/containers/aboutMe.jsx index d99f061..65e6c8d 100644 --- a/web/client/src/sections/workOrder/containers/aboutMe.jsx +++ b/web/client/src/sections/workOrder/containers/aboutMe.jsx @@ -131,7 +131,7 @@ const Rest = (props) => { layout="horizontal" style={{ position: "relative", width: "100%", flex: 1 }} onSubmit={(values) => { - if (values?.applyTimes) { + if (values?.applyTimes?.length) { values.applyTimes = [moment(values?.applyTimes[0]).format('YYYY-MM-DD HH:mm:ss'), moment(values?.applyTimes[1]).format('YYYY-MM-DD HH:mm:ss')] } backlogData({ ...values, limit: 10, page: 0 }) diff --git a/web/client/src/sections/workOrder/containers/initiated.jsx b/web/client/src/sections/workOrder/containers/initiated.jsx index ab58c67..be3f028 100644 --- a/web/client/src/sections/workOrder/containers/initiated.jsx +++ b/web/client/src/sections/workOrder/containers/initiated.jsx @@ -187,7 +187,7 @@ const Rest = (props) => { layout="horizontal" style={{ position: "relative", width: "100%", flex: 1 }} onSubmit={(values) => { - if (values?.applyTimes) { + if (values?.applyTimes?.length) { values.applyTimes = [moment(values?.applyTimes[0]).format('YYYY-MM-DD HH:mm:ss'), moment(values?.applyTimes[1]).format('YYYY-MM-DD HH:mm:ss')] } backlogData({ ...values, limit: 10, page: 0 }) diff --git a/web/client/src/sections/workOrder/containers/preserve.jsx b/web/client/src/sections/workOrder/containers/preserve.jsx index 7a3b791..09ec169 100644 --- a/web/client/src/sections/workOrder/containers/preserve.jsx +++ b/web/client/src/sections/workOrder/containers/preserve.jsx @@ -146,7 +146,7 @@ const Rest = (props) => { layout="horizontal" style={{ position: "relative", width: "100%", flex: 1 }} onSubmit={(values) => { - if (values?.applyTimes) { + if (values?.applyTimes?.length) { values.applyTimes = [moment(values?.applyTimes[0]).format('YYYY-MM-DD HH:mm:ss'), moment(values?.applyTimes[1]).format('YYYY-MM-DD HH:mm:ss')] } backlogData({ ...values, limit: 10, page: 0 }) @@ -227,7 +227,7 @@ const Rest = (props) => { onCancel={() => { setWorkflowModalVisible(false) }} successCallBack={({ refresh }) => { if (refresh) { - backlogData() + backlogData(query) } setWorkflowModalVisible(false) }} diff --git a/web/client/src/sections/workOrder/containers/receipt.jsx b/web/client/src/sections/workOrder/containers/receipt.jsx index 10cf77f..dd5fc81 100644 --- a/web/client/src/sections/workOrder/containers/receipt.jsx +++ b/web/client/src/sections/workOrder/containers/receipt.jsx @@ -134,7 +134,7 @@ const Rest = (props) => { layout="horizontal" style={{ position: "relative", width: "100%", flex: 1 }} onSubmit={(values) => { - if (values?.applyTimes) { + if (values?.applyTimes?.length) { values.applyTimes = [moment(values?.applyTimes[0]).format('YYYY-MM-DD HH:mm:ss'), moment(values?.applyTimes[1]).format('YYYY-MM-DD HH:mm:ss')] } backlogData({ ...values, limit: 10, page: 0 }) diff --git a/web/client/src/sections/workOrder/containers/stayDoWorkOrder.jsx b/web/client/src/sections/workOrder/containers/stayDoWorkOrder.jsx index e1a0bdf..6347d8e 100644 --- a/web/client/src/sections/workOrder/containers/stayDoWorkOrder.jsx +++ b/web/client/src/sections/workOrder/containers/stayDoWorkOrder.jsx @@ -117,7 +117,7 @@ const Rest = (props) => { layout="horizontal" style={{ position: "relative", width: "100%", flex: 1 }} onSubmit={(values) => { - if (values?.applyTimes) { + if (values?.applyTimes?.length) { values.applyTimes = [moment(values?.applyTimes[0]).format('YYYY-MM-DD HH:mm:ss'), moment(values?.applyTimes[1]).format('YYYY-MM-DD HH:mm:ss')] } backlogData(values)