| | |
| | | CellRangeAddress region25 = new CellRangeAddress(1, 1, 18, 24); |
| | | sheet.addMergedRegion(region25); |
| | | |
| | | //第三行的合并列,前两个单元模块是固定的,其中1个合并单元 |
| | | //第三行,第五行,第六行的合并列,前两个单元模块是固定的,其中1个合并单元 |
| | | CellRangeAddress region31 = new CellRangeAddress(2, 2, 2, 3); |
| | | CellRangeAddress region51 = new CellRangeAddress(4, 4, 2, 3); |
| | | CellRangeAddress region61 = new CellRangeAddress(5, 5, 2, 3); |
| | | sheet.addMergedRegion(region31); |
| | | sheet.addMergedRegion(region51); |
| | | sheet.addMergedRegion(region61); |
| | | |
| | | |
| | | // 创建居中样式 |
| | |
| | | //第四行是电压列和温度列标识 |
| | | XSSFRow row2 = sheet.createRow(2); |
| | | XSSFRow row3 = sheet.createRow(3); |
| | | XSSFRow row4 = sheet.createRow(4); |
| | | XSSFRow row5 = sheet.createRow(5); |
| | | |
| | | row2.createCell(0).setCellValue("蓄电池号(#)"); |
| | | row2.createCell(1).setCellValue("蓄电池浮充电压值(V)"); |
| | | row2.createCell(2).setCellValue("放电前蓄电池开路电压值(V)"); |
| | |
| | | if(dischargeColumnCount > 0){ |
| | | row2.createCell(5).setCellValue("放电0.5h蓄电池电压值(V)"); |
| | | CellRangeAddress region33 = new CellRangeAddress(2, 2, 4, 5); |
| | | CellRangeAddress region53 = new CellRangeAddress(4, 4, 4, 5); |
| | | CellRangeAddress region63 = new CellRangeAddress(5, 5, 4, 5); |
| | | |
| | | sheet.addMergedRegion(region33); |
| | | sheet.addMergedRegion(region53); |
| | | sheet.addMergedRegion(region63); |
| | | |
| | | row3.createCell(4).setCellValue("0.5(电压)"); |
| | | row3.createCell(5).setCellValue("0.5(温度)"); |
| | | columnIndex+=2; |
| | | if(dischargeColumnCount > 2){ //合并单元格了,所以索引+2 |
| | | row2.createCell(7).setCellValue("放电1h蓄电池电压值(V)"); |
| | | CellRangeAddress region34 = new CellRangeAddress(2, 2, 6, 7); |
| | | CellRangeAddress region54 = new CellRangeAddress(4, 2, 6, 7); |
| | | CellRangeAddress region64 = new CellRangeAddress(5, 2, 6, 7); |
| | | |
| | | sheet.addMergedRegion(region34); |
| | | sheet.addMergedRegion(region54); |
| | | sheet.addMergedRegion(region64); |
| | | |
| | | row3.createCell(6).setCellValue("1(电压)"); |
| | | row3.createCell(7).setCellValue("1(温度)"); |
| | | columnIndex+=2; |
| | |
| | | rowTemp.createCell(0).setCellValue("总电流"); |
| | | } |
| | | else if(j<106) { |
| | | rowTemp.createCell(0).setCellValue((j + 1) + "#"); |
| | | rowTemp.createCell(0).setCellValue((j - 1) + "#"); |
| | | }else{ |
| | | if(j == 106){ |
| | | rowTemp.createCell(0).setCellValue("单节平均电压"); |
| | |
| | | if(j == 0){ |
| | | rowTemp.createCell(1).setCellValue(fcVolList.get(j).getGroupVol()); |
| | | rowTemp.createCell(2).setCellValue(preVolList.get(j).getGroupVol()); |
| | | rowTemp.createCell(3); |
| | | }else if (j == 1){ |
| | | rowTemp.createCell(1).setCellValue(fcVolList.get(j).getGroupCurr()); |
| | | rowTemp.createCell(2).setCellValue(preVolList.get(j).getGroupCurr()); |
| | | rowTemp.createCell(3); |
| | | }else { |
| | | rowTemp.createCell(1).setCellValue(fcVolList.get(j).getMonVol()); |
| | | |
| | | rowTemp.createCell(2).setCellValue(preVolList.get(j).getMonVol()); |
| | | rowTemp.createCell(3).setCellValue(preVolList.get(j).getMonTmp()); |
| | | } |
| | |
| | | //时间在测试开始时间+0.5h |
| | | dischargeCalendar.add(Calendar.MINUTE,30); |
| | | Date recordTime = dischargeCalendar.getTime(); |
| | | List<BattRealTimeDataHistory> dischargeListOne = battRTDataHisService.getRecordList(battGroupId,recordTime); |
| | | List<BattRealTimeDataHistory> dischargeListOne = new ArrayList<>(); |
| | | List<BattRealTimeDataHistory> dischargeListOneOriginal = battRTDataHisService.getRecordList(battGroupId,recordTime); |
| | | //按单体编号排序,按编号升序 |
| | | dischargeListOne.sort(Comparator.comparingInt(BattRealTimeDataHistory::getMonNum)); |
| | | addStatistics(dischargeListOne,"vol"); |
| | | dischargeListOneOriginal.sort(Comparator.comparingInt(BattRealTimeDataHistory::getMonNum)); |
| | | addStatistics(dischargeListOneOriginal,"vol"); |
| | | //总电流总电压列入 |
| | | |
| | | |
| | | //rowTemp.createCell(5).setCellValue("放电0.5h电压值(V):"+(j+1)+"#"); |
| | | //rowTemp.createCell(6).setCellValue("放电0.5h温度值:"+(j+1)+"#"); |
| | | rowTemp.createCell(4).setCellValue(dischargeListOne.get(j).getMonVol()); |