tender_financial.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. 'use strict';
  2. /**
  3. *
  4. *
  5. * @author Mai
  6. * @date 20250613
  7. * @version
  8. */
  9. class reportMemoryFinancial {
  10. constructor(ctx) {
  11. this.ctx = ctx;
  12. }
  13. async checkTender(tid) {
  14. this.tender = this.ctx.tender ? this.ctx.tender : await this.ctx.tender.getDataById(tid);
  15. }
  16. async pay(tid) {
  17. await this.checkTender(tid);
  18. if (!this.tender || !this.tender.spid) return [];
  19. return await this.ctx.service.financialPay.getAllDataByCondition({ where: { spid: this.tender.spid }});
  20. }
  21. async payContract(tid) {
  22. await this.checkTender(tid);
  23. if (!this.tender || !this.tender.spid) return [];
  24. return await this.ctx.service.financialPayContract.getAllDataByCondition({ where: { spid: this.tender.spid } });
  25. }
  26. async payTender(tid) {
  27. await this.checkTender(tid);
  28. if (!this.tender || !this.tender.spid) return [];
  29. return await this.ctx.service.financialPayTender.getAllDataByCondition({ where: { spid: this.tender.spid } });
  30. }
  31. async transfer(tid) {
  32. await this.checkTender(tid);
  33. if (!this.tender || !this.tender.spid) return [];
  34. return await this.ctx.service.financialTransfer.getAllDataByCondition({ where: { spid: this.tender.spid } });
  35. }
  36. async transferTender(tid) {
  37. await this.checkTender(tid);
  38. if (!this.tender || !this.tender.spid) return [];
  39. return await this.ctx.service.financialTransferTender.getAllDataByCondition({ where: { spid: this.tender.spid } });
  40. }
  41. }
  42. module.exports = reportMemoryFinancial;