diff --git a/event_smart/src/main/java/com/njcn/product/event/report/service/impl/EasyPoiWordExportServiceImpl.java b/event_smart/src/main/java/com/njcn/product/event/report/service/impl/EasyPoiWordExportServiceImpl.java index 3dccbea..b15f104 100644 --- a/event_smart/src/main/java/com/njcn/product/event/report/service/impl/EasyPoiWordExportServiceImpl.java +++ b/event_smart/src/main/java/com/njcn/product/event/report/service/impl/EasyPoiWordExportServiceImpl.java @@ -204,7 +204,7 @@ public class EasyPoiWordExportServiceImpl implements EasyPoiWordExportService { } List pqsEventdetailList = pqsEventdetailMapper.selectList(lambdaQueryWrapper); if(CollectionUtils.isEmpty(pqsEventdetailList)){ - areaContent = deptName+"共监测到电压暂降事件0条"; + areaContent = deptName+"共监测到电压暂降事件0条。"; }else { Integer eveCount = pqsEventdetailList.size(); @@ -252,6 +252,9 @@ public class EasyPoiWordExportServiceImpl implements EasyPoiWordExportService { PqsEventdetail pqsEventdetail = pqsEventdetailList.get(i); List baseLineInfo = pqLineMapper.getBaseLineInfo(Stream.of(pqsEventdetailList.get(i).getLineid()).collect(Collectors.toList())); + if(Objects.isNull(baseLineInfo.get(0).getObjName())){ + continue; + } String[] split = baseLineInfo.get(0).getObjName().split(";"); for (int i1 = 0; i1 < split.length; i1++) { if(companyNameList.contains(split[i1])){ @@ -290,7 +293,7 @@ public class EasyPoiWordExportServiceImpl implements EasyPoiWordExportService { double companyMinPersisTime = companyevent.stream().mapToDouble(PqsEventdetail::getPersisttime).min().getAsDouble()/1000; double companyMaxPersisTime = companyevent.stream().mapToDouble(PqsEventdetail::getPersisttime).max().getAsDouble()/1000; String companyDuration = companyMinPersisTime+"s-"+companyMaxPersisTime+"s"; - String companyTemp =" 电压暂降事件%s条,变电站%s座,母线%s条,其中:%s,造成%s发生电压暂降,残余电压范围为%s,持续时间范围为%s。"; + String companyTemp ="电压暂降事件%s条,变电站%s座,母线%s条,其中:%s,造成%s发生电压暂降,残余电压范围为%s,持续时间范围为%s。"; userContext = userContext+String.format(companyTemp,companyEveCount,companyStationCount,companyBusCount,companyStationStr,companyAreabusVoltageDeal,companyResidualVoltage,companyDuration); } @@ -309,7 +312,7 @@ public class EasyPoiWordExportServiceImpl implements EasyPoiWordExportService { areaContentList.add(areaContent); }); // 或者直接使用 \n - String result2 = String.join("\n", areaContentList); + String result2 = String.join("\r\n ", areaContentList); bjReportDTO.setAreaContent(result2); eventTemplateList.sort(Comparator.comparing(map -> (String) map.get("userName")));