123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134 |
- 'use strict';
- const Controller = require('egg').Controller;
- class InfoController extends Controller {
- /**
- * 1.年龄分布(计算精准-已测试)
- */
- async fournums() {
- const { ctx, service } = this;
- const query = ctx.request.body;
- delete query.deptId;
- const result = await service.info.fournums(query);
- ctx.body = result;
- }
- /**
- * 2.性别分布(计算精准-已测试)
- */
- async sex() {
- const { ctx, service } = this;
- const query = ctx.request.body;
- delete query.deptId;
- const result = await service.info.sex(query);
- ctx.body = result;
- }
- /**
- * 3.能力评估(计算精准-已测试)
- */
- async ability() {
- const { ctx, service } = this;
- const query = ctx.request.body;
- delete query.deptId;
- const result = await service.info.ability(query);
- ctx.body = result;
- }
- /**
- * 4.健康状况(计算精准-已测试)
- */
- async oldHealth() {
- const { ctx, service } = this;
- const query = ctx.request.body;
- delete query.deptId;
- const result = await service.info.oldHealth(query);
- ctx.body = result;
- }
- /**
- * 5.类别分布(计算精准-已测试)
- */
- async oldType() {
- 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.info.oldType(query);
- ctx.body = result;
- }
- /**
- * 6.探访频次(计算精准-已测试)
- */
- async visitFrequency() {
- const { ctx, service } = this;
- const query = ctx.request.body;
- delete query.deptId;
- const result = await service.info.visitFrequency(query);
- ctx.body = result;
- }
- /**
- * 7.收入来源(计算精准-已测试)
- */
- async oldIncome() {
- const { ctx, service } = this;
- const query = ctx.request.body;
- delete query.deptId;
- const result = await service.info.oldIncome(query);
- ctx.body = result;
- }
- /**
- * 8.可支配收入(计算精准-已测试)
- */
- async income() {
- const { ctx, service } = this;
- const query = ctx.request.body;
- delete query.deptId;
- const result = await service.info.income(query);
- ctx.body = result;
- }
- /**
- * 9.生活经济状况(计算精准-已测试)
- */
- async livingCondition() {
- const { ctx, service } = this;
- const query = ctx.request.body;
- delete query.deptId;
- const result = await service.info.livingCondition(query);
- ctx.body = result;
- }
- /**
- * 10.关爱服务(计算精准-已测试)
- */
- async oldDemand() {
- const { ctx, service } = this;
- const query = ctx.request.body;
- delete query.deptId;
- const result = await service.info.oldDemand(query);
- ctx.body = result;
- }
- /**
- * 11.老人数量(计算精准-已测试)
- */
- async oldnum() {
- 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.info.oldnum(query);
- ctx.body = result;
- }
- }
- module.exports = InfoController;
|