|
@@ -84,21 +84,21 @@ public class ReportIndexResultServiceImpl extends AbstractCrudService<ReportInde
|
|
|
LocalDate date=LocalDate.now();
|
|
|
LocalDateTime dateTime=LocalDateTime.now();
|
|
|
for (int i = 0; i < baseCompanies.size(); i++) {
|
|
|
- // 1.新建document对象
|
|
|
-// Document document = new Document(PageSize.A4);// 建立一个Document对象
|
|
|
-//
|
|
|
-//// 2.建立一个书写器(Writer)与document对象关联
|
|
|
-//// File file =
|
|
|
-//// new File("/var/www/usky-file/"+now.get(Calendar.YEAR)+"0"+now.get(Calendar.MONTH+1)+"/"+now.get(Calendar.YEAR)+now.get(Calendar.MONTH)+baseCompanies.get(i).getCompanyId()+".pdf");
|
|
|
+ //1.新建document对象
|
|
|
+ Document document = new Document(PageSize.A4);// 建立一个Document对象
|
|
|
+
|
|
|
+// 2.建立一个书写器(Writer)与document对象关联
|
|
|
+ File file =
|
|
|
+ new File("/var/www/usky-file/"+now.get(Calendar.YEAR)+"0"+now.get(Calendar.MONTH+1)+"/"+now.get(Calendar.YEAR)+now.get(Calendar.MONTH)+baseCompanies.get(i).getCompanyId()+".pdf");
|
|
|
// File file = new File("D:\\"+now.get(Calendar.YEAR)+now.get(Calendar.MONTH)+baseCompanies.get(i).getCompanyId()+".pdf");
|
|
|
-// file.createNewFile();
|
|
|
-// PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(file));
|
|
|
-//// writer.setPageEvent(new Watermark("hello word"));// 水印
|
|
|
-// writer.setPageEvent(new MyHeaderFooter());// 页眉/页脚
|
|
|
-// // 3.打开文档
|
|
|
-// document.open();
|
|
|
-// document.addTitle("fire report");// 标题
|
|
|
-// document.addAuthor("mhzd");// 作者
|
|
|
+ file.createNewFile();
|
|
|
+ PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(file));
|
|
|
+// writer.setPageEvent(new Watermark("hello word"));// 水印
|
|
|
+ writer.setPageEvent(new MyHeaderFooter());// 页眉/页脚
|
|
|
+ // 3.打开文档
|
|
|
+ document.open();
|
|
|
+ document.addTitle("fire report");// 标题
|
|
|
+ document.addAuthor("mhzd");// 作者
|
|
|
DemReportDataVo demReportDataVo = new DemReportDataVo();
|
|
|
demReportDataVo.setCompanyName(baseCompanies.get(i).getCompanyName());
|
|
|
demReportDataVo.setLastMonthEndTime(date.toString());
|
|
@@ -1010,8 +1010,8 @@ public class ReportIndexResultServiceImpl extends AbstractCrudService<ReportInde
|
|
|
demReportDataVo.setOverallRating("高风险");
|
|
|
}
|
|
|
}
|
|
|
-// this.generatePDF(document,demReportDataVo);
|
|
|
-// document.close();
|
|
|
+ this.generatePDF(document,demReportDataVo);
|
|
|
+ document.close();
|
|
|
reportResultService.save(reportResult);
|
|
|
}
|
|
|
}
|
|
@@ -1715,9 +1715,9 @@ public class ReportIndexResultServiceImpl extends AbstractCrudService<ReportInde
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM");
|
|
|
String formattedDate = currentDate.format(formatter);
|
|
|
resultStatisticsVO.setHighRisk(getReportCountByScoreRange(0, 60, formattedDate).size());
|
|
|
- resultStatisticsVO.setMildHighRisk(getReportCountByScoreRange(60, 70, formattedDate).size());
|
|
|
- resultStatisticsVO.setNormalRisk(getReportCountByScoreRange(70, 80, formattedDate).size());
|
|
|
- resultStatisticsVO.setLowRisk(getReportCountByScoreRange(80, 100, formattedDate).size());
|
|
|
+ resultStatisticsVO.setMildHighRisk(getReportCountByScoreRange(60, 69, formattedDate).size());
|
|
|
+ resultStatisticsVO.setNormalRisk(getReportCountByScoreRange(69, 70, formattedDate).size());
|
|
|
+ resultStatisticsVO.setLowRisk(getReportCountByScoreRange(70, 100, formattedDate).size());
|
|
|
list.add(resultStatisticsVO);
|
|
|
return list;
|
|
|
}
|
|
@@ -1740,11 +1740,11 @@ public class ReportIndexResultServiceImpl extends AbstractCrudService<ReportInde
|
|
|
if (riskGrade.equals(1)) {
|
|
|
highRiskList = getReportCountByScoreRange(0, 60, formattedDate);
|
|
|
}else if (riskGrade.equals(2)){
|
|
|
- highRiskList = getReportCountByScoreRange(60, 70, formattedDate);
|
|
|
+ highRiskList = getReportCountByScoreRange(60, 69, formattedDate);
|
|
|
}else if (riskGrade.equals(3)){
|
|
|
- highRiskList = getReportCountByScoreRange(70, 80, formattedDate);
|
|
|
+ highRiskList = getReportCountByScoreRange(69, 70, formattedDate);
|
|
|
}else if (riskGrade.equals(4)){
|
|
|
- highRiskList = getReportCountByScoreRange(80, 100, formattedDate);
|
|
|
+ highRiskList = getReportCountByScoreRange(70, 100, formattedDate);
|
|
|
}
|
|
|
if (CollectionUtils.isNotEmpty(highRiskList)) {
|
|
|
List<Integer> idList = new ArrayList<>();
|
|
@@ -1782,7 +1782,9 @@ public class ReportIndexResultServiceImpl extends AbstractCrudService<ReportInde
|
|
|
}
|
|
|
LambdaQueryWrapper<BaseCompanyAttach1> queryWrapper1 = Wrappers.lambdaQuery();
|
|
|
queryWrapper1.select(BaseCompanyAttach1::getId, BaseCompanyAttach1::getCompanyId, BaseCompanyAttach1::getLongitude,
|
|
|
- BaseCompanyAttach1::getLatitude)
|
|
|
+ BaseCompanyAttach1::getLatitude,BaseCompanyAttach1::getRefugeFloorPosition,
|
|
|
+ BaseCompanyAttach1::getRemarks,BaseCompanyAttach1::getPlanName,BaseCompanyAttach1::getPlanUrl
|
|
|
+ ,BaseCompanyAttach1::getBuildNum,BaseCompanyAttach1::getSuperiorFireJurisdiction)
|
|
|
.in(BaseCompanyAttach1::getCompanyId, companyIdList);
|
|
|
List<BaseCompanyAttach1> list2 = baseCompanyAttach1Service.list(queryWrapper1);
|
|
|
for (int i = 0; i < list1.size(); i++) {
|
|
@@ -1840,6 +1842,12 @@ public class ReportIndexResultServiceImpl extends AbstractCrudService<ReportInde
|
|
|
map.put("streetTown", streetTown);
|
|
|
map.put("longitude", longitude);
|
|
|
map.put("latitude", latitude);
|
|
|
+ map.put("person1", list2.get(j).getRefugeFloorPosition());
|
|
|
+ map.put("phone1", list2.get(j).getRemarks());
|
|
|
+ map.put("person2", list2.get(j).getPlanName());
|
|
|
+ map.put("phone2", list2.get(j).getPlanUrl());
|
|
|
+ map.put("person3", list2.get(j).getBuildNum());
|
|
|
+ map.put("phone3", list2.get(j).getSuperiorFireJurisdiction());
|
|
|
}
|
|
|
}
|
|
|
if (map.get("longitude") != null && map.get("latitude") != null && map.get("streetTown") != null) {
|