|
@@ -16,6 +16,7 @@ const wxConst = require('../const/wechat_template');
|
|
|
const shenpiConst = require('../const/shenpi');
|
|
|
const payConst = require('../const/deal_pay');
|
|
|
const pushType = require('../const/audit').pushType;
|
|
|
+const syncApiConst = require('../const/sync_api');
|
|
|
|
|
|
module.exports = app => {
|
|
|
class StageAudit extends app.BaseService {
|
|
@@ -335,6 +336,18 @@ module.exports = app => {
|
|
|
|
|
|
// todo 更新标段tender状态 ?
|
|
|
await transaction.commit();
|
|
|
+ // 通知发送 - 第三方更新
|
|
|
+ if (this.ctx.session.sessionProject.custom && syncApiConst.notice_type.indexOf(this.ctx.session.sessionProject.customType) !== -1) {
|
|
|
+ const base_data = {
|
|
|
+ tid: this.ctx.tender.id,
|
|
|
+ sid: stageId,
|
|
|
+ op: 'update',
|
|
|
+ };
|
|
|
+ this.ctx.helper.syncNoticeSend(this.ctx.session.sessionProject.customType, JSON.stringify(base_data));
|
|
|
+ base_data.op = 'update';
|
|
|
+ base_data.sid = -1;
|
|
|
+ this.ctx.helper.syncNoticeSend(this.ctx.session.sessionProject.customType, JSON.stringify(base_data));
|
|
|
+ }
|
|
|
} catch (err) {
|
|
|
await transaction.rollback();
|
|
|
throw err;
|
|
@@ -832,6 +845,18 @@ module.exports = app => {
|
|
|
default:
|
|
|
throw '无效审批操作';
|
|
|
}
|
|
|
+ // 通知发送 - 第三方更新
|
|
|
+ if (this.ctx.session.sessionProject.custom && syncApiConst.notice_type.indexOf(this.ctx.session.sessionProject.customType) !== -1) {
|
|
|
+ const base_data = {
|
|
|
+ tid: this.ctx.tender.id,
|
|
|
+ sid: stageId,
|
|
|
+ op: 'update',
|
|
|
+ };
|
|
|
+ this.ctx.helper.syncNoticeSend(this.ctx.session.sessionProject.customType, JSON.stringify(base_data));
|
|
|
+ base_data.op = 'update';
|
|
|
+ base_data.sid = -1;
|
|
|
+ this.ctx.helper.syncNoticeSend(this.ctx.session.sessionProject.customType, JSON.stringify(base_data));
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -932,6 +957,18 @@ module.exports = app => {
|
|
|
await this.ctx.helper.sendWechat(audit.aid, smsTypeConst.const.JL, smsTypeConst.judge.approval.toString(), wxConst.template.stage, wechatData);
|
|
|
|
|
|
await transaction.commit();
|
|
|
+ // 通知发送 - 第三方更新
|
|
|
+ if (this.ctx.session.sessionProject.custom && syncApiConst.notice_type.indexOf(this.ctx.session.sessionProject.customType) !== -1) {
|
|
|
+ const base_data = {
|
|
|
+ tid: this.ctx.tender.id,
|
|
|
+ sid: stageId,
|
|
|
+ op: 'update',
|
|
|
+ };
|
|
|
+ this.ctx.helper.syncNoticeSend(this.ctx.session.sessionProject.customType, JSON.stringify(base_data));
|
|
|
+ base_data.op = 'update';
|
|
|
+ base_data.sid = -1;
|
|
|
+ this.ctx.helper.syncNoticeSend(this.ctx.session.sessionProject.customType, JSON.stringify(base_data));
|
|
|
+ }
|
|
|
} catch (err) {
|
|
|
await transaction.rollback();
|
|
|
throw err;
|
|
@@ -1258,6 +1295,18 @@ module.exports = app => {
|
|
|
cache_time_r: time,
|
|
|
});
|
|
|
await transaction.commit();
|
|
|
+ // 通知发送 - 第三方更新
|
|
|
+ if (this.ctx.session.sessionProject.custom && syncApiConst.notice_type.indexOf(this.ctx.session.sessionProject.customType) !== -1) {
|
|
|
+ const base_data = {
|
|
|
+ tid: this.ctx.tender.id,
|
|
|
+ sid: this.ctx.stage.id,
|
|
|
+ op: 'update',
|
|
|
+ };
|
|
|
+ this.ctx.helper.syncNoticeSend(this.ctx.session.sessionProject.customType, JSON.stringify(base_data));
|
|
|
+ base_data.op = 'update';
|
|
|
+ base_data.sid = -1;
|
|
|
+ this.ctx.helper.syncNoticeSend(this.ctx.session.sessionProject.customType, JSON.stringify(base_data));
|
|
|
+ }
|
|
|
} catch (err) {
|
|
|
await transaction.rollback();
|
|
|
throw err;
|