");
+ if (StringUtils.isNotBlank(formattedDate)) {
+ html.append("
发布日期:").append(formattedDate).append("
");
+ }
+ if (StringUtils.isNotBlank(caseFile.getCaseType())) {
+ html.append("
案例类型:").append(caseFile.getCaseType()).append("
");
+ }
+ html.append("
");
+
+ // 添加案例描述
+ if (StringUtils.isNotBlank(caseFile.getCaseDescription())) {
+ html.append("");
+ html.append("
案例描述:
");
+ html.append("
").append(caseFile.getCaseDescription()).append("
");
+ html.append("
");
+ }
+
+ // 添加条款内容
+ for (ContractualCaseArticlesVo article : articles) {
+ html.append("");
+
+ String content = article.getArticleContent();
+ if (StringUtils.isNotBlank(content)) {
+ // 处理内容,将"第XX条"等内容加粗
+ String processedContent = processArticleContent(content);
+ html.append("
").append(processedContent).append("
");
+ }
+
+ html.append("
");
+ }
+
+ html.append("");
+
+ return html.toString();
+ }
+
+ /**
+ * 处理条款内容,将"第XX条"等关键内容加粗
+ */
+ private String processArticleContent(String content) {
+ if (StringUtils.isBlank(content)) {
+ return content;
+ }
+
+ // 使用正则表达式匹配"第XX条"并加粗
+ Pattern pattern = Pattern.compile("第([零一二三四五六七八九十百千万\\d]+)条");
+ return pattern.matcher(content).replaceAll("