12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- 'use strict';
- const Controller = require('egg').Controller;
- class CurrentMonthRankController extends Controller {
- /**
- * 1.当前月份排行榜-地区采集数据(待测试)
- */
- async infodept() {
- const { ctx, service } = this;
- const query = ctx.request.body;
- delete query.deptId;
- if (Object.keys(query).length === 0) {
- query.dept1 = this.app.config.dept1ObjectId;
- }
- const result = await service.currentMonthRank.infodept(query);
- ctx.body = result;
- }
- /**
- * 2.当前月份排行榜-个人采集数据【已测试】
- */
- async infoperson() {
- const { ctx, service } = this;
- const query = ctx.request.body;
- delete query.deptId;
- const result = await service.currentMonthRank.infoperson(query);
- ctx.body = result;
- }
- /**
- * 3.当前月份排行榜-地区探访数据【已测试】
- */
- async visitdept() {
- const { ctx, service } = this;
- const query = ctx.request.body;
- delete query.deptId;
- if (Object.keys(query).length === 0) {
- query.dept1 = this.app.config.dept1ObjectId;
- }
- const result = await service.currentMonthRank.visitdept(query);
- ctx.body = result;
- }
- /**
- * 4.当前月份排行榜-个人探访数据【已测试】
- */
- async visitperson() {
- const { ctx, service } = this;
- const query = ctx.request.body;
- delete query.deptId;
- const result = await service.currentMonthRank.visitperson(query);
- ctx.body = result;
- }
- /**
- * 5.当前月份排行榜-上周探访(次)【已测试】
- */
- async visitnumday() {
- const { ctx, service } = this;
- const query = ctx.request.body;
- delete query.deptId;
- if (Object.keys(query).length === 0) {
- query.dept1 = this.app.config.dept1ObjectId;
- }
- const result = await service.currentMonthRank.visitnumday(query);
- ctx.body = result;
- }
- /**
- * 6.当前月份排行榜-实时信息【已测试】
- */
- async selectInfoMessage() {
- const { ctx, service } = this;
- const query = ctx.request.body;
- delete query.deptId;
- if (Object.keys(query).length === 0) {
- query.dept1 = this.app.config.dept1ObjectId;
- }
- const result = await service.currentMonthRank.selectInfoMessage(query);
- ctx.body = result;
- }
- }
- module.exports = CurrentMonthRankController;
|