| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.inspect.util; |
| | | |
| | | import org.apache.poi.xwpf.usermodel.XWPFParagraph; |
| | | import org.apache.poi.xwpf.usermodel.XWPFRun; |
| | | import org.apache.poi.xwpf.usermodel.XWPFTable; |
| | | import org.apache.poi.xwpf.usermodel.XWPFTableCell; |
| | | import org.apache.poi.xwpf.usermodel.XWPFTableRow; |
| | | |
| | | /** æ¥åç»æè¡¨åºå·ä½¿ç¨æ®éæåï¼é¿å
æ¸²ææ¶äº§çé»è®¤ä¸å线ã */ |
| | | public class ReportResultTableRenderPolicy extends HackLoopTableRenderPolicy { |
| | | |
| | | public ReportResultTableRenderPolicy() { |
| | | super(true); |
| | | } |
| | | |
| | | @Override |
| | | protected void afterloop(XWPFTable table, Object data) { |
| | | for (XWPFTableRow row : table.getRows()) { |
| | | XWPFTableCell cell = row.getCell(0); |
| | | if (cell == null || !cell.getText().trim().matches("\\d+")) { |
| | | continue; |
| | | } |
| | | for (XWPFParagraph paragraph : cell.getParagraphs()) { |
| | | for (XWPFRun run : paragraph.getRuns()) { |
| | | if (run.getCTR().isSetRPr()) { |
| | | while (run.getCTR().getRPr().sizeOfUArray() > 0) { |
| | | run.getCTR().getRPr().removeU(0); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |