From 85d2d143a7a7a9f282cddac8aeb5221443f6c7e0 Mon Sep 17 00:00:00 2001 From: PQZ Date: Thu, 9 Jan 2025 12:03:38 +0800 Subject: [PATCH] 1 --- .../service/impl/InspectionNewsServiceImpl.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionNewsServiceImpl.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionNewsServiceImpl.java index 83646bff..4dca897c 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionNewsServiceImpl.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionNewsServiceImpl.java @@ -83,7 +83,9 @@ public class InspectionNewsServiceImpl extends ServiceImpl list = baseMapper.selectInspectionNewsList(page,inspectionNews); list.getRecords().forEach(it->{ - it.setNewsContent(HtmlFilter.dealFunction(it.getNewsContent())); + if (StringUtils.isNotEmpty(it.getNewsContent())){ + it.setNewsContent(HtmlFilter.dealFunction(it.getNewsContent())); + } }); return list; } @@ -94,7 +96,9 @@ public class InspectionNewsServiceImpl extends ServiceImpl list = baseMapper.selectList(queryWrapper); list.forEach(it->{ - it.setNewsContent(HtmlFilter.dealFunction(it.getNewsContent())); + if (StringUtils.isNotEmpty(it.getNewsContent())){ + it.setNewsContent(HtmlFilter.dealFunction(it.getNewsContent())); + } }); return list; } @@ -299,7 +303,9 @@ public class InspectionNewsServiceImpl extends ServiceImpl news = baseMapper.msgList(page, ifShow); news.getRecords().forEach(it->{ - it.setNewsContent(HtmlFilter.dealFunction(it.getNewsContent())); + if(StringUtils.isNotEmpty(it.getNewsContent())) { + it.setNewsContent(HtmlFilter.dealFunction(it.getNewsContent())); + } }); return news; }