修改邮件标题, 修改流程结束的通知消息格式

This commit is contained in:
zhl 2023-04-25 19:35:51 +08:00
parent d139648733
commit bf6d24b6a2
3 changed files with 5 additions and 4 deletions

View File

@ -112,7 +112,8 @@ export class ChainTaskClass extends BaseModule {
await record.save()
if (record.allEnd) {
setImmediate(async function () {
let result = new TaskSvr().sendResultNotify(record)
let desc = `总数: ${record.tasks.length}, 成功: ${sCount}, 失败: ${errCount}`
let result = new TaskSvr().sendResultNotify(record, desc)
record.notify = result
await record.save()
})

View File

@ -37,7 +37,7 @@ export class MailQueue {
let link2 = `${process.env.WEB_BASE_URL}/pages/confirm.html?id=${task.id}`
html = html.replace('{{link2}}', link2)
let subject = `${task.starterName} 申请 ${task.name}`
let data: any = { html }
let data: any = { html, subject }
Object(DEFAULT_MSG_DATA).zssign(data)
let deferred = new Deferred()
this.queue.push(async () => {

View File

@ -34,13 +34,13 @@ export class TaskSvr {
new ExecQueue().addTaskToQueue(record)
}
public async sendResultNotify(task: DocumentType<ChainTaskClass>) {
public async sendResultNotify(task: DocumentType<ChainTaskClass>, desc: string) {
let userid = task.starter
let timeStr = new Date(task.endTime).format('yyyy-MM-dd HH:mm:ss')
return new WechatWorkService().beginApproval({
userid,
title: `${task.starterName}-${task.name}`,
desc: task.desc,
desc,
info: timeStr,
})
}