|
@@ -267,9 +267,14 @@ module.exports = app => {
|
|
// smsTypeConst.judge.approval.toString(), '台账修订需要您审批,请登录系统处理。');
|
|
// smsTypeConst.judge.approval.toString(), '台账修订需要您审批,请登录系统处理。');
|
|
await this.ctx.helper.sendAliSms(audit.audit_id, smsTypeConst.const.XD, smsTypeConst.judge.approval.toString(), SmsAliConst.template.revise_check);
|
|
await this.ctx.helper.sendAliSms(audit.audit_id, smsTypeConst.const.XD, smsTypeConst.judge.approval.toString(), SmsAliConst.template.revise_check);
|
|
// 微信模板通知
|
|
// 微信模板通知
|
|
|
|
+ const shenpiUrl = await this.ctx.helper.urlToShort(
|
|
|
|
+ this.ctx.protocol + '://' + this.ctx.host + '/wap/tender/' + revise.tid + '/revise/' + revise.id + '/info'
|
|
|
|
+ );
|
|
const wechatData = {
|
|
const wechatData = {
|
|
|
|
+ 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,
|
|
begin_time: Date.parse(time),
|
|
begin_time: Date.parse(time),
|
|
};
|
|
};
|
|
await this.ctx.helper.sendWechat(audit.audit_id, smsTypeConst.const.XD, smsTypeConst.judge.approval.toString(), wxConst.template.revise, wechatData);
|
|
await this.ctx.helper.sendWechat(audit.audit_id, smsTypeConst.const.XD, smsTypeConst.judge.approval.toString(), wxConst.template.revise, wechatData);
|
|
@@ -281,9 +286,11 @@ module.exports = app => {
|
|
await this.ctx.helper.sendAliSms(users, smsTypeConst.const.XD, smsTypeConst.judge.result.toString(), SmsAliConst.template.revise_report);
|
|
await this.ctx.helper.sendAliSms(users, smsTypeConst.const.XD, smsTypeConst.judge.result.toString(), SmsAliConst.template.revise_report);
|
|
// 微信模板通知
|
|
// 微信模板通知
|
|
const wechatData2 = {
|
|
const wechatData2 = {
|
|
|
|
+ wap_url: shenpiUrl,
|
|
status: wxConst.status.report,
|
|
status: wxConst.status.report,
|
|
tips: wxConst.tips.report,
|
|
tips: wxConst.tips.report,
|
|
begin_time: Date.parse(time),
|
|
begin_time: Date.parse(time),
|
|
|
|
+ code: this.ctx.session.sessionProject.code,
|
|
};
|
|
};
|
|
await this.ctx.helper.sendWechat(users, smsTypeConst.const.XD, smsTypeConst.judge.result.toString(), wxConst.template.revise, wechatData2);
|
|
await this.ctx.helper.sendWechat(users, smsTypeConst.const.XD, smsTypeConst.judge.result.toString(), wxConst.template.revise, wechatData2);
|
|
await transaction.commit();
|
|
await transaction.commit();
|
|
@@ -304,12 +311,12 @@ module.exports = app => {
|
|
' quantity, total_price, unit_price, drawing_code, memo, dgn_qty1, dgn_qty2, deal_qty, deal_tp,' +
|
|
' quantity, total_price, unit_price, drawing_code, memo, dgn_qty1, dgn_qty2, deal_qty, deal_tp,' +
|
|
' sgfh_qty, sgfh_tp, sjcl_qty, sjcl_tp, qtcl_qty, qtcl_tp, node_type, crid, tender_id, is_tp,' +
|
|
' sgfh_qty, sgfh_tp, sjcl_qty, sjcl_tp, qtcl_qty, qtcl_tp, node_type, crid, tender_id, is_tp,' +
|
|
' sgfh_expr, sjcl_expr, qtcl_expr, check_calc,' +
|
|
' sgfh_expr, sjcl_expr, qtcl_expr, check_calc,' +
|
|
- ' gxby_status, dagl_status, dagl_url, gxby_limit, gxby_ratio, dagl_limit, dagl_ratio)' +
|
|
|
|
|
|
+ ' gxby_status, dagl_status, dagl_url, gxby_limit, dagl_limit)' +
|
|
' Select id, code, b_code, name, unit, source, remark, ledger_id, ledger_pid, level, `order`, full_path, is_leaf,' +
|
|
' Select id, code, b_code, name, unit, source, remark, ledger_id, ledger_pid, level, `order`, full_path, is_leaf,' +
|
|
' quantity, total_price, unit_price, drawing_code, memo, dgn_qty1, dgn_qty2, deal_qty, deal_tp,' +
|
|
' quantity, total_price, unit_price, drawing_code, memo, dgn_qty1, dgn_qty2, deal_qty, deal_tp,' +
|
|
' sgfh_qty, sgfh_tp, sjcl_qty, sjcl_tp, qtcl_qty, qtcl_tp, node_type, crid, tender_id, is_tp, ' +
|
|
' sgfh_qty, sgfh_tp, sjcl_qty, sjcl_tp, qtcl_qty, qtcl_tp, node_type, crid, tender_id, is_tp, ' +
|
|
' sgfh_expr, sjcl_expr, qtcl_expr, check_calc,' +
|
|
' sgfh_expr, sjcl_expr, qtcl_expr, check_calc,' +
|
|
- ' gxby_status, dagl_status, dagl_url, gxby_limit, gxby_ratio, dagl_limit, dagl_ratio' +
|
|
|
|
|
|
+ ' gxby_status, dagl_status, dagl_url, gxby_limit, dagl_limit' +
|
|
' From ' +
|
|
' From ' +
|
|
this.ctx.service.reviseBills.tableName +
|
|
this.ctx.service.reviseBills.tableName +
|
|
' Where `tender_id` = ?';
|
|
' Where `tender_id` = ?';
|
|
@@ -321,11 +328,11 @@ module.exports = app => {
|
|
' (id, tid, lid, name, drawing_code, quantity, add_stage, add_times, add_user,' +
|
|
' (id, tid, lid, name, drawing_code, quantity, add_stage, add_times, add_user,' +
|
|
' sgfh_qty, sjcl_qty, qtcl_qty, crid, porder, position, ' +
|
|
' sgfh_qty, sjcl_qty, qtcl_qty, crid, porder, position, ' +
|
|
' sgfh_expr, sjcl_expr, qtcl_expr, real_qty,' +
|
|
' sgfh_expr, sjcl_expr, qtcl_expr, real_qty,' +
|
|
- ' gxby_status, dagl_status, dagl_url, gxby_limit, gxby_ratio, dagl_limit, dagl_ratio)' +
|
|
|
|
|
|
+ ' gxby_status, dagl_status, dagl_url, gxby_limit, dagl_limit)' +
|
|
' Select id, tid, lid, name, drawing_code, quantity, add_stage, add_times, add_user,' +
|
|
' Select id, tid, lid, name, drawing_code, quantity, add_stage, add_times, add_user,' +
|
|
' sgfh_qty, sjcl_qty, qtcl_qty, crid, porder, position,' +
|
|
' sgfh_qty, sjcl_qty, qtcl_qty, crid, porder, position,' +
|
|
' sgfh_expr, sjcl_expr, qtcl_expr, real_qty,' +
|
|
' sgfh_expr, sjcl_expr, qtcl_expr, real_qty,' +
|
|
- ' gxby_status, dagl_status, dagl_url, gxby_limit, gxby_ratio, dagl_limit, dagl_ratio' +
|
|
|
|
|
|
+ ' gxby_status, dagl_status, dagl_url, gxby_limit, dagl_limit' +
|
|
' From ' +
|
|
' From ' +
|
|
this.ctx.service.revisePos.tableName +
|
|
this.ctx.service.revisePos.tableName +
|
|
' Where `tid` = ?';
|
|
' Where `tid` = ?';
|
|
@@ -403,9 +410,14 @@ module.exports = app => {
|
|
// smsTypeConst.judge.approval.toString(), '台账修订需要您审批,请登录系统处理。');
|
|
// smsTypeConst.judge.approval.toString(), '台账修订需要您审批,请登录系统处理。');
|
|
await this.ctx.helper.sendAliSms(nextAudit.audit_id, smsTypeConst.const.XD, smsTypeConst.judge.approval.toString(), SmsAliConst.template.revise_check);
|
|
await this.ctx.helper.sendAliSms(nextAudit.audit_id, smsTypeConst.const.XD, smsTypeConst.judge.approval.toString(), SmsAliConst.template.revise_check);
|
|
// 微信模板通知
|
|
// 微信模板通知
|
|
|
|
+ const shenpiUrl = await this.ctx.helper.urlToShort(
|
|
|
|
+ this.ctx.protocol + '://' + this.ctx.host + '/wap/tender/' + revise.tid + '/revise/' + revise.id + '/info'
|
|
|
|
+ );
|
|
const wechatData = {
|
|
const wechatData = {
|
|
|
|
+ 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,
|
|
begin_time: Date.parse(revise.begin_time),
|
|
begin_time: Date.parse(revise.begin_time),
|
|
};
|
|
};
|
|
await this.ctx.helper.sendWechat(nextAudit.audit_id, smsTypeConst.const.XD, smsTypeConst.judge.approval.toString(), wxConst.template.revise, wechatData);
|
|
await this.ctx.helper.sendWechat(nextAudit.audit_id, smsTypeConst.const.XD, smsTypeConst.judge.approval.toString(), wxConst.template.revise, wechatData);
|
|
@@ -471,10 +483,15 @@ module.exports = app => {
|
|
users.push(revise.uid);
|
|
users.push(revise.uid);
|
|
|
|
|
|
// 微信模板通知
|
|
// 微信模板通知
|
|
|
|
+ const shenpiUrl = await this.ctx.helper.urlToShort(
|
|
|
|
+ this.ctx.protocol + '://' + this.ctx.host + '/wap/tender/' + revise.tid + '/revise/' + revise.id + '/info'
|
|
|
|
+ );
|
|
const wechatData2 = {
|
|
const wechatData2 = {
|
|
|
|
+ wap_url: shenpiUrl,
|
|
status: wxConst.status.success,
|
|
status: wxConst.status.success,
|
|
tips: wxConst.tips.success,
|
|
tips: wxConst.tips.success,
|
|
begin_time: Date.parse(revise.begin_time),
|
|
begin_time: Date.parse(revise.begin_time),
|
|
|
|
+ code: this.ctx.session.sessionProject.code,
|
|
};
|
|
};
|
|
await this.ctx.helper.sendWechat(users, smsTypeConst.const.XD, smsTypeConst.judge.result.toString(), wxConst.template.revise, wechatData2);
|
|
await this.ctx.helper.sendWechat(users, smsTypeConst.const.XD, smsTypeConst.judge.result.toString(), wxConst.template.revise, wechatData2);
|
|
}
|
|
}
|
|
@@ -505,10 +522,15 @@ module.exports = app => {
|
|
status: SmsAliConst.status.back,
|
|
status: SmsAliConst.status.back,
|
|
});
|
|
});
|
|
// 微信模板通知
|
|
// 微信模板通知
|
|
|
|
+ const shenpiUrl = await this.ctx.helper.urlToShort(
|
|
|
|
+ this.ctx.protocol + '://' + this.ctx.host + '/wap/tender/' + revise.tid + '/revise/' + revise.id + '/info'
|
|
|
|
+ );
|
|
const wechatData = {
|
|
const wechatData = {
|
|
|
|
+ wap_url: shenpiUrl,
|
|
status: wxConst.status.back,
|
|
status: wxConst.status.back,
|
|
tips: wxConst.tips.back,
|
|
tips: wxConst.tips.back,
|
|
begin_time: Date.parse(revise.begin_time),
|
|
begin_time: Date.parse(revise.begin_time),
|
|
|
|
+ code: this.ctx.session.sessionProject.code,
|
|
};
|
|
};
|
|
await this.ctx.helper.sendWechat(revise.uid, smsTypeConst.const.XD, smsTypeConst.judge.result.toString(), wxConst.template.revise, wechatData);
|
|
await this.ctx.helper.sendWechat(revise.uid, smsTypeConst.const.XD, smsTypeConst.judge.result.toString(), wxConst.template.revise, wechatData);
|
|
// 其他参与人
|
|
// 其他参与人
|
|
@@ -525,9 +547,11 @@ module.exports = app => {
|
|
);
|
|
);
|
|
// 微信模板通知
|
|
// 微信模板通知
|
|
const wechatData2 = {
|
|
const wechatData2 = {
|
|
|
|
+ wap_url: shenpiUrl,
|
|
status: wxConst.status.back,
|
|
status: wxConst.status.back,
|
|
tips: wxConst.tips.back,
|
|
tips: wxConst.tips.back,
|
|
begin_time: Date.parse(revise.begin_time),
|
|
begin_time: Date.parse(revise.begin_time),
|
|
|
|
+ code: this.ctx.session.sessionProject.code,
|
|
};
|
|
};
|
|
await this.ctx.helper.sendWechat(this._.map(auditors, 'user_id'), smsTypeConst.const.XD, smsTypeConst.judge.result.toString(), wxConst.template.revise, wechatData2);
|
|
await this.ctx.helper.sendWechat(this._.map(auditors, 'user_id'), smsTypeConst.const.XD, smsTypeConst.judge.result.toString(), wxConst.template.revise, wechatData2);
|
|
}
|
|
}
|
|
@@ -540,6 +564,30 @@ module.exports = app => {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
+ * 取待审批修订列表(wap用)
|
|
|
|
+ *
|
|
|
|
+ * @param auditorId
|
|
|
|
+ * @return {Promise<*>}
|
|
|
|
+ */
|
|
|
|
+ async getAuditReviseByWap(auditorId) {
|
|
|
|
+ const sql =
|
|
|
|
+ 'SELECT ra.`audit_id`, ra.`times`, ra.`audit_order`, ra.`begin_time`, ra.`end_time`,' +
|
|
|
|
+ ' r.id, r.corder, r.uid, r.status, r.content, r.in_time, ' +
|
|
|
|
+ ' t.id As t_id, t.`name` As t_name, t.`project_id` As t_pid, t.`type` As t_type, t.`user_id` As t_uid, t.`status` As t_status, ' +
|
|
|
|
+ ' ti.`deal_info`, ' +
|
|
|
|
+ ' p.name As audit_name, p.role As audit_role, p.company As audit_company' +
|
|
|
|
+ ' FROM ' + this.tableName + ' AS ra' +
|
|
|
|
+ ' Left Join ' + this.ctx.service.ledgerRevise.tableName + ' As r On ra.rid = r.id' +
|
|
|
|
+ ' Left Join ' + this.ctx.service.tender.tableName + ' AS t On r.tid = t.id' +
|
|
|
|
+ ' Left Join ' + this.ctx.service.tenderInfo.tableName + ' AS ti On r.tid = ti.tid' +
|
|
|
|
+ ' Left Join ' + this.ctx.service.projectAccount.tableName + ' As p On ra.audit_id = p.id' +
|
|
|
|
+ ' WHERE r.`valid` != 0 and ra.`audit_id` = ? and ra.`status` = ?' +
|
|
|
|
+ ' ORDER BY ra.`begin_time` DESC';
|
|
|
|
+ const sqlParam = [auditorId, auditConst.status.checking];
|
|
|
|
+ return await this.db.query(sql, sqlParam);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
* 获取审核人需要审核的标段列表
|
|
* 获取审核人需要审核的标段列表
|
|
*
|
|
*
|
|
* @param auditorId
|
|
* @param auditorId
|