DrugConsumptionAnalysisController.java
9.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
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.service.IDrugConsumptionAnalysisService;
import com.skua.modules.equipment.vo.CorrelationAnalysisVO;
import com.skua.modules.equipment.vo.DrugConsumptionDisplayVO;
import com.skua.modules.equipment.vo.DrugConsumptionTrendChartVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@Slf4j
@Api(tags = "药耗分析")
@RestController
@RequestMapping("/drug/consumption/analysis")
public class DrugConsumptionAnalysisController {
@Autowired
private IDrugConsumptionAnalysisService drugConsumptionAnalysisService;
@AutoLog(value = "数据展示")
@ApiOperation(value = "数据展示", notes = "数据展示")
@GetMapping("/data/display")
public Result<DrugConsumptionDisplayVO> dataDisplay(String time, String departId) {
Result<DrugConsumptionDisplayVO> result = new Result<>();
DrugConsumptionDisplayVO data = drugConsumptionAnalysisService.dataDisplay(time,departId);
result.setResult(data);
return result;
}
// 2411112:总药耗趋势 --->吨水药费
@AutoLog(value = "总药耗趋势")
@ApiOperation(value = "总药耗趋势", notes = "总药耗趋势")
@GetMapping("/data/drugConsumptionTrend")
public Result<List<DrugConsumptionTrendChartVO>> drugConsumptionTrend(String time, String departId) {
Result<List<DrugConsumptionTrendChartVO>> result = new Result<>();
List<DrugConsumptionTrendChartVO> data = drugConsumptionAnalysisService.drugConsumptionTrend(time,departId);
result.setResult(data);
return result;
}
@AutoLog(value = "吨水药耗趋势")
@ApiOperation(value = "吨水药耗趋势", notes = "吨水药耗趋势")
@GetMapping("/data/consumptionTonOfWaterTrend")
public Result<List<DrugConsumptionTrendChartVO>> consumptionTonOfWaterTrend(String time, String departId) {
Result<List<DrugConsumptionTrendChartVO>> result = new Result<>();
List<DrugConsumptionTrendChartVO> data = drugConsumptionAnalysisService.consumptionTonOfWaterTrend(time,departId);
result.setResult(data);
return result;
}
@AutoLog(value = "药剂占比统计")
@ApiOperation(value = "药剂占比统计 type 1.按明细 2.按类型", notes = "药剂占比统计 type 1.按明细 2.按类型")
@GetMapping("/data/proportionStatistics")
public Result<List<DrugConsumptionDisplayVO>> proportionStatistics(String time, String departId) {
Result<List<DrugConsumptionDisplayVO>> result = new Result<>();
List<DrugConsumptionDisplayVO> data = drugConsumptionAnalysisService.proportionStatistics(time ,departId);
result.setResult(data);
return result;
}
@AutoLog(value = "相关性分析")
@ApiOperation(value = "相关性分析 统计类型下拉框", notes = "相关性分析 统计类型下拉框")
@GetMapping("/correlation/analysisType")
public Result<List<DrugConsumptionDisplayVO>> analysisType() {
Result<List<DrugConsumptionDisplayVO>> result = new Result<>();
List<DrugConsumptionDisplayVO> dataList = drugConsumptionAnalysisService.analysisType();
result.setResult(dataList);
return result;
}
@AutoLog(value = "相关性分析")
@ApiOperation(value = "相关性分析 type 1.絮凝剂 2.碳源 3.除磷剂", notes = "相关性分析 type 1.絮凝剂 2.碳源 3.除磷剂")
@GetMapping("/correlation/analysis")
public Result<List<CorrelationAnalysisVO>> correlationAnalysis(String time, String drugCode, String departId) {
Result<List<CorrelationAnalysisVO>> result = new Result<>();
if(StringUtils.isEmpty(drugCode)){
List<DrugConsumptionDisplayVO> dataList = drugConsumptionAnalysisService.analysisType();
if(dataList != null && !dataList.isEmpty() ){
drugCode = dataList.get(0).getDrugCode();
}
}
if(StringUtils.isEmpty(drugCode)){
result.error500("参数不识别");
}else{
List<CorrelationAnalysisVO> list = drugConsumptionAnalysisService.correlationAnalysis(time,drugCode ,departId);
result.setResult(list);
}
return result;
}
/* @AutoLog(value = "数据展示")
@ApiOperation(value = "数据展示", notes = "数据展示")
@RequestMapping(value = "/data/display", method = RequestMethod.GET)
public Result<Map<String, Object>> dataDisplay(String time,String departId) {
Result<Map<String, Object>> result = new Result<>();
Map<String, Object> data = drugConsumptionAnalysisService.dataDisplay(time,departId);
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,String departId) {
Result<Map<String, Object>> result = new Result<>();
Map<String, Object> data = drugConsumptionAnalysisService.drugConsumptionTrend(time,departId);
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 ,String departId) {
Result<Map<String, Object>> result = new Result<>();
Map<String, Object> data = drugConsumptionAnalysisService.consumptionTonOfWaterTrend(time ,departId);
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,String departId) {
Result<Map<String, Object>> result = new Result<>();
Map<String, Object> data = drugConsumptionAnalysisService.proportionStatistics(time,type,departId);
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,String departId) {
Result<Map<String, Object>> result = new Result<>();
Map<String, Object> data = drugConsumptionAnalysisService.proportionStatisticsDetail(time,type,departId);
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,String departId) {
Result<Map<String, Object>> result = new Result<>();
Map<String, Object> data = drugConsumptionAnalysisService.correlationAnalysis(time,type ,departId);
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,String departId) {
Result<Map<String, Object>> result = new Result<>();
Map<String, Object> data = drugConsumptionAnalysisService.correlationAnalysisDetail(time,type ,departId);
result.setResult(data);
result.setSuccess(true);
return result;
}*/
}