Commit 0b1f56cc by wangweidong

土工试验修改

parent d6d63194
...@@ -41,6 +41,8 @@ import com.patzn.poibox.xwpf.HSSFWorkbookUtil; ...@@ -41,6 +41,8 @@ import com.patzn.poibox.xwpf.HSSFWorkbookUtil;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.BorderStyle;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.HorizontalAlignment; import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.poi.ss.usermodel.VerticalAlignment; import org.apache.poi.ss.usermodel.VerticalAlignment;
import org.apache.poi.ss.util.CellRangeAddress; import org.apache.poi.ss.util.CellRangeAddress;
...@@ -917,6 +919,12 @@ public class SoilEntrustServiceImpl extends BaseServiceImpl<SoilEntrustMapper, S ...@@ -917,6 +919,12 @@ public class SoilEntrustServiceImpl extends BaseServiceImpl<SoilEntrustMapper, S
xssfCellStyle.setVerticalAlignment(VerticalAlignment.CENTER); xssfCellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
xssfCellStyle.setAlignment(HorizontalAlignment.CENTER); xssfCellStyle.setAlignment(HorizontalAlignment.CENTER);
soilSampleService.initItemInfo(sampleList); soilSampleService.initItemInfo(sampleList);
CellStyle cellStyle = xssfWorkbook.createCellStyle();
cellStyle.setAlignment(HorizontalAlignment.LEFT);
cellStyle.setBorderBottom(BorderStyle.NONE);
cellStyle.setBorderLeft(BorderStyle.NONE);
cellStyle.setBorderTop(BorderStyle.NONE);
cellStyle.setBorderRight(BorderStyle.NONE);
int index = 7; int index = 7;
int length = sampleList.size(); int length = sampleList.size();
if (length<=10){ if (length<=10){
...@@ -984,6 +992,33 @@ public class SoilEntrustServiceImpl extends BaseServiceImpl<SoilEntrustMapper, S ...@@ -984,6 +992,33 @@ public class SoilEntrustServiceImpl extends BaseServiceImpl<SoilEntrustMapper, S
} }
int rowNum = sheet.getLastRowNum();
int beginNum= index+1;
for (int m=beginNum;m<rowNum;m++){
if (m+1>rowNum){
continue;
}
XSSFRow row = sheet.getRow(m);
XSSFCell cell = row.getCell(0);
String num= HSSFWorkbookUtil.getJavaValue(cell).toString();
if (num.contains("0")){
sheet.shiftRows(m+1,sheet.getLastRowNum(),1,true,false);
XSSFRow footRow= sheet.createRow(m+1);
footRow.setHeight(row7.getHeight());
for (int j = 0; j < 12; j++) {
XSSFCell footRowCell= footRow.createCell(j);
footRowCell.setCellStyle(cellStyle);
}
CellRangeAddress region1 = new CellRangeAddress(m+1, m+1, 0, 11);
sheet.addMergedRegion(region1);
XSSFCell foot= footRow.getCell(0);
foot.setCellStyle(cellStyle);
foot .setCellValue("开土人: 记录人: 校核人: ");
}
}
exportService.downloadXlsx(response,entrust.getBoreholeName()+".xlsx",xssfWorkbook); exportService.downloadXlsx(response,entrust.getBoreholeName()+".xlsx",xssfWorkbook);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment