|
@@ -269,7 +269,6 @@ module.exports = app => {
|
|
|
* @return {Promise<boolean>} - 结果
|
|
* @return {Promise<boolean>} - 结果
|
|
|
*/
|
|
*/
|
|
|
async deleteTenderNoBackup(id) {
|
|
async deleteTenderNoBackup(id) {
|
|
|
- this.ctx.query_tender = await this.ctx.service.tender.getDataById(id);
|
|
|
|
|
const transaction = await this.db.beginTransaction();
|
|
const transaction = await this.db.beginTransaction();
|
|
|
try {
|
|
try {
|
|
|
const tenderMsg = await this.getDataById(id);
|
|
const tenderMsg = await this.getDataById(id);
|
|
@@ -280,18 +279,18 @@ module.exports = app => {
|
|
|
await this.ctx.helper.delFiles(attList);
|
|
await this.ctx.helper.delFiles(attList);
|
|
|
await transaction.delete(this.tableName, { id });
|
|
await transaction.delete(this.tableName, { id });
|
|
|
await transaction.delete(this.ctx.service.tenderInfo.tableName, { tid: 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.ledger.departTableName(id), { tender_id: id });
|
|
|
await transaction.delete(this.ctx.service.ledgerAudit.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.pos.departTableName(id), { tid: id });
|
|
|
await transaction.delete(this.ctx.service.pay.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.stage.tableName, { tid: id });
|
|
|
await transaction.delete(this.ctx.service.stageAudit.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.stageBills.departTableName(id), { tid: id });
|
|
|
|
|
+ await transaction.delete(this.ctx.service.stagePos.departTableName(id), { tid: id });
|
|
|
await transaction.delete(this.ctx.service.stageBillsDgn.tableName, { tid: id });
|
|
await transaction.delete(this.ctx.service.stageBillsDgn.tableName, { tid: id });
|
|
|
- await transaction.delete(this.ctx.service.stageBillsFinal.tableName, { tid: id });
|
|
|
|
|
- await transaction.delete(this.ctx.service.stagePosFinal.tableName, { tid: id });
|
|
|
|
|
|
|
+ await transaction.delete(this.ctx.service.stageBillsFinal.departTableName(id), { tid: id });
|
|
|
|
|
+ await transaction.delete(this.ctx.service.stagePosFinal.departTableName(id), { tid: id });
|
|
|
await transaction.delete(this.ctx.service.stageDetail.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.stagePay.tableName, { tid: id });
|
|
|
await transaction.delete(this.ctx.service.stageChange.tableName, { tid: id });
|
|
await transaction.delete(this.ctx.service.stageChange.tableName, { tid: id });
|
|
@@ -307,8 +306,8 @@ module.exports = app => {
|
|
|
|
|
|
|
|
await transaction.delete(this.ctx.service.ledgerRevise.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.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.reviseBills.departTableName(id), { tender_id: id });
|
|
|
|
|
+ await transaction.delete(this.ctx.service.revisePos.departTableName(id), { tid: id });
|
|
|
|
|
|
|
|
await transaction.delete(this.ctx.service.material.tableName, { tid: id });
|
|
await transaction.delete(this.ctx.service.material.tableName, { tid: id });
|
|
|
await transaction.delete(this.ctx.service.materialAudit.tableName, { tid: id });
|
|
await transaction.delete(this.ctx.service.materialAudit.tableName, { tid: id });
|
|
@@ -332,12 +331,10 @@ module.exports = app => {
|
|
|
// 记录删除日志
|
|
// 记录删除日志
|
|
|
await this.ctx.service.projectLog.addProjectLog(transaction, projectLogConst.type.tender, projectLogConst.status.delete, tenderMsg.name, id);
|
|
await this.ctx.service.projectLog.addProjectLog(transaction, projectLogConst.type.tender, projectLogConst.status.delete, tenderMsg.name, id);
|
|
|
await transaction.commit();
|
|
await transaction.commit();
|
|
|
- this.ctx.query_tender = null;
|
|
|
|
|
return true;
|
|
return true;
|
|
|
} catch (err) {
|
|
} catch (err) {
|
|
|
this.ctx.helper.log(err);
|
|
this.ctx.helper.log(err);
|
|
|
await transaction.rollback();
|
|
await transaction.rollback();
|
|
|
- this.ctx.query_tender = null;
|
|
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|