DrugConsumptionAnalysisController.java 5.5 KB
package com.skua.modules.equipment.controller;


import com.skua.core.api.vo.Result;
import com.skua.core.aspect.annotation.AutoLog;
import com.skua.modules.equipment.dto.DrugDto;
import com.skua.modules.equipment.service.IDrugConsumptionAnalysisService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;


@Slf4j
@Api(tags = "药耗分析")
@RestController
@RequestMapping("/drug/consumption/analysis")
public class DrugConsumptionAnalysisController {

    @Autowired
    private IDrugConsumptionAnalysisService drugConsumptionAnalysisService;


    @AutoLog(value = "数据展示")
    @ApiOperation(value = "数据展示", notes = "数据展示")
    @RequestMapping(value = "/data/display", method = RequestMethod.GET)
    public Result<Map<String, Object>> dataDisplay(String time) {
        Result<Map<String, Object>> result = new Result<>();
        Map<String, Object> data = drugConsumptionAnalysisService.DataDisplay(time);
        result.setResult(data);
        result.setSuccess(true);
        return result;
    }


    @AutoLog(value = "总药耗趋势")
    @ApiOperation(value = "总药耗趋势", notes = "总药耗趋势")
    @RequestMapping(value = "/drug/consumption/trend", method = RequestMethod.GET)
    public Result<Map<String, Object>> drugConsumptionTrend(String time) {
        Result<Map<String, Object>> result = new Result<>();
        Map<String, Object> data = drugConsumptionAnalysisService.drugConsumptionTrend(time);
        result.setResult(data);
        result.setSuccess(true);
        return result;
    }

    @AutoLog(value = "吨水药耗趋势")
    @ApiOperation(value = "吨水药耗趋势", notes = "吨水药耗趋势")
    @RequestMapping(value = "/consumption/ton/of/water/trend", method = RequestMethod.GET)
    public Result<Map<String, Object>> consumptionTonOfWaterTrend(String time) {
        Result<Map<String, Object>> result = new Result<>();
        Map<String, Object> data = drugConsumptionAnalysisService.consumptionTonOfWaterTrend(time);
        result.setResult(data);
        result.setSuccess(true);
        return result;
    }

    @AutoLog(value = "药剂占比统计 type 1.按明细 2.按类型")
    @ApiOperation(value = "药剂占比统计 type 1.按明细 2.按类型", notes = "药剂占比统计 type 1.按明细 2.按类型")
    @RequestMapping(value = "/proportion/statistics", method = RequestMethod.GET)
    public Result<Map<String, Object>> proportionStatistics(String time,Integer type) {
        Result<Map<String, Object>> result = new Result<>();
        Map<String, Object> data = drugConsumptionAnalysisService.proportionStatistics(time,type);
        result.setResult(data);
        result.setSuccess(true);
        return result;
    }

    @AutoLog(value = "药剂占比统计列表 type 1.按明细 2.按类型")
    @ApiOperation(value = "药剂占比统计列表 type 1.按明细 2.按类型", notes = "药剂占比统计列表 type 1.按明细 2.按类型")
    @RequestMapping(value = "/proportion/statistics/detail", method = RequestMethod.GET)
    public Result<Map<String, Object>> proportionStatisticsDetail(String time,Integer type) {
        Result<Map<String, Object>> result = new Result<>();
        Map<String, Object> data = drugConsumptionAnalysisService.proportionStatisticsDetail(time,type);
        result.setResult(data);
        result.setSuccess(true);
        return result;
    }

    @AutoLog(value = "相关性分析 type 1.絮凝剂 2.碳源 3.除磷剂")
    @ApiOperation(value = "相关性分析 type 1.絮凝剂 2.碳源 3.除磷剂", notes = "相关性分析 type 1.絮凝剂 2.碳源 3.除磷剂")
    @RequestMapping(value = "/correlation/analysis", method = RequestMethod.GET)
    public Result<Map<String, Object>> correlationAnalysis(String time,Integer type) {
        Result<Map<String, Object>> result = new Result<>();
        Map<String, Object> data = drugConsumptionAnalysisService.correlationAnalysis(time,type);
        result.setResult(data);
        result.setSuccess(true);
        return result;
    }

    @AutoLog(value = "总药耗趋势详情")
    @ApiOperation(value = "总药耗趋势详情", notes = "总药耗趋势详情")
    @RequestMapping(value = "/drug/consumption/trend/detail", method = RequestMethod.GET)
    public Result<Map<String, Object>> drugConsumptionTrendDetail(DrugDto drugDto) {
        Result<Map<String, Object>> result = new Result<>();
        Map<String, Object> data = drugConsumptionAnalysisService.drugConsumptionTrendDetail(drugDto);
        result.setResult(data);
        result.setSuccess(true);
        return result;
    }

    @AutoLog(value = "相关性分析药剂明细 type 1.絮凝剂 2.碳源 3.除磷剂")
    @ApiOperation(value = "相关性分析药剂明细 type 1.絮凝剂 2.碳源 3.除磷剂", notes = "相关性分析药剂明细 type 1.絮凝剂 2.碳源 3.除磷剂")
    @RequestMapping(value = "/correlation/analysis/detail", method = RequestMethod.GET)
    public Result<Map<String, Object>> correlationAnalysisDetail(String time,Integer type) {
        Result<Map<String, Object>> result = new Result<>();
        Map<String, Object> data = drugConsumptionAnalysisService.correlationAnalysisDetail(time,type);
        result.setResult(data);
        result.setSuccess(true);
        return result;
    }
}