trainplan.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. 'use strict';
  2. const _ = require('lodash');
  3. const meta = require('./.trainplan.js');
  4. const Controller = require('egg').Controller;
  5. const { CrudController } = require('naf-framework-mongoose/lib/controller');
  6. // 培训计划管理
  7. class TrainplanController extends Controller {
  8. constructor(ctx) {
  9. super(ctx);
  10. this.service = this.ctx.service.trainplan;
  11. }
  12. // 导出exportExcel
  13. async exportExcel() {
  14. const data = await this.service.exportExcel(this.ctx.request.body);
  15. this.ctx.ok({ data });
  16. }
  17. // 导出exportSchool学校大表
  18. async exportSchool() {
  19. const data = await this.service.exportSchool(this.ctx.request.body);
  20. this.ctx.ok({ data });
  21. }
  22. // 导出exportPlan计划日历
  23. async exportPlan() {
  24. const data = await this.service.exportPlan(this.ctx.request.body);
  25. this.ctx.ok({ data });
  26. }
  27. async updateclass() {
  28. const data = await this.service.updateclass(this.ctx.request.body);
  29. this.ctx.ok({ data });
  30. }
  31. async updatereteacher() {
  32. const data = await this.service.updatereteacher(this.ctx.request.body);
  33. this.ctx.ok({ data });
  34. }
  35. }
  36. module.exports = CrudController(TrainplanController, meta);