From 66b992420ac27d7bfb66c1cd9a02d947c3f1e4b4 Mon Sep 17 00:00:00 2001 From: "gao.zhiyuan" Date: Tue, 29 Nov 2022 16:44:24 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=9F=E8=AE=A1=20=E5=8A=A0=E7=8F=AD?= =?UTF-8?q?=E8=AF=B7=E5=81=87=E6=80=BB=E6=97=B6=E9=95=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/.vscode/launch.json | 10 +++++----- api/app/lib/controllers/attendance/index.js | 8 ++++++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/api/.vscode/launch.json b/api/.vscode/launch.json index bda745f..efc0fbb 100644 --- a/api/.vscode/launch.json +++ b/api/.vscode/launch.json @@ -19,9 +19,9 @@ "-g postgres://postgres:123@10.8.30.166:5432/hr-dev", "--redisHost 10.8.30.112", "--redisPort 6379", - // "--apiEmisUrl http://10.8.30.112:14000", + "--apiEmisUrl http://10.8.30.112:14000", // 测试 - "--apiEmisUrl http://10.8.30.161:1111", + // "--apiEmisUrl http://10.8.30.161:1111", "--qnak XuDgkao6cL0HidoMAPnA5OB10Mc_Ew08mpIfRJK5", "--qnsk yewcieZLzKZuDfig0wLZ9if9jKp2P_1jd3CMJPSa", "--qnbkt dev-hr", @@ -42,9 +42,9 @@ // 测试 "--clickHouseUrl http://10.8.30.161", - "--clickHousePepEmis pg_pepca", - "--clickHouseCamworkflow pg_camworkflow", - "--clickHouseHr pg_hrm", + "--clickHousePepEmis pepca8", + "--clickHouseCamworkflow camworkflow", + "--clickHouseHr hrm", ] }, { diff --git a/api/app/lib/controllers/attendance/index.js b/api/app/lib/controllers/attendance/index.js index d5b08c7..c01ca40 100644 --- a/api/app/lib/controllers/attendance/index.js +++ b/api/app/lib/controllers/attendance/index.js @@ -29,7 +29,9 @@ async function overtimeStatistic (ctx) { }) returnD.forEach(u => { - u.overtimeStatistic = sumRes.filter(s => s.pepUserId == u.pepUserId) + let overtimeStatistic = sumRes.filter(s => s.pepUserId == u.pepUserId) + u.overtimeDuration = overtimeStatistic.reduce((sum, os) => sum + os.duration, 0) + u.overtimeStatistic = overtimeStatistic }) ctx.status = 200; ctx.body = { @@ -204,7 +206,9 @@ async function vacateStatistic (ctx) { }) returnD.forEach(u => { - u.vacateStatistic = sumRes.filter(s => s.pepUserId == u.pepUserId) + let vacateStatistic = sumRes.filter(s => s.pepUserId == u.pepUserId) + u.vacateDuration = vacateStatistic.reduce((sum, vs) => sum + vs.duration, 0) + u.vacateStatistic = vacateStatistic }) ctx.status = 200; ctx.body = {