Browse Source

fix: 台账审批bug

lanjianrong 4 years ago
parent
commit
7d42c8040a
1 changed files with 3 additions and 7 deletions
  1. 3 7
      app/service/ledger_audit.js

+ 3 - 7
app/service/ledger_audit.js

@@ -252,12 +252,11 @@ module.exports = app => {
 
                 // 获取审核人列表
                 const auditList = await this.getAuditors(tenderId, times);
-
                 // 添加推送
-                const noticeContent = await this.getNoticeContent(audit.tender_id, pid, audit.aid)
+                const noticeContent = await this.getNoticeContent(audit.tender_id, pid, audit.audit_id)
                 const records = [{ pid, type: pushType.ledger, uid: this.ctx.tender.data.user_id, status: auditConst.status.checked, content: noticeContent }]
                 auditList.forEach( audit => {
-                    records.push({ pid, type: pushType.ledger, uid: audit.aid, status: auditConst.status.checked, content: noticeContent })
+                    records.push({ pid, type: pushType.ledger, uid: audit.audit_id, status: auditConst.status.checked, content: noticeContent })
                 })
                 await transaction.insert('zh_notice', records);
                 // 更新当前审核流程
@@ -308,9 +307,6 @@ module.exports = app => {
                         //     smsTypeConst.judge.result.toString(), '台账审批通过,请登录系统处理。');
                         await this.ctx.helper.sendAliSms(users, smsTypeConst.const.TZ,
                             smsTypeConst.judge.result.toString(), SmsAliConst.template.ledger_result, { status: SmsAliConst.status.success });
-                        // 添加到消息推送表
-                        const noticeContent = await this.getNoticeContent(audit.tender_id, pid)
-                        await transaction.insert('zh_notice', { pid, type: pushType.ledger, uid: this.ctx.tender.data.user_id, status: auditConst.status.checked, is_read: 0, content: noticeContent });
                     }
                 } else {
                     // 同步标段信息
@@ -418,7 +414,7 @@ module.exports = app => {
 
         /**
          * 用于添加推送所需的content内容
-         * @param {Number} id 台账id
+         * @param {Number} id  标段id
          * @param {Number} pid 项目id
          * @param {Number} uid 审核人id
          */