From 70245a9904132b1c33d2ece799ba561fc84d213f Mon Sep 17 00:00:00 2001 From: adriano Date: Tue, 17 May 2022 21:36:55 -0300 Subject: [PATCH] =?UTF-8?q?Codifica=C3=A7=C3=A3o=20de=20trycatch=20para=20?= =?UTF-8?q?timers=20do=20schedulerNotify=20e=20monitor=20do=20online=20off?= =?UTF-8?q?line=20ale=20de=20configura=C3=A7=C3=A3o=20da=20tabela=20do=20o?= =?UTF-8?q?nline=20offline?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/src/helpers/SchedulingNotifySendMessage.ts | 6 ++++-- backend/src/helpers/SumOlineTimeNow.ts | 2 ++ backend/src/helpers/WhoIsOnlineMonitor.ts | 2 +- frontend/src/pages/Report/index.js | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/backend/src/helpers/SchedulingNotifySendMessage.ts b/backend/src/helpers/SchedulingNotifySendMessage.ts index 7e950ba..bfad4fd 100644 --- a/backend/src/helpers/SchedulingNotifySendMessage.ts +++ b/backend/src/helpers/SchedulingNotifySendMessage.ts @@ -29,8 +29,10 @@ const monitor = async () => { try { const { schedulingNotifies, count, hasMore } = await ListSchedulingNotifyService({ searchParam: dateParm, pageNumber: "1" }); - - if(schedulingNotifies.length){ + + // console.log('schedulingNotifies: ',schedulingNotifies) + + if(schedulingNotifies && schedulingNotifies.length>0){ const ticket = await ShowTicketService(schedulingNotifies[0].ticketId); diff --git a/backend/src/helpers/SumOlineTimeNow.ts b/backend/src/helpers/SumOlineTimeNow.ts index c2ddad3..3b61f75 100644 --- a/backend/src/helpers/SumOlineTimeNow.ts +++ b/backend/src/helpers/SumOlineTimeNow.ts @@ -9,6 +9,8 @@ import { addHours, addMinutes, addSeconds, intervalToDuration, add } from "date- onlineTime.setUTCMinutes(new Date(oldOnlineTimeSum.onlineTime).getMinutes()) onlineTime.setUTCSeconds(new Date(oldOnlineTimeSum.onlineTime).getSeconds()) + // console.log('_________________oldOnlineTimeSum.updatedAt: ', oldOnlineTimeSum.updatedAt) + let newtTime = intervalToDuration({ start: new Date(oldOnlineTimeSum.updatedAt), end: new Date() }) diff --git a/backend/src/helpers/WhoIsOnlineMonitor.ts b/backend/src/helpers/WhoIsOnlineMonitor.ts index dd1947d..39955d3 100644 --- a/backend/src/helpers/WhoIsOnlineMonitor.ts +++ b/backend/src/helpers/WhoIsOnlineMonitor.ts @@ -34,7 +34,7 @@ let deleted: boolean = false; const emitterOnline = (user: any, status: string, showOnlineTime: boolean = true) => { - if (!user.id) return + if (!user.id || !user.updatedAt || !user.onlineTime) return let newOnlinetime = sumOnlineTimeNow(user) diff --git a/frontend/src/pages/Report/index.js b/frontend/src/pages/Report/index.js index 8ecd9dc..7085131 100644 --- a/frontend/src/pages/Report/index.js +++ b/frontend/src/pages/Report/index.js @@ -705,7 +705,7 @@ const Report = () => { [ // { title: 'Foto', field: 'ticket.contact.profilePicUrl', render: rowData => imagem de perfil do whatsapp }, - { title: 'Nome', field: 'name' }, + { title: 'Nome', field: 'name', cellStyle: {whiteSpace: 'nowrap'}, }, { title: 'Status', field: 'statusOnline.status',