59f25509 康伟

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

1 个父辈 a1f8032c
......@@ -9,6 +9,7 @@ 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;
......@@ -67,8 +68,8 @@ public class DrugConsumptionAnalysisController {
@GetMapping("/correlation/analysisType")
public Result<List<DrugConsumptionDisplayVO>> analysisType() {
Result<List<DrugConsumptionDisplayVO>> result = new Result<>();
List<DrugConsumptionDisplayVO> data = drugConsumptionAnalysisService.analysisType();
result.setResult(data);
List<DrugConsumptionDisplayVO> dataList = drugConsumptionAnalysisService.analysisType();
result.setResult(dataList);
return result;
}
@AutoLog(value = "相关性分析")
......@@ -76,8 +77,18 @@ public class DrugConsumptionAnalysisController {
@GetMapping("/correlation/analysis")
public Result<List<CorrelationAnalysisVO>> correlationAnalysis(String time, String drugCode, String departId) {
Result<List<CorrelationAnalysisVO>> result = new Result<>();
List<CorrelationAnalysisVO> data = drugConsumptionAnalysisService.correlationAnalysis(time,drugCode ,departId);
result.setResult(data);
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;
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!