tender_financial.js 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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.service.tender.getDataById(tid);
  15. }
  16. async pay(tid) {
  17. await this.checkTender(tid);
  18. if (!this.tender) return [];
  19. return await this.ctx.service.financialPay.getAllDataByCondition({ where: { tid }});
  20. }
  21. async payContract(tid) {
  22. await this.checkTender(tid);
  23. if (!this.tender) return [];
  24. return await this.ctx.service.financialPayContract.getAllDataByCondition({ where: { tid } });
  25. }
  26. async payTender(tid) {
  27. await this.checkTender(tid);
  28. if (!this.tender) return [];
  29. return await this.ctx.service.financialPayTender.getAllDataByCondition({ where: { tid } });
  30. }
  31. async transferTender(tid) {
  32. await this.checkTender(tid);
  33. if (!this.tender) return [];
  34. return await this.ctx.service.financialTransferTender.getAllDataByCondition({ where: { tid } });
  35. }
  36. async projectPay(tid) {
  37. await this.checkTender(tid);
  38. if (!this.tender || !this.tender.spid) return [];
  39. return await this.ctx.service.financialPay.getAllDataByCondition({ where: { spid: this.tender.spid }});
  40. }
  41. async projectPayContract(tid) {
  42. await this.checkTender(tid);
  43. if (!this.tender || !this.tender.spid) return [];
  44. return await this.ctx.service.financialPayContract.getAllDataByCondition({ where: { spid: this.tender.spid } });
  45. }
  46. async projectPayTender(tid) {
  47. await this.checkTender(tid);
  48. if (!this.tender || !this.tender.spid) return [];
  49. return await this.ctx.service.financialPayTender.getAllDataByCondition({ where: { spid: this.tender.spid } });
  50. }
  51. async projectTransfer(tid) {
  52. await this.checkTender(tid);
  53. if (!this.tender || !this.tender.spid) return [];
  54. return await this.ctx.service.financialTransfer.getAllDataByCondition({ where: { spid: this.tender.spid } });
  55. }
  56. async projectTransferTender(tid) {
  57. await this.checkTender(tid);
  58. if (!this.tender || !this.tender.spid) return [];
  59. return await this.ctx.service.financialTransferTender.getAllDataByCondition({ where: { spid: this.tender.spid } });
  60. }
  61. }
  62. module.exports = reportMemoryFinancial;