You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
'use strict';
|
|
|
|
const moment = require('moment')
|
|
|
|
|
|
|
|
async function getEnabledWorkflowProcess (ctx) {
|
|
|
|
try {
|
|
|
|
const { models } = ctx.fs.dc;
|
|
|
|
const { clickHouse } = ctx.app.fs
|
|
|
|
|
|
|
|
const listRes = await clickHouse.pepEmis.query(`
|
|
|
|
SELECT
|
|
|
|
workflow_process.id AS id,
|
|
|
|
workflow_process.name AS name,
|
|
|
|
workflow_process.create_time AS createTime,
|
|
|
|
workflow_process.update_time AS updateTime,
|
|
|
|
workflow_group.name AS group
|
|
|
|
FROM
|
|
|
|
workflow_process
|
|
|
|
RIGHT JOIN workflow_group
|
|
|
|
ON workflow_process.group_id = workflow_group.id
|
|
|
|
AND workflow_group.name = '竞聘考核'
|
|
|
|
WHERE
|
|
|
|
workflow_process.deleted = 0
|
|
|
|
AND workflow_process.is_enable = 1
|
|
|
|
`).toPromise()
|
|
|
|
|
|
|
|
ctx.status = 200;
|
|
|
|
ctx.body = listRes
|
|
|
|
} catch (error) {
|
|
|
|
ctx.fs.logger.error(`path: ${ctx.path}, error: error`);
|
|
|
|
ctx.status = 400;
|
|
|
|
ctx.body = {
|
|
|
|
message: typeof error == 'string' ? error : undefined
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
getEnabledWorkflowProcess
|
|
|
|
};
|