|
@@ -12,6 +12,7 @@ const auditConst = require('../const/audit').stage
|
|
|
const smsTypeConst = require('../const/sms_type')
|
|
|
const SMS = require('../lib/sms')
|
|
|
const SmsAliConst = require('../const/sms_alitemplate')
|
|
|
+const wxConst = require('../const/wechat_template')
|
|
|
const payConst = require('../const/deal_pay')
|
|
|
const pushType = require('../const/audit').pushType
|
|
|
|
|
@@ -284,7 +285,17 @@ module.exports = app => {
|
|
|
await this.ctx.helper.sendAliSms(audit.aid, smsTypeConst.const.JL, smsTypeConst.judge.approval.toString(), SmsAliConst.template.stage_check, {
|
|
|
qi: stageInfo.order,
|
|
|
code: shenpiUrl
|
|
|
- })
|
|
|
+ });
|
|
|
+
|
|
|
+ // 微信模板通知
|
|
|
+ const wechatData = {
|
|
|
+ wap_url: shenpiUrl,
|
|
|
+ qi: stageInfo.order,
|
|
|
+ status: wxConst.status.check,
|
|
|
+ tips: wxConst.tips.check,
|
|
|
+ code: this.session.sessionProject.code,
|
|
|
+ };
|
|
|
+ this.ctx.helper.sendWechat(audit.aid, smsTypeConst.const.JL, smsTypeConst.judge.approval.toString(), wxConst.template.stage, wechatData);
|
|
|
|
|
|
// todo 更新标段tender状态 ?
|
|
|
await transaction.commit()
|
|
@@ -386,7 +397,16 @@ module.exports = app => {
|
|
|
await this.ctx.helper.sendAliSms(nextAudit.aid, smsTypeConst.const.JL, smsTypeConst.judge.approval.toString(), SmsAliConst.template.stage_check, {
|
|
|
qi: stageInfo.order,
|
|
|
code: shenpiUrl
|
|
|
- })
|
|
|
+ });
|
|
|
+ // 微信模板通知
|
|
|
+ const wechatData = {
|
|
|
+ wap_url: shenpiUrl,
|
|
|
+ qi: stageInfo.order,
|
|
|
+ status: wxConst.status.check,
|
|
|
+ tips: wxConst.tips.check,
|
|
|
+ code: this.session.sessionProject.code,
|
|
|
+ };
|
|
|
+ this.ctx.helper.sendWechat(nextAudit.aid, smsTypeConst.const.JL, smsTypeConst.judge.approval.toString(), wxConst.template.stage, wechatData);
|
|
|
} else {
|
|
|
// 本期结束
|
|
|
// 生成截止本期数据 final数据
|
|
@@ -437,7 +457,18 @@ module.exports = app => {
|
|
|
await this.ctx.helper.sendAliSms(users, smsTypeConst.const.JL, smsTypeConst.judge.result.toString(), SmsAliConst.template.stage_result, {
|
|
|
qi: stageInfo.order,
|
|
|
status: SmsAliConst.status.success
|
|
|
- })
|
|
|
+ });
|
|
|
+
|
|
|
+ // 微信模板通知
|
|
|
+ const shenpiUrl = await this.ctx.helper.urlToShort('http://' + this.ctx.request.header.host + '/wap/tender/' + this.ctx.tender.id + '/stage/' + stageInfo.order)
|
|
|
+ const wechatData = {
|
|
|
+ wap_url: shenpiUrl,
|
|
|
+ qi: stageInfo.order,
|
|
|
+ status: wxConst.status.success,
|
|
|
+ tips: wxConst.tips.success,
|
|
|
+ code: this.session.sessionProject.code,
|
|
|
+ };
|
|
|
+ this.ctx.helper.sendWechat(users, smsTypeConst.const.JL, smsTypeConst.judge.result.toString(), wxConst.template.stage, wechatData);
|
|
|
}
|
|
|
await transaction.commit()
|
|
|
} catch (err) {
|
|
@@ -559,7 +590,18 @@ module.exports = app => {
|
|
|
await this.ctx.helper.sendAliSms(users, smsTypeConst.const.JL, smsTypeConst.judge.result.toString(), SmsAliConst.template.stage_result, {
|
|
|
qi: stageInfo.order,
|
|
|
status: SmsAliConst.status.back
|
|
|
- })
|
|
|
+ });
|
|
|
+ // 微信模板通知
|
|
|
+ const shenpiUrl = await this.ctx.helper.urlToShort('http://' + this.ctx.request.header.host + '/wap/tender/' + this.ctx.tender.id + '/stage/' + stageInfo.order)
|
|
|
+ const wechatData = {
|
|
|
+ wap_url: shenpiUrl,
|
|
|
+ qi: stageInfo.order,
|
|
|
+ status: wxConst.status.back,
|
|
|
+ tips: wxConst.tips.back,
|
|
|
+ code: this.session.sessionProject.code,
|
|
|
+ };
|
|
|
+ this.ctx.helper.sendWechat(users, smsTypeConst.const.JL, smsTypeConst.judge.result.toString(), wxConst.template.stage, wechatData);
|
|
|
+
|
|
|
await transaction.commit()
|
|
|
} catch (err) {
|
|
|
await transaction.rollback()
|
|
@@ -698,7 +740,16 @@ module.exports = app => {
|
|
|
await this.ctx.helper.sendAliSms(preAuditor.aid, smsTypeConst.const.JL, smsTypeConst.judge.approval.toString(), SmsAliConst.template.stage_check, {
|
|
|
qi: stageInfo.order,
|
|
|
code: shenpiUrl
|
|
|
- })
|
|
|
+ });
|
|
|
+ // 微信模板通知
|
|
|
+ const wechatData = {
|
|
|
+ wap_url: shenpiUrl,
|
|
|
+ qi: stageInfo.order,
|
|
|
+ status: wxConst.status.check,
|
|
|
+ tips: wxConst.tips.check,
|
|
|
+ code: this.session.sessionProject.code,
|
|
|
+ };
|
|
|
+ this.ctx.helper.sendWechat(preAuditor.aid, smsTypeConst.const.JL, smsTypeConst.judge.approval.toString(), wxConst.template.stage, wechatData);
|
|
|
|
|
|
await transaction.commit()
|
|
|
} catch (err) {
|
|
@@ -825,7 +876,17 @@ module.exports = app => {
|
|
|
await this.ctx.helper.sendAliSms(audit.aid, smsTypeConst.const.JL, smsTypeConst.judge.approval.toString(), SmsAliConst.template.stage_check, {
|
|
|
qi: stageInfo.order,
|
|
|
code: shenpiUrl
|
|
|
- })
|
|
|
+ });
|
|
|
+ // 微信模板通知
|
|
|
+ const wechatData = {
|
|
|
+ wap_url: shenpiUrl,
|
|
|
+ qi: stageInfo.order,
|
|
|
+ status: wxConst.status.check,
|
|
|
+ tips: wxConst.tips.check,
|
|
|
+ code: this.session.sessionProject.code,
|
|
|
+ };
|
|
|
+ this.ctx.helper.sendWechat(audit.aid, smsTypeConst.const.JL, smsTypeConst.judge.approval.toString(), wxConst.template.stage, wechatData);
|
|
|
+
|
|
|
await transaction.commit()
|
|
|
} catch (err) {
|
|
|
await transaction.rollback()
|