diff --git a/api/app/lib/controllers/operationData/index.js b/api/app/lib/controllers/operationData/index.js index 0fed92d..9b7ccae 100644 --- a/api/app/lib/controllers/operationData/index.js +++ b/api/app/lib/controllers/operationData/index.js @@ -18,7 +18,7 @@ async function getFailureTime(ctx) { from generate_series(1, 12) as t ) w on e.months = substring(to_char(w.wmonth,'yyyy-mm'),1,7) GROUP BY w.wmonth,e.counts - ORDER BY w.wmonth desc` + ORDER BY w.wmonth asc` ) console.log('111112232', res) let resList = [] @@ -60,7 +60,7 @@ async function getSystemAvailability(ctx) { ) w on e.months = substring(to_char(w.wmonth,'yyyy-mm'),1,7) GROUP BY w.wmonth,w.seconds,e.counts - ORDER BY w.wmonth DESC;` + ORDER BY w.wmonth asc` ) let resList = [] if (res.length > 0) { @@ -111,7 +111,7 @@ async function getOperationsPersonnel(ctx) { const { clickHouse } = ctx.app.fs try { //查询用户id - const res = await sequelize.query(`SELECT t.pep_user_id userId,count(1) FROM maintenance_plan_execute_user t GROUP BY pep_user_id`) + const res = await sequelize.query(`SELECT t.pep_user_id userId,count(1) FROM maintenance_record_execute_user t GROUP BY pep_user_id`) let useList = new Set() console.log('rss', res) if (res.length > 0) { diff --git a/api/app/lib/controllers/problemData/index.js b/api/app/lib/controllers/problemData/index.js index ed3319b..5cfc139 100644 --- a/api/app/lib/controllers/problemData/index.js +++ b/api/app/lib/controllers/problemData/index.js @@ -121,7 +121,7 @@ async function getMaintenceTotal(ctx) { //所有维修记录 const res = await sequelize.query(` SELECT emrp.project_id, - count(case when record.status in ('维修中','待维修') then record.id end) incomplete, + count(case when record.status in ('维修中','待维修','维修完成') then record.id end) incomplete, count(case when record.status in ('维修完成') then record.id end) completed FROM equipment_maintenance_record record RIGHT JOIN equipment_maintenance_record_project emrp diff --git a/script/0.27/schema/create_equipment_maintenance_record.sql b/script/0.27/schema/create_equipment_maintenance_record.sql deleted file mode 100644 index e7f1ffa..0000000 --- a/script/0.27/schema/create_equipment_maintenance_record.sql +++ /dev/null @@ -1,26 +0,0 @@ -drop table if exists equipment_maintenance_record; -create table equipment_maintenance_record -( - id serial - primary key, - equipment_type varchar(32), - equipment_category varchar(32), - maintenance_reason varchar(1024), - solution varchar(1024), - report_time timestamp with time zone, - completed_time timestamp with time zone, - status varchar(32) -); -comment on column public.equipment_maintenance_record.equipment_type is '设备型号'; - -comment on column public.equipment_maintenance_record.equipment_category is '设备类型'; - -comment on column public.equipment_maintenance_record.maintenance_reason is '维修原因'; - -comment on column public.equipment_maintenance_record.solution is '解决方案'; - -comment on column public.equipment_maintenance_record.report_time is '上报时间'; - -comment on column public.equipment_maintenance_record.completed_time is '维修完成时间'; - -comment on column public.equipment_maintenance_record.status is '状态'; \ No newline at end of file diff --git a/script/0.27/schema/create_equipment_maintenance_record_execute_user.sql b/script/0.27/schema/create_equipment_maintenance_record_execute_user.sql deleted file mode 100644 index 4ac2617..0000000 --- a/script/0.27/schema/create_equipment_maintenance_record_execute_user.sql +++ /dev/null @@ -1,9 +0,0 @@ -create table equipment_maintenance_record_execute_user -( - id serial - primary key, - equipment_maintenance_record_id integer - constraint equipment_maintenance_record_equipment_maintenance_record_fkey1 - references equipment_maintenance_record, - pep_user_id integer -); diff --git a/script/0.27/schema/create_equipment_maintenance_record_project.sql b/script/0.27/schema/create_equipment_maintenance_record_project.sql deleted file mode 100644 index 67d593f..0000000 --- a/script/0.27/schema/create_equipment_maintenance_record_project.sql +++ /dev/null @@ -1,9 +0,0 @@ -create table equipment_maintenance_record_project -( - id serial - primary key, - equipment_maintenance_record_id integer - constraint equipment_maintenance_record__equipment_maintenance_record_fkey - references equipment_maintenance_record, - project_id integer -); \ No newline at end of file diff --git a/script/0.27/schema/create_server_maintenance_record.sql b/script/0.27/schema/create_server_maintenance_record.sql deleted file mode 100644 index 3adf6bd..0000000 --- a/script/0.27/schema/create_server_maintenance_record.sql +++ /dev/null @@ -1,16 +0,0 @@ -create table server_maintenance_record( - id serial primary key, - sketch varchar(512), - reason varchar(512), - remark varchar(1024), - maintenance_start_time timestamp with time zone, - maintenance_finish_time timestamp with time zone, - state varchar(32) - ); -comment on column public.server_maintenance_record.sketch is '简述'; -comment on column public.server_maintenance_record.reason is '维修原因'; -comment on column public.server_maintenance_record.remark is '备注'; -comment on column public.server_maintenance_record.maintenance_start_time is '维护开始时间'; -comment on column public.server_maintenance_record.maintenance_finish_time is '维护结束时间'; -comment on column public.server_maintenance_record.state is '维护结束时间'; -comment on column public.server_maintenance_record.state is '完成状态 wait 待维修 / underway 维修中 / completed 维修完成 '; diff --git a/script/0.27/schema/create_server_maintenance_record_repairman.sql b/script/0.27/schema/create_server_maintenance_record_repairman.sql deleted file mode 100644 index 2ac702e..0000000 --- a/script/0.27/schema/create_server_maintenance_record_repairman.sql +++ /dev/null @@ -1,5 +0,0 @@ -create table server_maintenance_record_repairman( - id serial primary key, - server_maintenance_record_id integer references server_maintenance_record(id), - pep_user_id integer -) \ No newline at end of file diff --git a/script/0.28/schema/01create_sysyem_problem.sql b/script/0.28/schema/01create_sysyem_problem.sql deleted file mode 100644 index af601fd..0000000 --- a/script/0.28/schema/01create_sysyem_problem.sql +++ /dev/null @@ -1,15 +0,0 @@ -create table public.system_problem( - id serial primary key, - type varchar(20) -); -comment on column public.system_problem.type is '问题类型:数据库异常、es异常、kafka异常、服务器异常、应用异常、其他'; - -insert into system_problem ( type)values ('es异常'); -insert into system_problem (type)values ('数据库异常'); -insert into system_problem (type)values ('应用异常'); -insert into system_problem (type)values ('kafka异常'); -insert into system_problem (type)values ('服务器异常'); -insert into system_problem (type)values ('DAC进程异常'); -insert into system_problem (type)values ('K8S集群异常'); -insert into system_problem (type)values ('redis服务异常'); -insert into system_problem (type)values ('其他'); diff --git a/web/client/src/sections/service/containers/maintenanceRecords.jsx b/web/client/src/sections/service/containers/maintenanceRecords.jsx index dfaa729..d719f20 100644 --- a/web/client/src/sections/service/containers/maintenanceRecords.jsx +++ b/web/client/src/sections/service/containers/maintenanceRecords.jsx @@ -214,7 +214,8 @@ const MaintenanceRecords = (props) => { onClose={() => { setAddVis(false); setRecordRow(null); - getEquipment(); + //getEquipment(); + findHandler() }} recordRow={recordRow} pepList={pepList}