Browse Source

导出文件名称

master
巴林闲侠 2 years ago
parent
commit
1da68170b7
  1. 4
      api/app/lib/controllers/attendance/index.js
  2. 2
      api/app/lib/schedule/attendance.js

4
api/app/lib/controllers/attendance/index.js

@ -130,7 +130,7 @@ async function exportOvertimeStatistic (ctx) {
.concat(overtimeTypeHeader)
.concat(sumOvertimeTypeHeader)
const fileName = `加班统计_${startDate ? moment(startDate).format('YYYY-MM-DD') : ''}-${endDate ? moment(endDate).format('YYYY-MM-DD') : ''}_${moment().format('YYYYMMDDHHmmss')}` + '.csv'
const fileName = `加班统计_${startDate ? moment(startDate).format('YYYY-MM-DD') : ''}${startDate && endDate ? '-' : ''}${endDate ? moment(endDate).format('YYYY-MM-DD') : ''}${startDate || endDate ? '_' : ''}${moment().format('YYYYMMDDHHmmss')}` + '.csv'
const filePath = await simpleExcelDown({ data: returnD, header, fileName: fileName })
const fileData = fs.readFileSync(filePath);
@ -151,7 +151,7 @@ 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()

2
api/app/lib/schedule/attendance.js

@ -8,7 +8,7 @@ module.exports = function (app, opts) {
// interval: '34 21 4 * * *',
interval: '34 */15 * * * *',
immediate: true,
// proRun: true,
proRun: true,
},
async () => {
console.info('假勤数据更新 ', moment().format('YYYY-MM-DD HH:mm:ss'));

Loading…
Cancel
Save