order.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. * 修改订单负责人
  37. */
  38. async principalChange() {
  39. await this.service.principalChange(this.ctx.request.body);
  40. this.ctx.ok();
  41. }
  42. }
  43. module.exports = CrudController(OrderController, meta);