|
|
@ -2,7 +2,7 @@ |
|
|
|
|
|
|
|
const moment = require('moment') |
|
|
|
const { alarmConfirmLog } = require('./alarmConfirmLog'); |
|
|
|
async function inspection(ctx) { |
|
|
|
async function inspection (ctx) { |
|
|
|
// 巡查
|
|
|
|
try { |
|
|
|
const models = ctx.fs.dc.models; |
|
|
@ -31,7 +31,7 @@ async function inspection(ctx) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
async function inspectionList(ctx) { |
|
|
|
async function inspectionList (ctx) { |
|
|
|
try { |
|
|
|
const models = ctx.fs.dc.models; |
|
|
|
const { clickHouse } = ctx.app.fs |
|
|
@ -116,7 +116,7 @@ async function inspectionList(ctx) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
async function notedInspection(ctx) { |
|
|
|
async function notedInspection (ctx) { |
|
|
|
try { |
|
|
|
const models = ctx.fs.dc.models; |
|
|
|
const { inspectionId } = ctx.request.body |
|
|
@ -141,7 +141,7 @@ async function notedInspection(ctx) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
async function apiError(ctx) { |
|
|
|
async function apiError (ctx) { |
|
|
|
try { |
|
|
|
const { utils: { sendAppearToWeb } } = ctx.app.fs |
|
|
|
const models = ctx.fs.dc.models; |
|
|
@ -253,12 +253,12 @@ async function apiError(ctx) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
async function apiErrorList(ctx) { |
|
|
|
async function apiErrorList (ctx) { |
|
|
|
try { |
|
|
|
const models = ctx.fs.dc.models; |
|
|
|
const { clickHouse } = ctx.app.fs |
|
|
|
const { utils: { anxinStrucIdRange, pomsProjectRange } } = ctx.app.fs |
|
|
|
const { keyword, errType, confirmState, sustainTimeStart, sustainTimeEnd, limit, page, pepProjectId } = ctx.query |
|
|
|
const { keyword, errType, confirmState, state, sustainTimeStart, sustainTimeEnd, limit, page, pepProjectId } = ctx.query |
|
|
|
|
|
|
|
let pomsProject = await pomsProjectRange({ |
|
|
|
ctx, pepProjectId, |
|
|
@ -311,10 +311,10 @@ async function apiErrorList(ctx) { |
|
|
|
if (errType) { |
|
|
|
findOption.where.type = errType // element / apiError
|
|
|
|
} |
|
|
|
if (confirmState) { |
|
|
|
if (confirmState == 'confirmd') { |
|
|
|
if (confirmState || state) { |
|
|
|
if (confirmState == 'confirmd' || state == 'histroy') { |
|
|
|
findOption.where.confirmTime = { $ne: null } |
|
|
|
} else if (confirmState == 'unconfirmed') { |
|
|
|
} else if (confirmState == 'unconfirmed' || state == 'new') { |
|
|
|
findOption.where.confirmTime = null |
|
|
|
} |
|
|
|
} |
|
|
@ -365,7 +365,7 @@ async function apiErrorList(ctx) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
async function confirmApiError(ctx) { |
|
|
|
async function confirmApiError (ctx) { |
|
|
|
try { |
|
|
|
const models = ctx.fs.dc.models; |
|
|
|
const { confirm, appAlarmId = [], confirmPost } = ctx.request.body |
|
|
|