diff --git a/api/.vscode/launch.json b/api/.vscode/launch.json index 3a4a4a3..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", 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 = {