Browse Source

修复修订和调差审批通知bug

laiguoran 4 years ago
parent
commit
41152b6b58
2 changed files with 6 additions and 3 deletions
  1. 2 2
      app/service/material_audit.js
  2. 4 1
      app/service/revise_audit.js

+ 2 - 2
app/service/material_audit.js

@@ -316,7 +316,7 @@ module.exports = app => {
                         m_tp: this.ctx.helper.round(materialInfo.m_tp, 2),
                         hs_m_tp: this.ctx.helper.round(this.ctx.helper.mul(materialInfo.m_tp, 1+materialInfo.rate/100), 2),
                     };
-                    await this.ctx.helper.sendWechat(nextAudit.id, smsTypeConst.const.TC, smsTypeConst.judge.approval.toString(), wxConst.template.material, wechatData);
+                    await this.ctx.helper.sendWechat(nextAudit.aid, smsTypeConst.const.TC, smsTypeConst.judge.approval.toString(), wxConst.template.material, wechatData);
 
 
                     // 添加短信通知-需要审批提醒功能
@@ -543,7 +543,7 @@ module.exports = app => {
                     m_tp: this.ctx.helper.round(materialInfo.m_tp, 2),
                     hs_m_tp: this.ctx.helper.round(this.ctx.helper.mul(materialInfo.m_tp, 1+materialInfo.rate/100), 2),
                 };
-                await this.ctx.helper.sendWechat(audit.aid, smsTypeConst.const.TC, smsTypeConst.judge.approval.toString(), wxConst.template.material, wechatData);
+                await this.ctx.helper.sendWechat(preAuditor.aid, smsTypeConst.const.TC, smsTypeConst.judge.approval.toString(), wxConst.template.material, wechatData);
 
                 await transaction.insert(this.tableName, newAuditors);
                 await transaction.commit();

+ 4 - 1
app/service/revise_audit.js

@@ -386,7 +386,7 @@ module.exports = app => {
                         await this.ctx.helper.sendWechat(nextAudit.audit_id, smsTypeConst.const.XD, smsTypeConst.judge.approval.toString(), wxConst.template.revise, wechatData);
                         // 其他参与人
                         const users = this._.pull(this._.map(auditList, 'audit_id'), audit.audit_id);
-                        // users.push(revise.uid);
+                        users.push(revise.uid);
                         // await this.ctx.helper.sendUserSms(users, smsTypeConst.const.XD,
                         //     smsTypeConst.judge.result.toString(), '台账修订审批通过。');
                         await this.ctx.helper.sendAliSms(users, smsTypeConst.const.XD, smsTypeConst.judge.result.toString(), SmsAliConst.template.revise_result2, {
@@ -441,6 +441,9 @@ module.exports = app => {
                         await this.ctx.helper.sendAliSms(users, smsTypeConst.const.XD, smsTypeConst.judge.result.toString(), SmsAliConst.template.revise_result2, {
                             status: SmsAliConst.status.success,
                         });
+
+                        users.push(revise.uid);
+
                         // 微信模板通知
                         const wechatData2 = {
                             status: wxConst.status.success,