|
|
@ -147,6 +147,26 @@ async function exportOvertimeStatistic (ctx) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
async function vacateType (ctx) { |
|
|
|
try { |
|
|
|
const { models } = ctx.fs.dc; |
|
|
|
const { clickHouse } = ctx.app.fs |
|
|
|
|
|
|
|
const vacateTypeRes = await clickHouse.hr.query(` |
|
|
|
SELECT type FROM vacate GROUP BY type ORDER BY type DESC |
|
|
|
`).toPromise()
|
|
|
|
|
|
|
|
ctx.status = 200; |
|
|
|
ctx.body = vacateTypeRes |
|
|
|
} catch (error) { |
|
|
|
ctx.fs.logger.error(`path: ${ctx.path}, error: error`); |
|
|
|
ctx.status = 400; |
|
|
|
ctx.body = { |
|
|
|
message: typeof error == 'string' ? error : undefined |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
async function vacateStatistic (ctx) { |
|
|
|
try { |
|
|
|
const { models } = ctx.fs.dc; |
|
|
@ -290,6 +310,7 @@ async function exportVacateStatistic (ctx) { |
|
|
|
module.exports = { |
|
|
|
overtimeStatistic, |
|
|
|
exportOvertimeStatistic, |
|
|
|
vacateType, |
|
|
|
vacateStatistic, |
|
|
|
exportVacateStatistic, |
|
|
|
}; |