修改邮件标题, 修改流程结束的通知消息格式
This commit is contained in:
parent
d139648733
commit
bf6d24b6a2
@ -112,7 +112,8 @@ export class ChainTaskClass extends BaseModule {
|
|||||||
await record.save()
|
await record.save()
|
||||||
if (record.allEnd) {
|
if (record.allEnd) {
|
||||||
setImmediate(async function () {
|
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
|
record.notify = result
|
||||||
await record.save()
|
await record.save()
|
||||||
})
|
})
|
||||||
|
@ -37,7 +37,7 @@ export class MailQueue {
|
|||||||
let link2 = `${process.env.WEB_BASE_URL}/pages/confirm.html?id=${task.id}`
|
let link2 = `${process.env.WEB_BASE_URL}/pages/confirm.html?id=${task.id}`
|
||||||
html = html.replace('{{link2}}', link2)
|
html = html.replace('{{link2}}', link2)
|
||||||
let subject = `${task.starterName} 申请 ${task.name}`
|
let subject = `${task.starterName} 申请 ${task.name}`
|
||||||
let data: any = { html }
|
let data: any = { html, subject }
|
||||||
Object(DEFAULT_MSG_DATA).zssign(data)
|
Object(DEFAULT_MSG_DATA).zssign(data)
|
||||||
let deferred = new Deferred()
|
let deferred = new Deferred()
|
||||||
this.queue.push(async () => {
|
this.queue.push(async () => {
|
||||||
|
@ -34,13 +34,13 @@ export class TaskSvr {
|
|||||||
new ExecQueue().addTaskToQueue(record)
|
new ExecQueue().addTaskToQueue(record)
|
||||||
}
|
}
|
||||||
|
|
||||||
public async sendResultNotify(task: DocumentType<ChainTaskClass>) {
|
public async sendResultNotify(task: DocumentType<ChainTaskClass>, desc: string) {
|
||||||
let userid = task.starter
|
let userid = task.starter
|
||||||
let timeStr = new Date(task.endTime).format('yyyy-MM-dd HH:mm:ss')
|
let timeStr = new Date(task.endTime).format('yyyy-MM-dd HH:mm:ss')
|
||||||
return new WechatWorkService().beginApproval({
|
return new WechatWorkService().beginApproval({
|
||||||
userid,
|
userid,
|
||||||
title: `${task.starterName}-${task.name}`,
|
title: `${task.starterName}-${task.name}`,
|
||||||
desc: task.desc,
|
desc,
|
||||||
info: timeStr,
|
info: timeStr,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user