Browse Source

方案通知增加url

laiguoran 3 years ago
parent
commit
07013b213f
1 changed files with 16 additions and 0 deletions
  1. 16 0
      app/service/change_plan_audit.js

+ 16 - 0
app/service/change_plan_audit.js

@@ -271,8 +271,12 @@ module.exports = app => {
                     id: cpId, status: auditConst.status.checking,
                     id: cpId, status: auditConst.status.checking,
                 });
                 });
                 // 微信模板通知
                 // 微信模板通知
+                const shenpiUrl = await this.ctx.helper.urlToShort(
+                    this.ctx.protocol + '://' + this.ctx.host + '/wap/tender/' + this.ctx.tender.id + '/change/plan/' + cpId + '/info#shenpi'
+                );
                 const wechatData = {
                 const wechatData = {
                     type: 'plan',
                     type: 'plan',
+                    wap_url: shenpiUrl,
                     status: wxConst.status.check,
                     status: wxConst.status.check,
                     tips: wxConst.tips.check,
                     tips: wxConst.tips.check,
                     code: this.ctx.session.sessionProject.code,
                     code: this.ctx.session.sessionProject.code,
@@ -394,8 +398,12 @@ module.exports = app => {
                     });
                     });
 
 
                     // 微信模板通知
                     // 微信模板通知
+                    const shenpiUrl = await this.ctx.helper.urlToShort(
+                        this.ctx.protocol + '://' + this.ctx.host + '/wap/tender/' + this.ctx.tender.id + '/change/plan/' + cpId + '/info#shenpi'
+                    );
                     const wechatData = {
                     const wechatData = {
                         type: 'plan',
                         type: 'plan',
+                        wap_url: shenpiUrl,
                         status: wxConst.status.check,
                         status: wxConst.status.check,
                         tips: wxConst.tips.check,
                         tips: wxConst.tips.check,
                         code: this.ctx.session.sessionProject.code,
                         code: this.ctx.session.sessionProject.code,
@@ -413,8 +421,12 @@ module.exports = app => {
 
 
                     // 微信模板通知
                     // 微信模板通知
                     const users = this._.uniq(this._.concat(this._.map(auditors, 'aid'), this.ctx.change.uid));
                     const users = this._.uniq(this._.concat(this._.map(auditors, 'aid'), this.ctx.change.uid));
+                    const shenpiUrl = await this.ctx.helper.urlToShort(
+                        this.ctx.protocol + '://' + this.ctx.host + '/wap/tender/' + this.ctx.tender.id + '/change/plan/' + cpId + '/info#shenpi'
+                    );
                     const wechatData = {
                     const wechatData = {
                         type: 'plan',
                         type: 'plan',
+                        wap_url: shenpiUrl,
                         status: wxConst.status.success,
                         status: wxConst.status.success,
                         tips: wxConst.tips.success,
                         tips: wxConst.tips.success,
                         code: this.ctx.session.sessionProject.code,
                         code: this.ctx.session.sessionProject.code,
@@ -467,8 +479,12 @@ module.exports = app => {
                 await this.ctx.service.changePlanList.delAuditAmount(transaction, cpId);
                 await this.ctx.service.changePlanList.delAuditAmount(transaction, cpId);
                 // 微信模板通知
                 // 微信模板通知
                 const users = this._.uniq(this._.concat(this._.map(auditors, 'aid'), this.ctx.change.uid));
                 const users = this._.uniq(this._.concat(this._.map(auditors, 'aid'), this.ctx.change.uid));
+                const shenpiUrl = await this.ctx.helper.urlToShort(
+                    this.ctx.protocol + '://' + this.ctx.host + '/wap/tender/' + this.ctx.tender.id + '/change/plan/' + cpId + '/info#shenpi'
+                );
                 const wechatData = {
                 const wechatData = {
                     type: 'plan',
                     type: 'plan',
+                    wap_url: shenpiUrl,
                     status: wxConst.status.back,
                     status: wxConst.status.back,
                     tips: wxConst.tips.back,
                     tips: wxConst.tips.back,
                     code: this.ctx.session.sessionProject.code,
                     code: this.ctx.session.sessionProject.code,