|
@@ -281,7 +281,7 @@ module.exports = app => {
|
|
|
// }
|
|
|
// }
|
|
|
const stageInfo = await this.ctx.service.stage.getDataById(audit.sid)
|
|
|
- const shenpiUrl = await this.ctx.helper.urlToShort('http://' + this.ctx.request.header.host + '/wap/tender/' + this.ctx.tender.id + '/stage/' + stageInfo.order)
|
|
|
+ const shenpiUrl = await this.ctx.helper.urlToShort(this.ctx.protocol + '://' + this.ctx.host + '/wap/tender/' + this.ctx.tender.id + '/stage/' + stageInfo.order)
|
|
|
await this.ctx.helper.sendAliSms(audit.aid, smsTypeConst.const.JL, smsTypeConst.judge.approval.toString(), SmsAliConst.template.stage_check, {
|
|
|
qi: stageInfo.order,
|
|
|
code: shenpiUrl
|
|
@@ -295,7 +295,7 @@ module.exports = app => {
|
|
|
tips: wxConst.tips.check,
|
|
|
code: this.ctx.session.sessionProject.code,
|
|
|
};
|
|
|
- this.ctx.helper.sendWechat(audit.aid, smsTypeConst.const.JL, smsTypeConst.judge.approval.toString(), wxConst.template.stage, wechatData);
|
|
|
+ await this.ctx.helper.sendWechat(audit.aid, smsTypeConst.const.JL, smsTypeConst.judge.approval.toString(), wxConst.template.stage, wechatData);
|
|
|
|
|
|
// todo 更新标段tender状态 ?
|
|
|
await transaction.commit()
|
|
@@ -393,7 +393,7 @@ module.exports = app => {
|
|
|
// }
|
|
|
// }
|
|
|
const stageInfo = await this.ctx.service.stage.getDataById(nextAudit.sid)
|
|
|
- const shenpiUrl = await this.ctx.helper.urlToShort('http://' + this.ctx.request.header.host + '/wap/tender/' + this.ctx.tender.id + '/stage/' + stageInfo.order)
|
|
|
+ const shenpiUrl = await this.ctx.helper.urlToShort(this.ctx.protocol + '://' + this.ctx.host + '/wap/tender/' + this.ctx.tender.id + '/stage/' + stageInfo.order)
|
|
|
await this.ctx.helper.sendAliSms(nextAudit.aid, smsTypeConst.const.JL, smsTypeConst.judge.approval.toString(), SmsAliConst.template.stage_check, {
|
|
|
qi: stageInfo.order,
|
|
|
code: shenpiUrl
|
|
@@ -406,7 +406,7 @@ module.exports = app => {
|
|
|
tips: wxConst.tips.check,
|
|
|
code: this.ctx.session.sessionProject.code,
|
|
|
};
|
|
|
- this.ctx.helper.sendWechat(nextAudit.aid, smsTypeConst.const.JL, smsTypeConst.judge.approval.toString(), wxConst.template.stage, wechatData);
|
|
|
+ await this.ctx.helper.sendWechat(nextAudit.aid, smsTypeConst.const.JL, smsTypeConst.judge.approval.toString(), wxConst.template.stage, wechatData);
|
|
|
} else {
|
|
|
// 本期结束
|
|
|
// 生成截止本期数据 final数据
|
|
@@ -453,14 +453,14 @@ module.exports = app => {
|
|
|
// const content = '【纵横计量支付】' + ptmsg + '第' + stageInfo.order + '期,审批通过。';
|
|
|
// sms.send(mobile_array, content);
|
|
|
// }
|
|
|
- const users = this._.pull(this._.map(auditList, 'aid'), stageInfo.user_id)
|
|
|
+ const users = this._.uniq(this._.concat(this._.map(auditList, 'aid'), stageInfo.user_id));
|
|
|
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 shenpiUrl = await this.ctx.helper.urlToShort(this.ctx.protocol + '://' + this.ctx.host + '/wap/tender/' + this.ctx.tender.id + '/stage/' + stageInfo.order);
|
|
|
const wechatData = {
|
|
|
wap_url: shenpiUrl,
|
|
|
qi: stageInfo.order,
|
|
@@ -468,7 +468,7 @@ module.exports = app => {
|
|
|
tips: wxConst.tips.success,
|
|
|
code: this.ctx.session.sessionProject.code,
|
|
|
};
|
|
|
- this.ctx.helper.sendWechat(users, smsTypeConst.const.JL, smsTypeConst.judge.result.toString(), wxConst.template.stage, wechatData);
|
|
|
+ await this.ctx.helper.sendWechat(users, smsTypeConst.const.JL, smsTypeConst.judge.result.toString(), wxConst.template.stage, wechatData);
|
|
|
}
|
|
|
await transaction.commit()
|
|
|
} catch (err) {
|
|
@@ -586,13 +586,13 @@ module.exports = app => {
|
|
|
// const content = '【纵横计量支付】' + ptmsg + '第' + stageInfo.order + '期,审批退回。';
|
|
|
// sms.send(mobile_array, content);
|
|
|
// }
|
|
|
- const users = this._.pull(this._.map(auditList, 'aid'), stageInfo.user_id)
|
|
|
+ const users = this._.uniq(this._.concat(this._.map(auditList, 'aid'), stageInfo.user_id));
|
|
|
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 shenpiUrl = await this.ctx.helper.urlToShort(this.ctx.protocol + '://' + this.ctx.host + '/wap/tender/' + this.ctx.tender.id + '/stage/' + stageInfo.order)
|
|
|
const wechatData = {
|
|
|
wap_url: shenpiUrl,
|
|
|
qi: stageInfo.order,
|
|
@@ -600,7 +600,7 @@ module.exports = app => {
|
|
|
tips: wxConst.tips.back,
|
|
|
code: this.ctx.session.sessionProject.code,
|
|
|
};
|
|
|
- this.ctx.helper.sendWechat(users, smsTypeConst.const.JL, smsTypeConst.judge.result.toString(), wxConst.template.stage, wechatData);
|
|
|
+ await this.ctx.helper.sendWechat(users, smsTypeConst.const.JL, smsTypeConst.judge.result.toString(), wxConst.template.stage, wechatData);
|
|
|
|
|
|
await transaction.commit()
|
|
|
} catch (err) {
|
|
@@ -736,7 +736,7 @@ module.exports = app => {
|
|
|
// }
|
|
|
// }
|
|
|
const stageInfo = await this.ctx.service.stage.getDataById(audit.sid)
|
|
|
- const shenpiUrl = await this.ctx.helper.urlToShort('http://' + this.ctx.request.header.host + '/wap/tender/' + this.ctx.tender.id + '/stage/' + stageInfo.order)
|
|
|
+ const shenpiUrl = await this.ctx.helper.urlToShort(this.ctx.protocol + '://' + this.ctx.host + '/wap/tender/' + this.ctx.tender.id + '/stage/' + stageInfo.order)
|
|
|
await this.ctx.helper.sendAliSms(preAuditor.aid, smsTypeConst.const.JL, smsTypeConst.judge.approval.toString(), SmsAliConst.template.stage_check, {
|
|
|
qi: stageInfo.order,
|
|
|
code: shenpiUrl
|
|
@@ -749,7 +749,7 @@ module.exports = app => {
|
|
|
tips: wxConst.tips.check,
|
|
|
code: this.ctx.session.sessionProject.code,
|
|
|
};
|
|
|
- this.ctx.helper.sendWechat(preAuditor.aid, smsTypeConst.const.JL, smsTypeConst.judge.approval.toString(), wxConst.template.stage, wechatData);
|
|
|
+ await this.ctx.helper.sendWechat(preAuditor.aid, smsTypeConst.const.JL, smsTypeConst.judge.approval.toString(), wxConst.template.stage, wechatData);
|
|
|
|
|
|
await transaction.commit()
|
|
|
} catch (err) {
|
|
@@ -872,7 +872,7 @@ module.exports = app => {
|
|
|
// }
|
|
|
// }
|
|
|
const stageInfo = await this.ctx.service.stage.getDataById(audit.sid)
|
|
|
- const shenpiUrl = await this.ctx.helper.urlToShort('http://' + this.ctx.request.header.host + '/wap/tender/' + this.ctx.tender.id + '/stage/' + stageInfo.order)
|
|
|
+ const shenpiUrl = await this.ctx.helper.urlToShort(this.ctx.protocol + '://' + this.ctx.host + '/wap/tender/' + this.ctx.tender.id + '/stage/' + stageInfo.order)
|
|
|
await this.ctx.helper.sendAliSms(audit.aid, smsTypeConst.const.JL, smsTypeConst.judge.approval.toString(), SmsAliConst.template.stage_check, {
|
|
|
qi: stageInfo.order,
|
|
|
code: shenpiUrl
|
|
@@ -885,7 +885,7 @@ module.exports = app => {
|
|
|
tips: wxConst.tips.check,
|
|
|
code: this.ctx.session.sessionProject.code,
|
|
|
};
|
|
|
- this.ctx.helper.sendWechat(audit.aid, smsTypeConst.const.JL, smsTypeConst.judge.approval.toString(), wxConst.template.stage, wechatData);
|
|
|
+ await this.ctx.helper.sendWechat(audit.aid, smsTypeConst.const.JL, smsTypeConst.judge.approval.toString(), wxConst.template.stage, wechatData);
|
|
|
|
|
|
await transaction.commit()
|
|
|
} catch (err) {
|