order.js 926 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. 'use strict';
  2. // const _ = require('lodash');
  3. const meta = require('./.order.js');
  4. const Controller = require('egg').Controller;
  5. const { CrudController } = require('naf-framework-mongoose/lib/controller');
  6. // 订单
  7. class OrderController extends Controller {
  8. constructor(ctx) {
  9. super(ctx);
  10. this.service = this.ctx.service.order.order;
  11. this.bill_service = this.ctx.service.order.bill;
  12. this.split_service = this.ctx.service.order.split;
  13. }
  14. /**
  15. * 修改收入
  16. */
  17. async inBill() {
  18. await this.bill_service.inBill(this.ctx.request.body);
  19. this.ctx.ok();
  20. }
  21. /**
  22. * 拆分货物
  23. */
  24. async splitGoods() {
  25. await this.split_service.splitGoods(this.ctx.request.body);
  26. this.ctx.ok();
  27. }
  28. /**
  29. * 修改支出
  30. */
  31. async outBill() {
  32. await this.bill_service.outBill(this.ctx.request.body);
  33. this.ctx.ok();
  34. }
  35. }
  36. module.exports = CrudController(OrderController, meta);