Ver Fonte

修复报错

fuyuchuan há 1 dia atrás
pai
commit
36ee49f391

+ 9 - 8
service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/web/TaskController.java

@@ -46,13 +46,14 @@ public class TaskController {
 //    }
 
     //    @Scheduled(cron = "0 0 * * * ? ")//每小时
-    @Scheduled(cron = "0 0 1 * * ? ")//每天凌晨1点
+    @Scheduled(cron = "0 0/5 * * * ? ")
+    //@Scheduled(cron = "0 0 1 * * ? ")//每天凌晨1点
     public void task1() {
         System.out.println(Thread.currentThread().getName() + "大屏定时任务执行中");
         bscEnterpriseScreenService.dataSynchro();
     }
 
-//     @Scheduled(cron = "0 0 2 * * ? ")//每天凌晨2点
+    //     @Scheduled(cron = "0 0 2 * * ? ")//每天凌晨2点
 //     public void task2() {
 //         System.out.println(Thread.currentThread().getName() + "企业自主管理(全、街道)大屏定时任务执行中");
 //         bscEnterpriseAutonomyService.enterpriseAutonomyTask();
@@ -66,12 +67,12 @@ public class TaskController {
 //         demInspectListService.demInspectAutoTask();
 //     }
 //
-//     @Scheduled(cron = "0 0 1 1 * ?")//每月1号凌晨1点
-// //    @Scheduled(cron = "0 0/5 * * * ? ") // 间隔5分钟执行
-//     public void task4() {
-//         System.out.println(Thread.currentThread().getName() + "消防报告生成定时任务执行中");
-//         demReportDataService.regularReportData();
-//     }
+    //@Scheduled(cron = "0 0 1 1 * ?")//每月1号凌晨1点
+    @Scheduled(cron = "0 0/3 * * * ? ") // 间隔5分钟执行
+    public void task4() {
+        System.out.println(Thread.currentThread().getName() + "消防报告生成定时任务执行中");
+        demReportDataService.regularReportData();
+    }
 //
 //     @Scheduled(cron = "0 0 23 * * ? ")//每天23点
 //     public void task5(){

+ 176 - 153
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/DemReportDataServiceImpl.java

@@ -13,8 +13,7 @@ import com.usky.fire.service.vo.DemReportDataVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import java.io.File;
-import java.io.FileOutputStream;
+import java.io.*;
 import java.text.SimpleDateFormat;
 import java.time.LocalDateTime;
 import java.util.*;
@@ -61,9 +60,26 @@ public class DemReportDataServiceImpl extends AbstractCrudService<DemReportDataM
                     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("/home/service/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");
+
+                    // 构建文件路径
+                    int year = now.get(Calendar.YEAR);
+                    int month = now.get(Calendar.MONTH) + 1; // Calendar.MONTH从0开始,所以要+1
+                    String monthStr = String.format("%02d", month); // 月份补零成两位数
+                    String dirName = year + monthStr; // 生成 "202509" 格式
+                    File file = new File("/home/service/usky-file/" + dirName + "/" + dirName + baseCompanies.get(i).getCompanyId() + ".pdf");
+
+                    File monthDir = file.getParentFile();
+                    if (!monthDir.exists()) {
+                        boolean created = monthDir.mkdirs();
+                        if (!created) {
+                            throw new IOException("无法创建目录: " + monthDir.getAbsolutePath());
+                        }
+                    }
+
+                    System.out.println(file.getPath());
                     file.createNewFile();
                     PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(file));
 //                    writer.setPageEvent(new Watermark("hello word"));// 水印
@@ -87,29 +103,29 @@ public class DemReportDataServiceImpl extends AbstractCrudService<DemReportDataM
                     lastMonthEndDateCal.set(
                             Calendar.DAY_OF_MONTH, lastMonthEndDateCal.getActualMaximum(Calendar.DAY_OF_MONTH));
                     String lastMonthEndTime = format.format(lastMonthEndDateCal.getTime());
-                    int fireDeviceNum = baseDeviceService.deviceCount(baseCompanies.get(i).getCompanyId(),1);
-                    int smokeDeviceNum = baseDeviceService.deviceCount(baseCompanies.get(i).getCompanyId(),3);
+                    int fireDeviceNum = baseDeviceService.deviceCount(baseCompanies.get(i).getCompanyId(), 1);
+                    int smokeDeviceNum = baseDeviceService.deviceCount(baseCompanies.get(i).getCompanyId(), 3);
                     int fireDeviceOfflineNum =
-                            baseDeviceStatusService.deviceStatusByTypeCount(baseCompanies.get(i).getCompanyId(),0,1);
+                            baseDeviceStatusService.deviceStatusByTypeCount(baseCompanies.get(i).getCompanyId(), 0, 1);
                     int smokeDeviceOfflineNum =
-                            baseDeviceStatusService.deviceStatusByTypeCount(baseCompanies.get(i).getCompanyId(),0,3);
+                            baseDeviceStatusService.deviceStatusByTypeCount(baseCompanies.get(i).getCompanyId(), 0, 3);
                     int fireDeviceHitchNum =
-                            baseDeviceStatusService.deviceStatusByTypeCount(baseCompanies.get(i).getCompanyId(),2,1);
+                            baseDeviceStatusService.deviceStatusByTypeCount(baseCompanies.get(i).getCompanyId(), 2, 1);
                     int smokeDeviceHitchNum =
-                            baseDeviceStatusService.deviceStatusByTypeCount(baseCompanies.get(i).getCompanyId(),2,3);
-                    int fireAlarmOfflineNum = fireDeviceOfflineNum+smokeDeviceOfflineNum;
-                    int fireAlarmHitchNum = fireDeviceHitchNum+smokeDeviceHitchNum;
-                    int fireAlarmNum = fireDeviceNum+smokeDeviceNum;
+                            baseDeviceStatusService.deviceStatusByTypeCount(baseCompanies.get(i).getCompanyId(), 2, 3);
+                    int fireAlarmOfflineNum = fireDeviceOfflineNum + smokeDeviceOfflineNum;
+                    int fireAlarmHitchNum = fireDeviceHitchNum + smokeDeviceHitchNum;
+                    int fireAlarmNum = fireDeviceNum + smokeDeviceNum;
                     double fireOnlineRate = 0;
                     double fireFaultRate = 0;
-                    if (fireAlarmNum>0){
-                        fireOnlineRate = 1-Math.round(fireAlarmOfflineNum/fireAlarmNum*100)*0.01;
-                        fireFaultRate = Math.round(fireAlarmHitchNum/fireAlarmNum*100)*0.01;
+                    if (fireAlarmNum > 0) {
+                        fireOnlineRate = 1 - Math.round(fireAlarmOfflineNum / fireAlarmNum * 100) * 0.01;
+                        fireFaultRate = Math.round(fireAlarmHitchNum / fireAlarmNum * 100) * 0.01;
                     }
                     LambdaQueryWrapper<BaseDevice> queryWrapper2 = Wrappers.lambdaQuery();
                     queryWrapper2.select(BaseDevice::getId, BaseDevice::getDeviceCode)
                             .eq(BaseDevice::getCompanyId, baseCompanies.get(i).getCompanyId())
-                            .in(BaseDevice::getDeviceType, 2,5,6)
+                            .in(BaseDevice::getDeviceType, 2, 5, 6)
                             .notLike(BaseDevice::getDeviceName, "风机");
                     List<BaseDevice> list2 = baseDeviceService.list(queryWrapper2);
                     double waterOnlineRate = 0;
@@ -125,15 +141,15 @@ public class DemReportDataServiceImpl extends AbstractCrudService<DemReportDataM
                             LambdaQueryWrapper<BaseDeviceStatus> queryWrapper3 = Wrappers.lambdaQuery();
                             queryWrapper3.select(BaseDeviceStatus::getId, BaseDeviceStatus::getDeviceCode)
                                     .in(BaseDeviceStatus::getDeviceCode, deviceCodeList)
-                                    .ne(BaseDeviceStatus::getDeviceStatus,0);
+                                    .ne(BaseDeviceStatus::getDeviceStatus, 0);
                             list3 = baseDeviceStatusService.list(queryWrapper3);
-                            waterOnlineRate = Math.round(list3.size()/list2.size()*100)*0.01;
+                            waterOnlineRate = Math.round(list3.size() / list2.size() * 100) * 0.01;
                             LambdaQueryWrapper<BaseDeviceStatus> queryWrapper3l = Wrappers.lambdaQuery();
                             queryWrapper3l.select(BaseDeviceStatus::getId, BaseDeviceStatus::getDeviceCode)
                                     .in(BaseDeviceStatus::getDeviceCode, deviceCodeList)
-                                    .eq(BaseDeviceStatus::getDeviceStatus,2);
+                                    .eq(BaseDeviceStatus::getDeviceStatus, 2);
                             list3l = baseDeviceStatusService.list(queryWrapper3l);
-                            waterFaultRate = Math.round(list3l.size()/list2.size()*100)*0.01;
+                            waterFaultRate = Math.round(list3l.size() / list2.size() * 100) * 0.01;
                         }
                     }
                     LambdaQueryWrapper<BaseDevice> queryWrapper4 = Wrappers.lambdaQuery();
@@ -155,27 +171,27 @@ public class DemReportDataServiceImpl extends AbstractCrudService<DemReportDataM
                             LambdaQueryWrapper<BaseDeviceStatus> queryWrapper5 = Wrappers.lambdaQuery();
                             queryWrapper5.select(BaseDeviceStatus::getId, BaseDeviceStatus::getDeviceCode)
                                     .in(BaseDeviceStatus::getDeviceCode, deviceCodeList)
-                                    .ne(BaseDeviceStatus::getDeviceStatus,0);
+                                    .ne(BaseDeviceStatus::getDeviceStatus, 0);
                             list5 = baseDeviceStatusService.list(queryWrapper5);
-                            smokeOnlineRate = Math.round(list5.size()/list4.size())*0.01;
+                            smokeOnlineRate = Math.round(list5.size() / list4.size()) * 0.01;
                             LambdaQueryWrapper<BaseDeviceStatus> queryWrapper5l = Wrappers.lambdaQuery();
                             queryWrapper5l.select(BaseDeviceStatus::getId, BaseDeviceStatus::getDeviceCode)
                                     .in(BaseDeviceStatus::getDeviceCode, deviceCodeList)
-                                    .ne(BaseDeviceStatus::getDeviceStatus,2);
+                                    .ne(BaseDeviceStatus::getDeviceStatus, 2);
                             list5l = baseDeviceStatusService.list(queryWrapper5l);
-                            smokeFaultRate = Math.round(list5l.size()/list4.size())*0.01;
+                            smokeFaultRate = Math.round(list5l.size() / list4.size()) * 0.01;
                         }
                     }
-                    int efireDeviceNum = baseDeviceService.deviceCount(baseCompanies.get(i).getCompanyId(),7);
+                    int efireDeviceNum = baseDeviceService.deviceCount(baseCompanies.get(i).getCompanyId(), 7);
                     int efireDeviceOfflineNum =
-                            baseDeviceStatusService.deviceStatusByTypeCount(baseCompanies.get(i).getCompanyId(),0,7);
+                            baseDeviceStatusService.deviceStatusByTypeCount(baseCompanies.get(i).getCompanyId(), 0, 7);
                     int efireDeviceHitchNum =
-                            baseDeviceStatusService.deviceStatusByTypeCount(baseCompanies.get(i).getCompanyId(),2,7);
+                            baseDeviceStatusService.deviceStatusByTypeCount(baseCompanies.get(i).getCompanyId(), 2, 7);
                     double efOnlineRate = 0;
                     double efFaultRate = 0;
-                    if (efireDeviceNum>0){
-                        efOnlineRate = 1-Math.round(efireDeviceOfflineNum/efireDeviceNum*100)*0.01;
-                        efFaultRate = Math.round(efireDeviceHitchNum/efireDeviceNum*100)*0.01;
+                    if (efireDeviceNum > 0) {
+                        efOnlineRate = 1 - Math.round(efireDeviceOfflineNum / efireDeviceNum * 100) * 0.01;
+                        efFaultRate = Math.round(efireDeviceHitchNum / efireDeviceNum * 100) * 0.01;
                     }
                     DemReportDataVo demReportDataVo = new DemReportDataVo();
                     demReportDataVo.setLastMonthFirstTime(lastMonthFirstTime);
@@ -192,18 +208,18 @@ public class DemReportDataServiceImpl extends AbstractCrudService<DemReportDataM
 // 4.向文档中添加内容
                     BaseCompany baseCompany = baseCompanies.get(i);
 
-                    this.generatePDF(document,baseCompanies.get(i).getCompanyName());
+                    this.generatePDF(document, baseCompanies.get(i).getCompanyName());
 
 // 5.关闭文档
                     document.close();
                     DemReportInfo demReportInfo = new DemReportInfo();
                     demReportInfo.setCompanyId(baseCompanies.get(i).getCompanyId());
                     demReportInfo.setCompanyCode(baseCompanies.get(i).getCompanyCode());
-                    demReportInfo.setReportName(now.get(Calendar.YEAR)+"年"+now.get(Calendar.MONTH)+"月消防报告");
-                    demReportInfo.setReportPath("http://file.usky.cn/statics/202303/"+now.get(Calendar.YEAR)+now.get(Calendar.MONTH)+baseCompanies.get(i).getCompanyId()+
+                    demReportInfo.setReportName(now.get(Calendar.YEAR) + "年" + now.get(Calendar.MONTH) + "月消防报告");
+                    demReportInfo.setReportPath("http://file.usky.cn/statics/202303/" + now.get(Calendar.YEAR) + now.get(Calendar.MONTH) + baseCompanies.get(i).getCompanyId() +
                             ".pdf");
                     demReportInfo.setCreateTime(LocalDateTime.now());
-                    demReportInfo.setStatisticsTime(now.get(Calendar.YEAR)+"-"+now.get(Calendar.MONTH));
+                    demReportInfo.setStatisticsTime(now.get(Calendar.YEAR) + "-" + now.get(Calendar.MONTH));
                     demReportInfo.setReportStatus(0);
                     demReportInfoService.save(demReportInfo);
                 }
@@ -220,6 +236,7 @@ public class DemReportDataServiceImpl extends AbstractCrudService<DemReportDataM
     private static Font textfont;
     // 最大宽度
     private static int maxWidth = 520;
+
     // 静态代码块
     static {
         try {
@@ -236,173 +253,173 @@ public class DemReportDataServiceImpl extends AbstractCrudService<DemReportDataM
     }
 
     // 生成PDF文件
-    public void generatePDF(Document document,String companyName) throws Exception {
+    public void generatePDF(Document document, String companyName) throws Exception {
 
 // 段落
-        Paragraph paragraph = new Paragraph(companyName+"单位消防安全数字化管理综合分析报告", titlefont);
-        paragraph.setAlignment(1); //设置文字居中 0靠左 1,居中 2,靠右
-        paragraph.setIndentationLeft(12); //设置左缩进
-        paragraph.setIndentationRight(12); //设置右缩进
-        paragraph.setFirstLineIndent(24); //设置首行缩进
-        paragraph.setLeading(20f); //行间距
-        paragraph.setSpacingBefore(5f); //设置段落上空白
-        paragraph.setSpacingAfter(20f); //设置段落下空白
-
-        Paragraph paragraph1 = new Paragraph(companyName+"单位:", textfont);
-        paragraph1.setAlignment(0); //设置文字居中 0靠左 1,居中 2,靠右
+        Paragraph paragraph = new Paragraph(companyName + "单位消防安全数字化管理综合分析报告", titlefont);
+        paragraph.setAlignment(1); // 设置文字居中 0靠左 1,居中 2,靠右
+        paragraph.setIndentationLeft(12); // 设置左缩进
+        paragraph.setIndentationRight(12); // 设置右缩进
+        paragraph.setFirstLineIndent(24); // 设置首行缩进
+        paragraph.setLeading(20f); // 行间距
+        paragraph.setSpacingBefore(5f); // 设置段落上空白
+        paragraph.setSpacingAfter(20f); // 设置段落下空白
+
+        Paragraph paragraph1 = new Paragraph(companyName + "单位:", textfont);
+        paragraph1.setAlignment(0); // 设置文字居中 0靠左 1,居中 2,靠右
 
         Paragraph paragraph2 = new Paragraph("本次综合分析是通过贵单位在2022年1月1日-2022年12月31日期间消防设施状况、消防自主管理状况、监督执法情况、火灾风险指数和建筑整体指数进行综合评估,现将综合分析报告如下:", textfont);
-        paragraph2.setAlignment(0); //设置文字居中 0靠左 1,居中 2,靠右
-        paragraph2.setFirstLineIndent(24); //设置首行缩进
-        paragraph2.setLeading(20f); //行间距
-        paragraph2.setSpacingBefore(5f); //设置段落上空白
-        paragraph2.setSpacingAfter(10f); //设置段落下空白
+        paragraph2.setAlignment(0); // 设置文字居中 0靠左 1,居中 2,靠右
+        paragraph2.setFirstLineIndent(24); // 设置首行缩进
+        paragraph2.setLeading(20f); // 行间距
+        paragraph2.setSpacingBefore(5f); // 设置段落上空白
+        paragraph2.setSpacingAfter(10f); // 设置段落下空白
 
         Paragraph paragraph3 = new Paragraph("一、整体评价", headfont);
-        paragraph3.setAlignment(0); //设置文字居中 0靠左 1,居中 2,靠右
-        paragraph3.setFirstLineIndent(24); //设置首行缩进
+        paragraph3.setAlignment(0); // 设置文字居中 0靠左 1,居中 2,靠右
+        paragraph3.setFirstLineIndent(24); // 设置首行缩进
 
         Paragraph paragraph4 = new Paragraph("贵单位在期间消防安全管理指数评价为:较高风险", textfont);
-        paragraph4.setAlignment(0); //设置文字居中 0靠左 1,居中 2,靠右
-        paragraph4.setFirstLineIndent(24); //设置首行缩进
-        paragraph4.setLeading(20f); //行间距
-        paragraph4.setSpacingBefore(5f); //设置段落上空白
-        paragraph4.setSpacingAfter(10f); //设置段落下空白
+        paragraph4.setAlignment(0); // 设置文字居中 0靠左 1,居中 2,靠右
+        paragraph4.setFirstLineIndent(24); // 设置首行缩进
+        paragraph4.setLeading(20f); // 行间距
+        paragraph4.setSpacingBefore(5f); // 设置段落上空白
+        paragraph4.setSpacingAfter(10f); // 设置段落下空白
 
         Paragraph paragraph5 = new Paragraph("二、测评范围", headfont);
-        paragraph5.setAlignment(0); //设置文字居中 0靠左 1,居中 2,靠右
-        paragraph5.setFirstLineIndent(24); //设置首行缩进
+        paragraph5.setAlignment(0); // 设置文字居中 0靠左 1,居中 2,靠右
+        paragraph5.setFirstLineIndent(24); // 设置首行缩进
 
         Paragraph paragraph6 = new Paragraph("包含消防设施系统(火灾报警系统;消防水系统;防排烟系统;维保单位履职情况等  如实显示,没有的就不显示)、消防自主管理状况(组织制度落实情况;日常值班、巡检情况;预案、培训落实情况;微站实体化运行情况)、监督执法情况(双随机检查情况;处罚情况;投诉举报情况;重大隐患挂牌情况)和火灾风险指数(当年度火灾情况;上年度火灾情况)等项目进行综合测评。", textfont);
-        paragraph6.setAlignment(0); //设置文字居中 0靠左 1,居中 2,靠右
-        paragraph6.setFirstLineIndent(24); //设置首行缩进
-        paragraph6.setLeading(20f); //行间距
-        paragraph6.setSpacingBefore(5f); //设置段落上空白
-        paragraph6.setSpacingAfter(10f); //设置段落下空白
+        paragraph6.setAlignment(0); // 设置文字居中 0靠左 1,居中 2,靠右
+        paragraph6.setFirstLineIndent(24); // 设置首行缩进
+        paragraph6.setLeading(20f); // 行间距
+        paragraph6.setSpacingBefore(5f); // 设置段落上空白
+        paragraph6.setSpacingAfter(10f); // 设置段落下空白
 
         Paragraph paragraph7 = new Paragraph("三、主要风险及问题", headfont);
-        paragraph7.setAlignment(0); //设置文字居中 0靠左 1,居中 2,靠右
-        paragraph7.setFirstLineIndent(24); //设置首行缩进
+        paragraph7.setAlignment(0); // 设置文字居中 0靠左 1,居中 2,靠右
+        paragraph7.setFirstLineIndent(24); // 设置首行缩进
 
         Paragraph paragraph8 = new Paragraph("(一)消防设施问题", textfont);
-        paragraph8.setAlignment(0); //设置文字居中 0靠左 1,居中 2,靠右
-        paragraph8.setFirstLineIndent(24); //设置首行缩进
-        paragraph8.setLeading(20f); //行间距
-        paragraph8.setSpacingBefore(5f); //设置段落上空白
-        paragraph8.setSpacingAfter(10f); //设置段落下空白
+        paragraph8.setAlignment(0); // 设置文字居中 0靠左 1,居中 2,靠右
+        paragraph8.setFirstLineIndent(24); // 设置首行缩进
+        paragraph8.setLeading(20f); // 行间距
+        paragraph8.setSpacingBefore(5f); // 设置段落上空白
+        paragraph8.setSpacingAfter(10f); // 设置段落下空白
 
         Paragraph paragraph9 = new Paragraph("火灾报警系统:在线率低于95%,故障率高于5%;", textfont);
-        paragraph9.setAlignment(0); //设置文字居中 0靠左 1,居中 2,靠右
-        paragraph9.setFirstLineIndent(24); //设置首行缩进
-        paragraph9.setLeading(20f); //行间距
-        paragraph9.setSpacingBefore(5f); //设置段落上空白
-        paragraph9.setSpacingAfter(10f); //设置段落下空白
+        paragraph9.setAlignment(0); // 设置文字居中 0靠左 1,居中 2,靠右
+        paragraph9.setFirstLineIndent(24); // 设置首行缩进
+        paragraph9.setLeading(20f); // 行间距
+        paragraph9.setSpacingBefore(5f); // 设置段落上空白
+        paragraph9.setSpacingAfter(10f); // 设置段落下空白
 
         Paragraph paragraph10 = new Paragraph("防排烟系统:出现超出一个月修复或未修复的2次;", textfont);
-        paragraph10.setAlignment(0); //设置文字居中 0靠左 1,居中 2,靠右
-        paragraph10.setFirstLineIndent(24); //设置首行缩进
-        paragraph10.setLeading(20f); //行间距
-        paragraph10.setSpacingBefore(5f); //设置段落上空白
-        paragraph10.setSpacingAfter(10f); //设置段落下空白
+        paragraph10.setAlignment(0); // 设置文字居中 0靠左 1,居中 2,靠右
+        paragraph10.setFirstLineIndent(24); // 设置首行缩进
+        paragraph10.setLeading(20f); // 行间距
+        paragraph10.setSpacingBefore(5f); // 设置段落上空白
+        paragraph10.setSpacingAfter(10f); // 设置段落下空白
 
         Paragraph paragraph11 = new Paragraph("维保单位履职情况:检测报告体现XX系统(设施)存在故障。", textfont);
-        paragraph11.setAlignment(0); //设置文字居中 0靠左 1,居中 2,靠右
-        paragraph11.setFirstLineIndent(24); //设置首行缩进
-        paragraph11.setLeading(20f); //行间距
-        paragraph11.setSpacingBefore(5f); //设置段落上空白
-        paragraph11.setSpacingAfter(10f); //设置段落下空白
+        paragraph11.setAlignment(0); // 设置文字居中 0靠左 1,居中 2,靠右
+        paragraph11.setFirstLineIndent(24); // 设置首行缩进
+        paragraph11.setLeading(20f); // 行间距
+        paragraph11.setSpacingBefore(5f); // 设置段落上空白
+        paragraph11.setSpacingAfter(10f); // 设置段落下空白
 
         Paragraph paragraph12 = new Paragraph("(二)消防自主管理问题", textfont);
-        paragraph12.setAlignment(0); //设置文字居中 0靠左 1,居中 2,靠右
-        paragraph12.setFirstLineIndent(24); //设置首行缩进
-        paragraph12.setLeading(20f); //行间距
-        paragraph12.setSpacingBefore(5f); //设置段落上空白
-        paragraph12.setSpacingAfter(10f); //设置段落下空白
+        paragraph12.setAlignment(0); // 设置文字居中 0靠左 1,居中 2,靠右
+        paragraph12.setFirstLineIndent(24); // 设置首行缩进
+        paragraph12.setLeading(20f); // 行间距
+        paragraph12.setSpacingBefore(5f); // 设置段落上空白
+        paragraph12.setSpacingAfter(10f); // 设置段落下空白
 
         Paragraph paragraph13 = new Paragraph("组织制度落实情况:员工消防安全培训填写不符合规定;", textfont);
-        paragraph13.setAlignment(0); //设置文字居中 0靠左 1,居中 2,靠右
-        paragraph13.setFirstLineIndent(24); //设置首行缩进
-        paragraph13.setLeading(20f); //行间距
-        paragraph13.setSpacingBefore(5f); //设置段落上空白
-        paragraph13.setSpacingAfter(10f); //设置段落下空白
+        paragraph13.setAlignment(0); // 设置文字居中 0靠左 1,居中 2,靠右
+        paragraph13.setFirstLineIndent(24); // 设置首行缩进
+        paragraph13.setLeading(20f); // 行间距
+        paragraph13.setSpacingBefore(5f); // 设置段落上空白
+        paragraph13.setSpacingAfter(10f); // 设置段落下空白
 
         Paragraph paragraph14 = new Paragraph("消防档案:档案填写不符合规定;", textfont);
-        paragraph14.setAlignment(0); //设置文字居中 0靠左 1,居中 2,靠右
-        paragraph14.setFirstLineIndent(24); //设置首行缩进
-        paragraph14.setLeading(20f); //行间距
-        paragraph14.setSpacingBefore(5f); //设置段落上空白
-        paragraph14.setSpacingAfter(10f); //设置段落下空白
+        paragraph14.setAlignment(0); // 设置文字居中 0靠左 1,居中 2,靠右
+        paragraph14.setFirstLineIndent(24); // 设置首行缩进
+        paragraph14.setLeading(20f); // 行间距
+        paragraph14.setSpacingBefore(5f); // 设置段落上空白
+        paragraph14.setSpacingAfter(10f); // 设置段落下空白
 
         Paragraph paragraph15 = new Paragraph("消防重点部位:未确定消防重点部位。", textfont);
-        paragraph15.setAlignment(0); //设置文字居中 0靠左 1,居中 2,靠右
-        paragraph15.setFirstLineIndent(24); //设置首行缩进
-        paragraph15.setLeading(20f); //行间距
-        paragraph15.setSpacingBefore(5f); //设置段落上空白
-        paragraph15.setSpacingAfter(10f); //设置段落下空白
+        paragraph15.setAlignment(0); // 设置文字居中 0靠左 1,居中 2,靠右
+        paragraph15.setFirstLineIndent(24); // 设置首行缩进
+        paragraph15.setLeading(20f); // 行间距
+        paragraph15.setSpacingBefore(5f); // 设置段落上空白
+        paragraph15.setSpacingAfter(10f); // 设置段落下空白
 
         Paragraph paragraph16 = new Paragraph("(三)监督执法情况", textfont);
-        paragraph16.setAlignment(0); //设置文字居中 0靠左 1,居中 2,靠右
-        paragraph16.setFirstLineIndent(24); //设置首行缩进
-        paragraph16.setLeading(20f); //行间距
-        paragraph16.setSpacingBefore(5f); //设置段落上空白
-        paragraph16.setSpacingAfter(10f); //设置段落下空白
+        paragraph16.setAlignment(0); // 设置文字居中 0靠左 1,居中 2,靠右
+        paragraph16.setFirstLineIndent(24); // 设置首行缩进
+        paragraph16.setLeading(20f); // 行间距
+        paragraph16.setSpacingBefore(5f); // 设置段落上空白
+        paragraph16.setSpacingAfter(10f); // 设置段落下空白
 
         Paragraph paragraph17 = new Paragraph("上述时间段内监督检查发现隐患X处,其中XX未整改完成,处罚XX元。", textfont);
-        paragraph17.setAlignment(0); //设置文字居中 0靠左 1,居中 2,靠右
-        paragraph17.setFirstLineIndent(24); //设置首行缩进
-        paragraph17.setLeading(20f); //行间距
-        paragraph17.setSpacingBefore(5f); //设置段落上空白
-        paragraph17.setSpacingAfter(10f); //设置段落下空白
+        paragraph17.setAlignment(0); // 设置文字居中 0靠左 1,居中 2,靠右
+        paragraph17.setFirstLineIndent(24); // 设置首行缩进
+        paragraph17.setLeading(20f); // 行间距
+        paragraph17.setSpacingBefore(5f); // 设置段落上空白
+        paragraph17.setSpacingAfter(10f); // 设置段落下空白
 
         Paragraph paragraph18 = new Paragraph("(四)火灾情况", textfont);
-        paragraph18.setAlignment(0); //设置文字居中 0靠左 1,居中 2,靠右
-        paragraph18.setFirstLineIndent(24); //设置首行缩进
-        paragraph18.setLeading(20f); //行间距
-        paragraph18.setSpacingBefore(5f); //设置段落上空白
-        paragraph18.setSpacingAfter(10f); //设置段落下空白
+        paragraph18.setAlignment(0); // 设置文字居中 0靠左 1,居中 2,靠右
+        paragraph18.setFirstLineIndent(24); // 设置首行缩进
+        paragraph18.setLeading(20f); // 行间距
+        paragraph18.setSpacingBefore(5f); // 设置段落上空白
+        paragraph18.setSpacingAfter(10f); // 设置段落下空白
 
         Paragraph paragraph19 = new Paragraph("上一年度发生一起火灾,未造成人员伤亡,造成直接财产损失X万元。", textfont);
-        paragraph19.setAlignment(0); //设置文字居中 0靠左 1,居中 2,靠右
-        paragraph19.setFirstLineIndent(24); //设置首行缩进
-        paragraph19.setLeading(20f); //行间距
-        paragraph19.setSpacingBefore(5f); //设置段落上空白
-        paragraph19.setSpacingAfter(10f); //设置段落下空白
+        paragraph19.setAlignment(0); // 设置文字居中 0靠左 1,居中 2,靠右
+        paragraph19.setFirstLineIndent(24); // 设置首行缩进
+        paragraph19.setLeading(20f); // 行间距
+        paragraph19.setSpacingBefore(5f); // 设置段落上空白
+        paragraph19.setSpacingAfter(10f); // 设置段落下空白
 
         Paragraph paragraph20 = new Paragraph("四、防范对策及建议", headfont);
-        paragraph20.setAlignment(0); //设置文字居中 0靠左 1,居中 2,靠右
-        paragraph20.setFirstLineIndent(24); //设置首行缩进
+        paragraph20.setAlignment(0); // 设置文字居中 0靠左 1,居中 2,靠右
+        paragraph20.setFirstLineIndent(24); // 设置首行缩进
 
         Paragraph paragraph21 = new Paragraph("1、建议联系消防设施维保单位对本单位开展一次全面维护保养,对损坏、故障的设施要及时修复,确保消防设施完整好用;", textfont);
-        paragraph21.setAlignment(0); //设置文字居中 0靠左 1,居中 2,靠右
-        paragraph21.setFirstLineIndent(24); //设置首行缩进
-        paragraph21.setLeading(20f); //行间距
-        paragraph21.setSpacingBefore(5f); //设置段落上空白
-        paragraph21.setSpacingAfter(10f); //设置段落下空白
+        paragraph21.setAlignment(0); // 设置文字居中 0靠左 1,居中 2,靠右
+        paragraph21.setFirstLineIndent(24); // 设置首行缩进
+        paragraph21.setLeading(20f); // 行间距
+        paragraph21.setSpacingBefore(5f); // 设置段落上空白
+        paragraph21.setSpacingAfter(10f); // 设置段落下空白
 
         Paragraph paragraph22 = new Paragraph("2、建议对照重点单位消防档案管理办法,进一步完善员工安全培训记录、明确消防重点部位等内容;", textfont);
-        paragraph22.setAlignment(0); //设置文字居中 0靠左 1,居中 2,靠右
-        paragraph22.setFirstLineIndent(24); //设置首行缩进
-        paragraph22.setLeading(20f); //行间距
-        paragraph22.setSpacingBefore(5f); //设置段落上空白
-        paragraph22.setSpacingAfter(10f); //设置段落下空白
+        paragraph22.setAlignment(0); // 设置文字居中 0靠左 1,居中 2,靠右
+        paragraph22.setFirstLineIndent(24); // 设置首行缩进
+        paragraph22.setLeading(20f); // 行间距
+        paragraph22.setSpacingBefore(5f); // 设置段落上空白
+        paragraph22.setSpacingAfter(10f); // 设置段落下空白
 
         Paragraph paragraph23 = new Paragraph("3、建议对单位重点部位开展一轮全面自查,落实值班、巡查以及应急处置工作职责,确保“实名制”管理工作制度落实到位;", textfont);
-        paragraph23.setAlignment(0); //设置文字居中 0靠左 1,居中 2,靠右
-        paragraph23.setFirstLineIndent(24); //设置首行缩进
-        paragraph23.setLeading(20f); //行间距
-        paragraph23.setSpacingBefore(5f); //设置段落上空白
-        paragraph23.setSpacingAfter(10f); //设置段落下空白
+        paragraph23.setAlignment(0); // 设置文字居中 0靠左 1,居中 2,靠右
+        paragraph23.setFirstLineIndent(24); // 设置首行缩进
+        paragraph23.setLeading(20f); // 行间距
+        paragraph23.setSpacingBefore(5f); // 设置段落上空白
+        paragraph23.setSpacingAfter(10f); // 设置段落下空白
 
         Paragraph paragraph24 = new Paragraph("4、建议充分利用场所自身有利条件,在电子屏、明显位置循环播放宣传视频、张贴海报等形式加强消防安全提示。定期对单位员工开展消防安全教育和重点岗位专题培训,持续提高员工消防安全“一懂三会”基本能力。", textfont);
-        paragraph24.setAlignment(0); //设置文字居中 0靠左 1,居中 2,靠右
-        paragraph24.setFirstLineIndent(24); //设置首行缩进
-        paragraph24.setLeading(20f); //行间距
-        paragraph24.setSpacingBefore(5f); //设置段落上空白
-        paragraph24.setSpacingAfter(10f); //设置段落下空白
+        paragraph24.setAlignment(0); // 设置文字居中 0靠左 1,居中 2,靠右
+        paragraph24.setFirstLineIndent(24); // 设置首行缩进
+        paragraph24.setLeading(20f); // 行间距
+        paragraph24.setSpacingBefore(5f); // 设置段落上空白
+        paragraph24.setSpacingAfter(10f); // 设置段落下空白
 
         Paragraph paragraph25 = new Paragraph("五、具体问题清单", headfont);
-        paragraph25.setAlignment(0); //设置文字居中 0靠左 1,居中 2,靠右
-        paragraph25.setFirstLineIndent(24); //设置首行缩进
+        paragraph25.setAlignment(0); // 设置文字居中 0靠左 1,居中 2,靠右
+        paragraph25.setFirstLineIndent(24); // 设置首行缩进
 
 // 直线
 //        Paragraph p1 = new Paragraph();
@@ -442,7 +459,7 @@ public class DemReportDataServiceImpl extends AbstractCrudService<DemReportDataM
             table.addCell(createCell("下午茶", textfont));
             table.addCell(createCell("回家", textfont));
             table.addCell(createCell("吃晚饭", textfont));
-            totalQuantity ++;
+            totalQuantity++;
         }
         table.addCell(createCell("总计", keyfont));
         table.addCell(createCell("", textfont));
@@ -500,6 +517,7 @@ public class DemReportDataServiceImpl extends AbstractCrudService<DemReportDataM
         cell.setPhrase(new Phrase(value, font));
         return cell;
     }
+
     /**
      * 创建单元格(指定字体、水平..)
      * @param value
@@ -514,6 +532,7 @@ public class DemReportDataServiceImpl extends AbstractCrudService<DemReportDataM
         cell.setPhrase(new Phrase(value, font));
         return cell;
     }
+
     /**
      * 创建单元格(指定字体、水平居..、单元格跨x列合并)
      * @param value
@@ -530,6 +549,7 @@ public class DemReportDataServiceImpl extends AbstractCrudService<DemReportDataM
         cell.setPhrase(new Phrase(value, font));
         return cell;
     }
+
     /**
      * 创建单元格(指定字体、水平居..、单元格跨x列合并、设置单元格内边距)
      * @param value
@@ -557,6 +577,7 @@ public class DemReportDataServiceImpl extends AbstractCrudService<DemReportDataM
         }
         return cell;
     }
+
     /**
      * 创建单元格(指定字体、水平..、边框宽度:0表示无边框、内边距)
      * @param value
@@ -605,6 +626,7 @@ public class DemReportDataServiceImpl extends AbstractCrudService<DemReportDataM
         }
         return table;
     }
+
     /**
      * 创建指定列宽、列数的表格
      * @param widths
@@ -622,6 +644,7 @@ public class DemReportDataServiceImpl extends AbstractCrudService<DemReportDataM
         }
         return table;
     }
+
     /**
      * 创建空白的表格
      * @return

+ 2 - 2
service-fire/service-fire-biz/src/main/resources/mapper/fire/PatrolInspectionPlanSiteSonMapper.xml

@@ -19,8 +19,8 @@
         JOIN patrol_inspection_plan_son AS pips ON pia.id = pips.area_id
         JOIN patrol_inspection_plan_site_son AS pipss ON pips.id = pipss.plan_id
         <where>
-            pia.company_id = 1
-            AND pia. ENABLE = 1
+            -- pia.company_id = 1
+            pia. ENABLE = 1
             AND pips.interval_time BETWEEN #{startTime}
             AND #{endTime}
             <if test="inspectionStatus != null and inspectionStatus!=0">