'use strict'; /** * * * @author Mai * @date 20250613 * @version */ class reportMemoryFinancial { constructor(ctx) { this.ctx = ctx; } async checkTender(tid) { this.tender = this.ctx.tender ? this.ctx.tender : await this.ctx.service.tender.getDataById(tid); } async pay(tid) { await this.checkTender(tid); if (!this.tender) return []; return await this.ctx.service.financialPay.getAllDataByCondition({ where: { tid }}); } async payContract(tid) { await this.checkTender(tid); if (!this.tender) return []; return await this.ctx.service.financialPayContract.getAllDataByCondition({ where: { tid } }); } async payTender(tid) { await this.checkTender(tid); if (!this.tender) return []; return await this.ctx.service.financialPayTender.getAllDataByCondition({ where: { tid } }); } async transferTender(tid) { await this.checkTender(tid); if (!this.tender) return []; return await this.ctx.service.financialTransferTender.getAllDataByCondition({ where: { tid } }); } async projectPay(tid) { await this.checkTender(tid); if (!this.tender || !this.tender.spid) return []; return await this.ctx.service.financialPay.getAllDataByCondition({ where: { spid: this.tender.spid }}); } async projectPayContract(tid) { await this.checkTender(tid); if (!this.tender || !this.tender.spid) return []; return await this.ctx.service.financialPayContract.getAllDataByCondition({ where: { spid: this.tender.spid } }); } async projectPayTender(tid) { await this.checkTender(tid); if (!this.tender || !this.tender.spid) return []; return await this.ctx.service.financialPayTender.getAllDataByCondition({ where: { spid: this.tender.spid } }); } async projectTransfer(tid) { await this.checkTender(tid); if (!this.tender || !this.tender.spid) return []; return await this.ctx.service.financialTransfer.getAllDataByCondition({ where: { spid: this.tender.spid } }); } async projectTransferTender(tid) { await this.checkTender(tid); if (!this.tender || !this.tender.spid) return []; return await this.ctx.service.financialTransferTender.getAllDataByCondition({ where: { spid: this.tender.spid } }); } } module.exports = reportMemoryFinancial;