|
@@ -814,7 +814,7 @@ module.exports = app => {
|
|
|
await this._findParents(transaction, tid, r, result);
|
|
|
}
|
|
|
// 插入到计量单元表,并删除变更的计量单元数据, 插入清单表,并删除变更的清单表
|
|
|
- await this._insertByChangeRevise(transaction, tid, result, result2);
|
|
|
+ await this._insertByChangeRevise(transaction, tid, cid, result, result2);
|
|
|
// 更新标段总金额
|
|
|
const sumSql = 'SELECT Sum(total_price) As total_price, Sum(deal_tp) As deal_tp' +
|
|
|
' FROM ' + this.ctx.service.ledger.tableName + this.ctx.helper.whereSql({ tender_id: tid });
|
|
@@ -837,7 +837,7 @@ module.exports = app => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- async _insertByChangeRevise(transaction, tid, ledgerList, posList) {
|
|
|
+ async _insertByChangeRevise(transaction, tid, cid, ledgerList, posList) {
|
|
|
if (ledgerList.length > 0) {
|
|
|
const insertLedgerArr = [];
|
|
|
for (const l of ledgerList) {
|
|
@@ -851,6 +851,8 @@ module.exports = app => {
|
|
|
];
|
|
|
insertLedgerArr.push('(' + this.ctx.helper.getInArrStrSqlFilter(insertL) + ')');
|
|
|
await transaction.delete(this.ctx.service.changeLedger.tableName, { id: l.id });
|
|
|
+ // 日志添加
|
|
|
+ await transaction.insert(this.ctx.service.changeReviseLog.tableName, { tid, cid, lid: l.id, name: l.name, create_time: new Date() });
|
|
|
}
|
|
|
const bSql = 'Insert Into ' +
|
|
|
this.ctx.service.ledger.tableName +
|
|
@@ -874,6 +876,8 @@ module.exports = app => {
|
|
|
];
|
|
|
insertPosArr.push('(' + this.ctx.helper.getInArrStrSqlFilter(insertp) + ')');
|
|
|
await transaction.delete(this.ctx.service.changePos.tableName, { id: p.id });
|
|
|
+ // 日志添加
|
|
|
+ await transaction.insert(this.ctx.service.changeReviseLog.tableName, { tid, cid, pid: p.id, name: p.name, create_time: new Date() });
|
|
|
}
|
|
|
const pSql =
|
|
|
'Insert Into ' +
|