|
|
|
|
@ -27,11 +27,29 @@ public class ExamineReagentServiceImpl implements IExamineReagentService { |
|
|
|
|
public Map<String, List<ExamineExcel>> getGroupExcelData(int group, List<ExamineExcel> excelData) { |
|
|
|
|
Map<String, List<ExamineExcel>> groupExcelData = new HashMap<>(); |
|
|
|
|
|
|
|
|
|
// for (int i = 0; i < group; i++) {
|
|
|
|
|
// List<ExamineExcel> excels = new ArrayList<>();
|
|
|
|
|
// for (int j = i * 8 + i; j < (i + 1) * 8 + i; j++) {
|
|
|
|
|
// ExamineExcel excel = excelData.get(j);
|
|
|
|
|
// excels.add(excel);
|
|
|
|
|
// }
|
|
|
|
|
// groupExcelData.put((i + 1) + "", excels);
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// 有效数据最大索引
|
|
|
|
|
int maxIndex = excelData.size() - 1; |
|
|
|
|
for (int i = 0; i < group; i++) { |
|
|
|
|
List<ExamineExcel> excels = new ArrayList<>(); |
|
|
|
|
for (int j = i * 8 + i; j < (i + 1) * 8 + i; j++) { |
|
|
|
|
ExamineExcel excel = excelData.get(j); |
|
|
|
|
excels.add(excel); |
|
|
|
|
//每组起始、结束索引(你的原逻辑)
|
|
|
|
|
int start = i * 8 + i; |
|
|
|
|
int end = (i + 1) * 8 + i; |
|
|
|
|
|
|
|
|
|
for (int j = start; j < end; j++) { |
|
|
|
|
//超出数据范围就停止,不报错
|
|
|
|
|
if (j > maxIndex) { |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
excels.add(excelData.get(j)); |
|
|
|
|
} |
|
|
|
|
groupExcelData.put((i + 1) + "", excels); |
|
|
|
|
} |
|
|
|
|
|