|
@@ -259,22 +259,32 @@ module.exports = app => {
|
|
async deleteTenderNoBackup(id) {
|
|
async deleteTenderNoBackup(id) {
|
|
const transaction = await this.db.beginTransaction();
|
|
const transaction = await this.db.beginTransaction();
|
|
try {
|
|
try {
|
|
- await transaction.delete(this.tableName, {id: id});
|
|
|
|
- await transaction.delete(this.ctx.service.tenderInfo.tableName, {tid: id});
|
|
|
|
- await transaction.delete(this.ctx.service.ledger.tableName, {tender_id: id});
|
|
|
|
- await transaction.delete(this.ctx.service.ledgerAudit.tableName, {tender_id: id});
|
|
|
|
- await transaction.delete(this.ctx.service.pos.tableName, {tid: id});
|
|
|
|
- await transaction.delete(this.ctx.service.pay.tableName, {tid: id});
|
|
|
|
- await transaction.delete(this.ctx.service.stage.tableName, {tid: id});
|
|
|
|
- await transaction.delete(this.ctx.service.stageAudit.tableName, {tid: id});
|
|
|
|
- await transaction.delete(this.ctx.service.stageBills.tableName, {tid: id});
|
|
|
|
- await transaction.delete(this.ctx.service.stagePos.tableName, {tid: id});
|
|
|
|
- await transaction.delete(this.ctx.service.stageDetail.tableName, {tid: id});
|
|
|
|
- await transaction.delete(this.ctx.service.stagePay.tableName, {tid: id});
|
|
|
|
- await transaction.delete(this.ctx.service.change.tableName, {tid: id});
|
|
|
|
- await transaction.delete(this.ctx.service.changeAudit.tableName, {tid: id});
|
|
|
|
- await transaction.delete(this.ctx.service.changeAuditList.tableName, {tid: id});
|
|
|
|
- await transaction.delete(this.ctx.service.changeCompany.tableName, {tid: id});
|
|
|
|
|
|
+ await transaction.delete(this.tableName, { id });
|
|
|
|
+ await transaction.delete(this.ctx.service.tenderInfo.tableName, { tid: id });
|
|
|
|
+ await transaction.delete(this.ctx.service.ledger.tableName, { tender_id: id });
|
|
|
|
+ await transaction.delete(this.ctx.service.ledgerAudit.tableName, { tender_id: id });
|
|
|
|
+ await transaction.delete(this.ctx.service.pos.tableName, { tid: id });
|
|
|
|
+ await transaction.delete(this.ctx.service.pay.tableName, { tid: id });
|
|
|
|
+
|
|
|
|
+ await transaction.delete(this.ctx.service.stage.tableName, { tid: id });
|
|
|
|
+ await transaction.delete(this.ctx.service.stageAudit.tableName, { tid: id });
|
|
|
|
+ await transaction.delete(this.ctx.service.stageBills.tableName, { tid: id });
|
|
|
|
+ await transaction.delete(this.ctx.service.stagePos.tableName, { tid: id });
|
|
|
|
+ await transaction.delete(this.ctx.service.stageDetail.tableName, { tid: id });
|
|
|
|
+ await transaction.delete(this.ctx.service.stagePay.tableName, { tid: id });
|
|
|
|
+
|
|
|
|
+ await transaction.delete(this.ctx.service.change.tableName, { tid: id });
|
|
|
|
+ await transaction.delete(this.ctx.service.changeAudit.tableName, { tid: id });
|
|
|
|
+ await transaction.delete(this.ctx.service.changeAuditList.tableName, { tid: id });
|
|
|
|
+ await transaction.delete(this.ctx.service.changeCompany.tableName, { tid: id });
|
|
|
|
+
|
|
|
|
+ await transaction.delete(this.ctx.service.ledgerRevise.tableName, { tid: id });
|
|
|
|
+ await transaction.delete(this.ctx.service.reviseAudit.tableName, { tender_id: id });
|
|
|
|
+ await transaction.delete(this.ctx.service.reviseBills.tableName, { tender_id: id });
|
|
|
|
+ await transaction.delete(this.ctx.service.revisePos.tableName, { tid: id });
|
|
|
|
+
|
|
|
|
+ await transaction.delete(this.ctx.service.signatureUsed.tableName, { tender_id: id });
|
|
|
|
+ await transaction.delete(this.ctx.service.signatureRole.tableName, { tender_id: id });
|
|
// 先删除附件文件
|
|
// 先删除附件文件
|
|
const attList = await this.ctx.service.changeAtt.getAllDataByCondition({ where: { tid: id } });
|
|
const attList = await this.ctx.service.changeAtt.getAllDataByCondition({ where: { tid: id } });
|
|
if (attList.length !== 0) {
|
|
if (attList.length !== 0) {
|
|
@@ -284,7 +294,7 @@ module.exports = app => {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- await transaction.delete(this.ctx.service.changeAtt.tableName, {tid: id});
|
|
|
|
|
|
+ await transaction.delete(this.ctx.service.changeAtt.tableName, { tid: id });
|
|
await transaction.commit();
|
|
await transaction.commit();
|
|
return true;
|
|
return true;
|
|
} catch (err) {
|
|
} catch (err) {
|