diff --git a/laws-modules/src/main/java/com/jero/modules/assessmentLibrary/service/impl/LawsConformityAssessmentLibraryServiceImpl.java b/laws-modules/src/main/java/com/jero/modules/assessmentLibrary/service/impl/LawsConformityAssessmentLibraryServiceImpl.java index ee29a0f4..0508c819 100644 --- a/laws-modules/src/main/java/com/jero/modules/assessmentLibrary/service/impl/LawsConformityAssessmentLibraryServiceImpl.java +++ b/laws-modules/src/main/java/com/jero/modules/assessmentLibrary/service/impl/LawsConformityAssessmentLibraryServiceImpl.java @@ -16,6 +16,7 @@ import com.jero.modules.assessmentLibrary.entity.LawsConformityAssessmentLibrary import com.jero.modules.assessmentLibrary.entity.LawsConformityAssessmentLibraryDetail; import com.jero.modules.assessmentLibrary.entity.vo.LawsConformityAssessmentLibraryExportVO; import com.jero.modules.assessmentLibrary.entity.vo.MaterialFile; +import com.jero.modules.assessmentLibrary.entity.vo.UnsatisfiedRequireAttachFile; import com.jero.modules.assessmentLibrary.mapper.LawsConformityAssessmentLibraryMapper; import com.jero.modules.assessmentLibrary.service.ILawsConformityAssessmentLibraryService; import com.jero.modules.laws.enterprise.util.BeanCopyUtils; @@ -89,7 +90,8 @@ public class LawsConformityAssessmentLibraryServiceImpl extends ServiceImpl 0", splitStr); } } if (StringUtils.isNotBlank(lawsConformityAssessmentLibrary.getSelections())) { @@ -180,6 +182,7 @@ public class LawsConformityAssessmentLibraryServiceImpl extends ServiceImpl String regex = "<[^>]*>"; @@ -198,6 +201,7 @@ public class LawsConformityAssessmentLibraryServiceImpl extends ServiceImpl vos, Workbook workbook) { + Sheet sheet = workbook.getSheetAt(0); + // 设置字体颜色、下划线 + CellStyle cellStyle = workbook.createCellStyle(); + Font font = workbook.createFont(); + font.setColor(IndexedColors.BLUE.getIndex()); + font.setUnderline(Font.U_SINGLE); + cellStyle.setFont(font); + cellStyle.setWrapText(true); + int i = 1; + for (LawsConformityAssessmentLibraryExportVO vo : vos) { + if (!Objects.isNull(vo.getUnsatisfiedRequireAttach()) && !vo.getUnsatisfiedRequireAttachList().isEmpty()) { + for (UnsatisfiedRequireAttachFile materialFile : vo.getUnsatisfiedRequireAttachList()) { + Row row = sheet.getRow(i); + Cell cell = row.getCell(19); + // 构建完整的超链接路径,包括文件夹名称 + String hyperlinkPath = folderName + "/" + materialFile.getFileName(); + cell.setCellFormula("HYPERLINK(\"" + hyperlinkPath + "\", \"" + materialFile.getFileName() + "\")"); + cell.setCellStyle(cellStyle); + i += 1; + } + } else { + i += 1; + } + } + } + private void settleDocuments(String url, String folderName, List excelVos) throws IOException { // 构建完整的文件夹路径 String directoryPath = url + File.separator + folderName;