Compare commits

...

4 Commits

Author SHA1 Message Date
hzj
199836779c 模版导出 2025-10-11 14:25:32 +08:00
hzj
7e76917bd9 Merge remote-tracking branch 'origin/main'
# Conflicts:
#	event_smart/src/main/java/com/njcn/product/event/report/service/impl/EasyPoiWordExportServiceImpl.java
2025-10-11 14:03:29 +08:00
hzj
222c77bc9c 模版导出 2025-10-11 13:53:30 +08:00
hzj
115b79e779 模版导出 2025-10-11 13:39:11 +08:00

View File

@@ -94,7 +94,7 @@ public class EasyPoiWordExportServiceImpl implements EasyPoiWordExportService {
lambdaQueryWrapper.in(PqsEventdetail::getWavetype,msgEventConfigService.getEventType())
.gt(PqsEventdetail::getPersisttime,msgEventConfigService.getEventDuration())
.le(PqsEventdetail::getEventvalue,msgEventConfigService.getEventValue())
.between(PqsEventdetail::getTimeid,DateUtil.parse(param.getSearchBeginTime(),DatePattern.NORM_DATETIME_PATTERN),DateUtil.parse(param.getSearchEndTime(),DatePattern.NORM_DATETIME_PATTERN));
.between(PqsEventdetail::getTimeid,DateUtil.parse(param.getSearchBeginTime(),DatePattern.NORM_DATETIME_PATTERN),DateUtil.parse(param.getSearchEndTime(),DatePattern.NORM_DATETIME_PATTERN));
if (deptIds.size() > 1000) {
List<List<Integer>> listList = CollUtil.split(deptIds, 1000);
lambdaQueryWrapper.and(w->{
@@ -144,8 +144,8 @@ public class EasyPoiWordExportServiceImpl implements EasyPoiWordExportService {
String busVoltageStr = busVoltageDeal(ledgerBaseInfoDTOList, pqsDicDataMap);
bjReportDTO.setStationVoltage(busVoltageStr);
//double容易精度缺失
double min = Math.round(pqsEventdetailList.stream().mapToDouble(PqsEventdetail::getEventvalue).min().getAsDouble() * 100 * 100) * 0.01d;
double max = Math.round(pqsEventdetailList.stream().mapToDouble(PqsEventdetail::getEventvalue).max().getAsDouble() * 100 * 100) * 0.01d;
String min =String.format("%.2f",Math.round(pqsEventdetailList.stream().mapToDouble(PqsEventdetail::getEventvalue).min().getAsDouble()*100*100)*0.01) ;
String max = String.format("%.2f",Math.round(pqsEventdetailList.stream().mapToDouble(PqsEventdetail::getEventvalue).max().getAsDouble()*100*100)*0.01) ;
bjReportDTO.setResidualVoltageRange(min + "%-" + max + "%");
double minPersisTime = pqsEventdetailList.stream().mapToDouble(PqsEventdetail::getPersisttime).min().getAsDouble() / 1000;
@@ -206,7 +206,7 @@ public class EasyPoiWordExportServiceImpl implements EasyPoiWordExportService {
}
List<PqsEventdetail> pqsEventdetailList = pqsEventdetailMapper.selectList(lambdaQueryWrapper);
if(CollectionUtils.isEmpty(pqsEventdetailList)){
areaContent = deptName+"共监测到电压暂降事件0条";
areaContent = deptName+"共监测到电压暂降事件0条";
}else {
Integer eveCount = pqsEventdetailList.size();
@@ -218,8 +218,8 @@ public class EasyPoiWordExportServiceImpl implements EasyPoiWordExportService {
String stationStr = stationVoltageDeal(ledgerBaseInfoDTOList,pqsDicDataMap);
String areabusVoltageDeal = areabusVoltageDeal(ledgerBaseInfoDTOList,pqsDicDataMap);
double min =Math.round(pqsEventdetailList.stream().mapToDouble(PqsEventdetail::getEventvalue).min().getAsDouble()*100*100)*0.01d ;
double max = Math.round(pqsEventdetailList.stream().mapToDouble(PqsEventdetail::getEventvalue).max().getAsDouble()*100*100)*0.01d;
String min =String.format("%.2f",Math.round(pqsEventdetailList.stream().mapToDouble(PqsEventdetail::getEventvalue).min().getAsDouble()*100*100)*0.01) ;
String max = String.format("%.2f",Math.round(pqsEventdetailList.stream().mapToDouble(PqsEventdetail::getEventvalue).max().getAsDouble()*100*100)*0.01) ;
String residualVoltage = min+"%-"+max+"%";
double minPersisTime = pqsEventdetailList.stream().mapToDouble(PqsEventdetail::getPersisttime).min().getAsDouble()/1000;
@@ -254,6 +254,9 @@ public class EasyPoiWordExportServiceImpl implements EasyPoiWordExportService {
PqsEventdetail pqsEventdetail = pqsEventdetailList.get(i);
List<LedgerBaseInfoDTO> 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])){
@@ -284,15 +287,15 @@ public class EasyPoiWordExportServiceImpl implements EasyPoiWordExportService {
String companyStationStr = stationVoltageDeal(companyLedgerBaseInfoDTOList,pqsDicDataMap);
String companyAreabusVoltageDeal = areabusVoltageDeal(companyLedgerBaseInfoDTOList,pqsDicDataMap);
String companyMin =String.format("%.2f",Math.round(pqsEventdetailList.stream().mapToDouble(PqsEventdetail::getEventvalue).min().getAsDouble()*100*100)*0.01) ;
String companyMax = String.format("%.2f",Math.round(pqsEventdetailList.stream().mapToDouble(PqsEventdetail::getEventvalue).max().getAsDouble()*100*100)*0.01) ;
double companyMin =Math.round(pqsEventdetailList.stream().mapToDouble(PqsEventdetail::getEventvalue).min().getAsDouble()*100*100)*0.01d ;
double companyMax = Math.round(pqsEventdetailList.stream().mapToDouble(PqsEventdetail::getEventvalue).max().getAsDouble()*100*100)*0.01d;
String companyResidualVoltage = companyMin+"%-"+companyMax+"%";
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);
}
@@ -311,7 +314,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")));