59f25509 康伟

kangwei :药耗分析,参数为空,设置默认参数

1 个父辈 a1f8032c
...@@ -9,6 +9,7 @@ import com.skua.modules.equipment.vo.DrugConsumptionTrendChartVO; ...@@ -9,6 +9,7 @@ import com.skua.modules.equipment.vo.DrugConsumptionTrendChartVO;
9 import io.swagger.annotations.Api; 9 import io.swagger.annotations.Api;
10 import io.swagger.annotations.ApiOperation; 10 import io.swagger.annotations.ApiOperation;
11 import lombok.extern.slf4j.Slf4j; 11 import lombok.extern.slf4j.Slf4j;
12 import org.apache.commons.lang3.StringUtils;
12 import org.springframework.beans.factory.annotation.Autowired; 13 import org.springframework.beans.factory.annotation.Autowired;
13 import org.springframework.web.bind.annotation.GetMapping; 14 import org.springframework.web.bind.annotation.GetMapping;
14 import org.springframework.web.bind.annotation.RequestMapping; 15 import org.springframework.web.bind.annotation.RequestMapping;
...@@ -67,8 +68,8 @@ public class DrugConsumptionAnalysisController { ...@@ -67,8 +68,8 @@ public class DrugConsumptionAnalysisController {
67 @GetMapping("/correlation/analysisType") 68 @GetMapping("/correlation/analysisType")
68 public Result<List<DrugConsumptionDisplayVO>> analysisType() { 69 public Result<List<DrugConsumptionDisplayVO>> analysisType() {
69 Result<List<DrugConsumptionDisplayVO>> result = new Result<>(); 70 Result<List<DrugConsumptionDisplayVO>> result = new Result<>();
70 List<DrugConsumptionDisplayVO> data = drugConsumptionAnalysisService.analysisType(); 71 List<DrugConsumptionDisplayVO> dataList = drugConsumptionAnalysisService.analysisType();
71 result.setResult(data); 72 result.setResult(dataList);
72 return result; 73 return result;
73 } 74 }
74 @AutoLog(value = "相关性分析") 75 @AutoLog(value = "相关性分析")
...@@ -76,8 +77,18 @@ public class DrugConsumptionAnalysisController { ...@@ -76,8 +77,18 @@ public class DrugConsumptionAnalysisController {
76 @GetMapping("/correlation/analysis") 77 @GetMapping("/correlation/analysis")
77 public Result<List<CorrelationAnalysisVO>> correlationAnalysis(String time, String drugCode, String departId) { 78 public Result<List<CorrelationAnalysisVO>> correlationAnalysis(String time, String drugCode, String departId) {
78 Result<List<CorrelationAnalysisVO>> result = new Result<>(); 79 Result<List<CorrelationAnalysisVO>> result = new Result<>();
79 List<CorrelationAnalysisVO> data = drugConsumptionAnalysisService.correlationAnalysis(time,drugCode ,departId); 80 if(StringUtils.isEmpty(drugCode)){
80 result.setResult(data); 81 List<DrugConsumptionDisplayVO> dataList = drugConsumptionAnalysisService.analysisType();
82 if(dataList != null && !dataList.isEmpty() ){
83 drugCode = dataList.get(0).getDrugCode();
84 }
85 }
86 if(StringUtils.isEmpty(drugCode)){
87 result.error500("参数不识别");
88 }else{
89 List<CorrelationAnalysisVO> list = drugConsumptionAnalysisService.correlationAnalysis(time,drugCode ,departId);
90 result.setResult(list);
91 }
81 return result; 92 return result;
82 } 93 }
83 94
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!