report.js 638 B

12345678910111213141516171819202122
  1. 'use strict';
  2. const { CrudService } = require('naf-framework-mongoose-free/lib/service');
  3. const { BusinessError, ErrorCode } = require('naf-core').Error;
  4. const _ = require('lodash');
  5. const assert = require('assert');
  6. const { ObjectId } = require('mongoose').Types;
  7. // 评估报告
  8. class ReportService extends CrudService {
  9. constructor(ctx) {
  10. super(ctx, 'report');
  11. this.model = this.ctx.model.Patent.Report;
  12. }
  13. async checkReport(ids) {
  14. ids = ids.map(i => ObjectId(i));
  15. const list = await this.model.find({ disclosure_id: { $in: ids } }, { disclosure_id: 1 });
  16. return list;
  17. }
  18. }
  19. module.exports = ReportService;