currentMonthRank.js 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. 'use strict';
  2. const Controller = require('egg').Controller;
  3. class CurrentMonthRankController extends Controller {
  4. /**
  5. * 1.当前月份排行榜-地区采集数据(待测试)
  6. */
  7. async infodept() {
  8. const { ctx, service } = this;
  9. const query = ctx.request.body;
  10. delete query.deptId;
  11. if (Object.keys(query).length === 0) {
  12. query.dept1 = this.app.config.dept1ObjectId;
  13. }
  14. const result = await service.currentMonthRank.infodept(query);
  15. ctx.body = result;
  16. }
  17. /**
  18. * 2.当前月份排行榜-个人采集数据【已测试】
  19. */
  20. async infoperson() {
  21. const { ctx, service } = this;
  22. const query = ctx.request.body;
  23. delete query.deptId;
  24. const result = await service.currentMonthRank.infoperson(query);
  25. ctx.body = result;
  26. }
  27. /**
  28. * 3.当前月份排行榜-地区探访数据【已测试】
  29. */
  30. async visitdept() {
  31. const { ctx, service } = this;
  32. const query = ctx.request.body;
  33. delete query.deptId;
  34. if (Object.keys(query).length === 0) {
  35. query.dept1 = this.app.config.dept1ObjectId;
  36. }
  37. const result = await service.currentMonthRank.visitdept(query);
  38. ctx.body = result;
  39. }
  40. /**
  41. * 4.当前月份排行榜-个人探访数据【已测试】
  42. */
  43. async visitperson() {
  44. const { ctx, service } = this;
  45. const query = ctx.request.body;
  46. delete query.deptId;
  47. const result = await service.currentMonthRank.visitperson(query);
  48. ctx.body = result;
  49. }
  50. /**
  51. * 5.当前月份排行榜-上周探访(次)【已测试】
  52. */
  53. async visitnumday() {
  54. const { ctx, service } = this;
  55. const query = ctx.request.body;
  56. delete query.deptId;
  57. if (Object.keys(query).length === 0) {
  58. query.dept1 = this.app.config.dept1ObjectId;
  59. }
  60. const result = await service.currentMonthRank.visitnumday(query);
  61. ctx.body = result;
  62. }
  63. /**
  64. * 6.当前月份排行榜-实时信息【已测试】
  65. */
  66. async selectInfoMessage() {
  67. const { ctx, service } = this;
  68. const query = ctx.request.body;
  69. delete query.deptId;
  70. if (Object.keys(query).length === 0) {
  71. query.dept1 = this.app.config.dept1ObjectId;
  72. }
  73. const result = await service.currentMonthRank.selectInfoMessage(query);
  74. ctx.body = result;
  75. }
  76. }
  77. module.exports = CurrentMonthRankController;