|
|
@ -25,6 +25,7 @@ import java.util.ArrayList; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
import java.util.concurrent.atomic.AtomicReference; |
|
|
|
import java.util.function.Function; |
|
|
|
import java.util.function.Function; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
|
@ -50,9 +51,9 @@ public class DrugHandingOverStatisticServiceImpl implements DrugHandingOverStati |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public DrugStatisticVO statistic(DrugStatisticQuery query) { |
|
|
|
public DrugStatisticVO statistic(DrugStatisticQuery query) { |
|
|
|
List<List<Object>> lineChartData = buildLineChartData(query); |
|
|
|
|
|
|
|
List<List<Object>> barChartData = buildBarChartData(query); |
|
|
|
|
|
|
|
DrugStatisticVO drugStatisticVO = new DrugStatisticVO(); |
|
|
|
DrugStatisticVO drugStatisticVO = new DrugStatisticVO(); |
|
|
|
|
|
|
|
List<List<Object>> lineChartData = buildLineChartData(query, drugStatisticVO); |
|
|
|
|
|
|
|
List<List<Object>> barChartData = buildBarChartData(query, drugStatisticVO); |
|
|
|
drugStatisticVO.setBarChartDataList(barChartData); |
|
|
|
drugStatisticVO.setBarChartDataList(barChartData); |
|
|
|
drugStatisticVO.setLineChartDataList(lineChartData); |
|
|
|
drugStatisticVO.setLineChartDataList(lineChartData); |
|
|
|
return drugStatisticVO; |
|
|
|
return drugStatisticVO; |
|
|
@ -60,10 +61,12 @@ public class DrugHandingOverStatisticServiceImpl implements DrugHandingOverStati |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 构建柱状图的数据 |
|
|
|
* 构建柱状图的数据 |
|
|
|
|
|
|
|
* |
|
|
|
* @param query |
|
|
|
* @param query |
|
|
|
|
|
|
|
* @param drugStatisticVO |
|
|
|
* @return |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private List<List<Object>> buildBarChartData(DrugStatisticQuery query) { |
|
|
|
private void buildBarChartData(DrugStatisticQuery query, DrugStatisticVO drugStatisticVO) { |
|
|
|
List<List<Object>> barChartData = new ArrayList<>(); |
|
|
|
List<List<Object>> barChartData = new ArrayList<>(); |
|
|
|
List<Object> orgNameList = new ArrayList<>(); |
|
|
|
List<Object> orgNameList = new ArrayList<>(); |
|
|
|
List<Object> dataList = new ArrayList<>(); |
|
|
|
List<Object> dataList = new ArrayList<>(); |
|
|
@ -95,21 +98,26 @@ public class DrugHandingOverStatisticServiceImpl implements DrugHandingOverStati |
|
|
|
List<DrugMaterialInfoVO> voList = groupByHandingOverOrgMap.get(orgId); |
|
|
|
List<DrugMaterialInfoVO> voList = groupByHandingOverOrgMap.get(orgId); |
|
|
|
if (CollUtil.isNotEmpty(voList)) { |
|
|
|
if (CollUtil.isNotEmpty(voList)) { |
|
|
|
orgNameList.add(sysOrg.getAlias()); |
|
|
|
orgNameList.add(sysOrg.getAlias()); |
|
|
|
dataList.add(voList.size()); |
|
|
|
int size = voList.size(); |
|
|
|
|
|
|
|
dataList.add(size); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
barChartData.add(orgNameList); |
|
|
|
barChartData.add(orgNameList); |
|
|
|
barChartData.add(dataList); |
|
|
|
barChartData.add(dataList); |
|
|
|
return barChartData; |
|
|
|
drugStatisticVO.setBarChartDataSum(dataList.stream().mapToInt(obj -> (Integer) obj).sum()); |
|
|
|
|
|
|
|
drugStatisticVO.setBarChartDataList(barChartData); |
|
|
|
|
|
|
|
// return barChartData;
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 构建折线图的数据 |
|
|
|
* 构建折线图的数据 |
|
|
|
|
|
|
|
* |
|
|
|
* @param query |
|
|
|
* @param query |
|
|
|
|
|
|
|
* @param drugStatisticVO |
|
|
|
* @return |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private List<List<Object>> buildLineChartData(DrugStatisticQuery query) { |
|
|
|
private void buildLineChartData(DrugStatisticQuery query, DrugStatisticVO drugStatisticVO) { |
|
|
|
List<List<Object>> lineChartData = new ArrayList<>(); // 存储结果值
|
|
|
|
List<List<Object>> lineChartData = new ArrayList<>(); // 存储结果值
|
|
|
|
List<Object> monthsList = new ArrayList<>(); // 存储月份
|
|
|
|
List<Object> monthsList = new ArrayList<>(); // 存储月份
|
|
|
|
List<Object> dataList = new ArrayList<>(); // 对应月份送缴的数量
|
|
|
|
List<Object> dataList = new ArrayList<>(); // 对应月份送缴的数量
|
|
|
@ -143,7 +151,8 @@ public class DrugHandingOverStatisticServiceImpl implements DrugHandingOverStati |
|
|
|
} |
|
|
|
} |
|
|
|
lineChartData.add(monthsList); |
|
|
|
lineChartData.add(monthsList); |
|
|
|
lineChartData.add(dataList); |
|
|
|
lineChartData.add(dataList); |
|
|
|
return lineChartData; |
|
|
|
drugStatisticVO.setLineChartDataSum(dataList.stream().mapToInt(obj -> (Integer) obj).sum()); |
|
|
|
|
|
|
|
drugStatisticVO.setLineChartDataList(lineChartData); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|