|
@ -277,7 +277,8 @@ async function list (ctx) { |
|
|
const userRes = await memberList({ |
|
|
const userRes = await memberList({ |
|
|
keywordTarget, keyword, limit, page, state, |
|
|
keywordTarget, keyword, limit, page, state, |
|
|
hiredateStart, hiredateEnd, marital, native, workPlace, |
|
|
hiredateStart, hiredateEnd, marital, native, workPlace, |
|
|
orderBy, orderDirection, nowAttendanceTime: true |
|
|
orderBy, orderDirection, |
|
|
|
|
|
nowAttendanceTime: true |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
let { packageUser: returnD, pepUserIds } = await packageUserData(userRes, { |
|
|
let { packageUser: returnD, pepUserIds } = await packageUserData(userRes, { |
|
@ -472,9 +473,18 @@ async function exportData (ctx) { |
|
|
const { models } = ctx.fs.dc; |
|
|
const { models } = ctx.fs.dc; |
|
|
const { clickHouse, opts: { qiniu } } = ctx.app.fs |
|
|
const { clickHouse, opts: { qiniu } } = ctx.app.fs |
|
|
const { simpleExcelDown, memberList, packageUserData } = ctx.app.fs.utils |
|
|
const { simpleExcelDown, memberList, packageUserData } = ctx.app.fs.utils |
|
|
const { keywordTarget, keyword, limit, page, state, keys = '' } = ctx.query |
|
|
const { |
|
|
|
|
|
keywordTarget, keyword, limit, page, state, keys = '', |
|
|
|
|
|
hiredateStart, hiredateEnd, marital, native, workPlace, |
|
|
|
|
|
orderBy, orderDirection, |
|
|
|
|
|
} = ctx.query |
|
|
|
|
|
|
|
|
const userRes = await memberList({ keywordTarget, keyword, limit, page, state, nowAttendanceTime: true }) |
|
|
const userRes = await memberList({ |
|
|
|
|
|
keywordTarget, keyword, limit, page, state, |
|
|
|
|
|
hiredateStart, hiredateEnd, marital, native, workPlace, |
|
|
|
|
|
orderBy, orderDirection, |
|
|
|
|
|
nowAttendanceTime: true |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
const tableAttributes = models['Member'].tableAttributes |
|
|
const tableAttributes = models['Member'].tableAttributes |
|
|
const optionKeys = keys.split(',') |
|
|
const optionKeys = keys.split(',') |
|
@ -500,19 +510,26 @@ async function exportData (ctx) { |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
header = header.concat([{ |
|
|
|
|
|
title: '累计加班次数', |
|
|
if (optionKeys.includes('overtimeStatistic')) { |
|
|
key: 'overTimeCount', |
|
|
header = header.concat([{ |
|
|
}, { |
|
|
title: '累计加班次数', |
|
|
title: '累计加班总时长 / h', |
|
|
key: 'overTimeCount', |
|
|
key: 'overTimeDuration', |
|
|
}, { |
|
|
}, { |
|
|
title: '累计加班总时长 / h', |
|
|
title: '累计请假次数', |
|
|
key: 'overTimeDuration', |
|
|
key: 'vacateCount', |
|
|
},]) |
|
|
}, { |
|
|
} |
|
|
title: '累计请假总时长 / h', |
|
|
if (optionKeys.includes('vacateStatistic')) { |
|
|
key: 'vacateDuration', |
|
|
header = header.concat([{ |
|
|
},]) |
|
|
title: '累计请假次数', |
|
|
|
|
|
key: 'vacateCount', |
|
|
|
|
|
}, { |
|
|
|
|
|
title: '累计请假总时长 / h', |
|
|
|
|
|
key: 'vacateDuration', |
|
|
|
|
|
},]) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 查询累计加班次数及总时长
|
|
|
// 查询累计加班次数及总时长
|
|
|
const statisticOvertimeRes = await clickHouse.hr.query(` |
|
|
const statisticOvertimeRes = await clickHouse.hr.query(` |
|
|
SELECT |
|
|
SELECT |
|
|