Browse Source

统计 加班请假总时长

master
巴林闲侠 2 years ago
parent
commit
66b992420a
  1. 10
      api/.vscode/launch.json
  2. 8
      api/app/lib/controllers/attendance/index.js

10
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",
]
},
{

8
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 = {

Loading…
Cancel
Save