|
@@ -314,7 +314,7 @@ module.exports = app => {
|
|
|
* @param {Number} cpId 立项书id
|
|
|
* @param {Number} uid 审批人id
|
|
|
*/
|
|
|
- async getNoticeContent(pid, tid, cpId, uid) {
|
|
|
+ async getNoticeContent(pid, tid, cpId, uid, opinion = '') {
|
|
|
const noticeSql = 'SELECT * FROM (SELECT ' +
|
|
|
' t.`id` As `tid`, ma.`cpid`, m.`code` as `c_code`, t.`name`, pa.`name` As `su_name`, pa.role As `su_role`' +
|
|
|
' FROM (SELECT * FROM ?? WHERE `id` = ? ) As t' +
|
|
@@ -324,6 +324,9 @@ module.exports = app => {
|
|
|
' WHERE t.`project_id` = ? ) as new_t GROUP BY new_t.`tid`';
|
|
|
const noticeSqlParam = [this.ctx.service.tender.tableName, tid, this.ctx.service.changeProject.tableName, cpId, this.tableName, this.ctx.service.projectAccount.tableName, uid, pid];
|
|
|
const content = await this.db.query(noticeSql, noticeSqlParam);
|
|
|
+ if (content.length) {
|
|
|
+ content[0].opinion = opinion;
|
|
|
+ }
|
|
|
return content.length ? JSON.stringify(content[0]) : '';
|
|
|
}
|
|
|
|
|
@@ -376,7 +379,7 @@ module.exports = app => {
|
|
|
await transaction.update(this.tableName, { id: audit.id, status: checkData.checkType, opinion: checkData.opinion, end_time: time });
|
|
|
|
|
|
// 获取推送必要信息
|
|
|
- const noticeContent = await this.getNoticeContent(pid, audit.tid, cpId, audit.aid);
|
|
|
+ const noticeContent = await this.getNoticeContent(pid, audit.tid, cpId, audit.aid, checkData.opinion);
|
|
|
// 添加推送
|
|
|
const records = [{ pid, type: pushType.changeProject, uid: this.ctx.change.uid, status: auditConst.status.checked, content: noticeContent }];
|
|
|
auditors.forEach(audit => {
|
|
@@ -450,7 +453,7 @@ module.exports = app => {
|
|
|
try {
|
|
|
await transaction.update(this.tableName, { id: audit.id, status: checkData.checkType, opinion: checkData.opinion, end_time: time });
|
|
|
// 添加到消息推送表
|
|
|
- const noticeContent = await this.getNoticeContent(pid, audit.tid, cpId, audit.aid);
|
|
|
+ const noticeContent = await this.getNoticeContent(pid, audit.tid, cpId, audit.aid, checkData.opinion);
|
|
|
const records = [{ pid, type: pushType.changeProject, uid: this.ctx.change.uid, status: auditConst.status.back, content: noticeContent }];
|
|
|
auditors.forEach(audit => {
|
|
|
records.push({ pid, type: pushType.changeProject, uid: audit.aid, status: auditConst.status.back, content: noticeContent });
|
|
@@ -498,7 +501,7 @@ module.exports = app => {
|
|
|
await transaction.update(this.tableName, { id: audit.id, status: checkData.checkType, opinion: checkData.opinion, end_time: time });
|
|
|
|
|
|
// 获取推送必要信息
|
|
|
- const noticeContent = await this.getNoticeContent(pid, audit.tid, cpId, audit.aid);
|
|
|
+ const noticeContent = await this.getNoticeContent(pid, audit.tid, cpId, audit.aid, checkData.opinion);
|
|
|
// 添加推送
|
|
|
const records = [{ pid, type: pushType.changeProject, uid: this.ctx.change.uid, status: auditConst.status.checkNo, content: noticeContent }];
|
|
|
auditors.forEach(audit => {
|