cashing.js 705 B

12345678910111213141516171819202122
  1. 'use strict';
  2. const { CrudService } = require('naf-framework-mongoose/lib/service');
  3. const { BusinessError, ErrorCode } = require('naf-core').Error;
  4. const _ = require('lodash');
  5. const assert = require('assert');
  6. const moment = require('moment');
  7. // 高企申报兑付
  8. class CashingService extends CrudService {
  9. constructor(ctx) {
  10. super(ctx, 'cashing');
  11. this.model = this.ctx.model.Cashing;
  12. }
  13. async create(body) {
  14. const cashing_no = `${moment().format('YYYYMMDD')}${moment().format('x')}DF`;
  15. const create_time = moment().format('YYYY-MM-DD HH:mm:ss');
  16. body = { ...body, cashing_no, create_time };
  17. return await this.model.create(body);
  18. }
  19. }
  20. module.exports = CashingService;