|
@@ -356,28 +356,6 @@ public class StatisticsApiServiceImpl implements StatisticsApiService {
|
|
|
}
|
|
}
|
|
|
// ------------------------ 第二个sheet---------------------------------------------
|
|
// ------------------------ 第二个sheet---------------------------------------------
|
|
|
List<MaterialsStatusStatisticsVO> materialsStatusStatistics = getMaterialsStatusStatistics(startTime, endTime);
|
|
List<MaterialsStatusStatisticsVO> materialsStatusStatistics = getMaterialsStatusStatistics(startTime, endTime);
|
|
|
- List<MaterialsChangeStatisticsVO> materialsChangeStatistics = getMaterialsChangeStatistics(startTime, endTime);
|
|
|
|
|
- ArrayList<ExportMaterialsStatusStatisticsVO> exportMaterialsStatusStatisticsVOS = new ArrayList<>();
|
|
|
|
|
- for (MaterialsStatusStatisticsVO materialsStatusStatistic : materialsStatusStatistics) {
|
|
|
|
|
- ExportMaterialsStatusStatisticsVO vo = new ExportMaterialsStatusStatisticsVO();
|
|
|
|
|
- vo.setMaterialsTypeId(materialsStatusStatistic.getMaterialsTypeId());
|
|
|
|
|
- vo.setMaterialsTypeName(materialsStatusStatistic.getMaterialsTypeName());
|
|
|
|
|
- vo.setAllCount(materialsStatusStatistic.getAllCount());
|
|
|
|
|
- vo.setWillExpireCount(materialsStatusStatistic.getWillExpireCount());
|
|
|
|
|
- vo.setExpiredCount(materialsStatusStatistic.getExpiredCount());
|
|
|
|
|
- vo.setBadCount(materialsStatusStatistic.getBadCount());
|
|
|
|
|
- vo.setAllChangeCount(0);
|
|
|
|
|
- vo.setExpireChangeCount(0);
|
|
|
|
|
- vo.setBadChangeCount(0);
|
|
|
|
|
- for (MaterialsChangeStatisticsVO materialsChangeStatistic : materialsChangeStatistics) {
|
|
|
|
|
- if (materialsChangeStatistic.getMaterialsTypeId().equals(materialsStatusStatistic.getMaterialsTypeId())) {
|
|
|
|
|
- vo.setAllChangeCount(materialsChangeStatistic.getAllCount());
|
|
|
|
|
- vo.setExpireChangeCount(materialsChangeStatistic.getExpireCount());
|
|
|
|
|
- vo.setBadChangeCount(materialsChangeStatistic.getBadCount());
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- exportMaterialsStatusStatisticsVOS.add(vo);
|
|
|
|
|
- }
|
|
|
|
|
// 数据承载
|
|
// 数据承载
|
|
|
ArrayList<List<String>> lists1 = new ArrayList<>();
|
|
ArrayList<List<String>> lists1 = new ArrayList<>();
|
|
|
// 构造第一行
|
|
// 构造第一行
|
|
@@ -386,20 +364,14 @@ public class StatisticsApiServiceImpl implements StatisticsApiService {
|
|
|
one1.add("即将过期");
|
|
one1.add("即将过期");
|
|
|
one1.add("已过期");
|
|
one1.add("已过期");
|
|
|
one1.add("损坏数");
|
|
one1.add("损坏数");
|
|
|
- one1.add("正常更换次数");
|
|
|
|
|
- one1.add("过期更换次数");
|
|
|
|
|
- one1.add("损坏更换次数");
|
|
|
|
|
lists1.add(one1);
|
|
lists1.add(one1);
|
|
|
// 构造其他行
|
|
// 构造其他行
|
|
|
- for (ExportMaterialsStatusStatisticsVO vo : exportMaterialsStatusStatisticsVOS) {
|
|
|
|
|
|
|
+ for (MaterialsStatusStatisticsVO vo : materialsStatusStatistics) {
|
|
|
List<String> other = new ArrayList<>();
|
|
List<String> other = new ArrayList<>();
|
|
|
other.add(vo.getMaterialsTypeName());
|
|
other.add(vo.getMaterialsTypeName());
|
|
|
other.add(String.valueOf(vo.getWillExpireCount()));
|
|
other.add(String.valueOf(vo.getWillExpireCount()));
|
|
|
other.add(String.valueOf(vo.getExpiredCount()));
|
|
other.add(String.valueOf(vo.getExpiredCount()));
|
|
|
other.add(String.valueOf(vo.getBadCount()));
|
|
other.add(String.valueOf(vo.getBadCount()));
|
|
|
- other.add(String.valueOf(vo.getAllChangeCount()));
|
|
|
|
|
- other.add(String.valueOf(vo.getExpireChangeCount()));
|
|
|
|
|
- other.add(String.valueOf(vo.getBadChangeCount()));
|
|
|
|
|
lists1.add(other);
|
|
lists1.add(other);
|
|
|
}
|
|
}
|
|
|
SXSSFSheet sheet1 = workbook.createSheet("物资统计");
|
|
SXSSFSheet sheet1 = workbook.createSheet("物资统计");
|
|
@@ -410,6 +382,34 @@ public class StatisticsApiServiceImpl implements StatisticsApiService {
|
|
|
row.createCell(j).setCellValue(lists1.get(i).get(j));
|
|
row.createCell(j).setCellValue(lists1.get(i).get(j));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ // ------------------------ 第三个sheet---------------------------------------------
|
|
|
|
|
+ List<MaterialsChangeStatisticsVO> materialsChangeStatistics = getMaterialsChangeStatistics(startTime, endTime);
|
|
|
|
|
+ // 数据承载
|
|
|
|
|
+ ArrayList<List<String>> lists2 = new ArrayList<>();
|
|
|
|
|
+ // 构造第一行
|
|
|
|
|
+ List<String> one2 = new ArrayList<>();
|
|
|
|
|
+ one2.add("物资");
|
|
|
|
|
+ one2.add("正常更换次数");
|
|
|
|
|
+ one2.add("过期更换次数");
|
|
|
|
|
+ one2.add("损坏更换次数");
|
|
|
|
|
+ lists2.add(one2);
|
|
|
|
|
+ // 构造其他行
|
|
|
|
|
+ for (MaterialsChangeStatisticsVO vo : materialsChangeStatistics) {
|
|
|
|
|
+ List<String> other = new ArrayList<>();
|
|
|
|
|
+ other.add(vo.getMaterialsTypeName());
|
|
|
|
|
+ other.add(String.valueOf(vo.getAllCount()));
|
|
|
|
|
+ other.add(String.valueOf(vo.getExpireCount()));
|
|
|
|
|
+ other.add(String.valueOf(vo.getBadCount()));
|
|
|
|
|
+ lists2.add(other);
|
|
|
|
|
+ }
|
|
|
|
|
+ SXSSFSheet sheet2 = workbook.createSheet("物资更换统计");
|
|
|
|
|
+ for (int i = 0; i < lists2.size(); i++) {
|
|
|
|
|
+ sheet2.setColumnWidth(i, 5000);
|
|
|
|
|
+ SXSSFRow row = sheet2.createRow(i);
|
|
|
|
|
+ for (int j = 0; j < lists2.get(i).size(); j++) {
|
|
|
|
|
+ row.createCell(j).setCellValue(lists2.get(i).get(j));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
fileOutputStream(request, response, workbook, fileName);
|
|
fileOutputStream(request, response, workbook, fileName);
|
|
|
}
|
|
}
|
|
|
|
|
|