Browse Source

问题整改报表整改率bug处理

jingyuanchao 1 year ago
parent
commit
d752691695

+ 4 - 4
soc-modules/soc-modules-core/src/main/resources/mapper/reportForms/ResumptionReportMapper.xml

@@ -182,10 +182,10 @@
       /*  COUNT( c.id ) AS realityRectificationNumber,*/
         IF
         (
-        COUNT( a.exception_reform_count )= 0
+        SUM( a.exception_reform_count )= 0
         OR IFNULL( a.exception_count, 0 )= 0,
         '0%',
-        CONCAT(ROUND(COUNT( a.exception_reform_count )/ IFNULL( a.exception_count, 0 )* 100,2) , '%' )) AS realityRectificationRate
+        CONCAT(ROUND(SUM( a.exception_reform_count )/ IFNULL( a.exception_count, 0 )* 100,2) , '%' )) AS realityRectificationRate
         FROM
         (
             SELECT
@@ -241,10 +241,10 @@
         IFNULL(SUM( a.exception_reform_count ),0) AS realityRectificationNumber,
         IF
         (
-        COUNT( a.exception_reform_count )= 0
+        SUM( a.exception_reform_count )= 0
         OR IFNULL( a.exception_count, 0 )= 0,
         '0%',
-        CONCAT(ROUND(COUNT( a.exception_reform_count )/ IFNULL( a.exception_count, 0 )* 100,2) , '%' )) AS realityRectificationRate
+        CONCAT(ROUND(SUM( a.exception_reform_count )/ IFNULL( a.exception_count, 0 )* 100,2) , '%' )) AS realityRectificationRate
         FROM
         (
             SELECT

+ 27 - 3
soc-modules/soc-modules-file/src/main/java/com/xunmei/file/utils/PdfUtil.java

@@ -101,6 +101,29 @@ public class PdfUtil {
         }
         return cell;
     }
+    private static PdfPCell cell(Font tableFont, String content, int align, Integer colspan, Integer rowspan, Integer paddingLeft, Integer paddingRight) {
+        PdfPCell cell = new PdfPCell(new Phrase(content, tableFont));
+        if (colspan != null && colspan > 0) {
+            cell.setColspan(colspan);
+        }
+        if (rowspan != null && rowspan > 0) {
+            cell.setRowspan(rowspan);
+        }
+        // cell.setPaddingTop(8f);
+        cell.setPaddingLeft(paddingLeft);
+        cell.setPaddingRight(paddingRight);
+        cell.setPaddingBottom(8f);
+        cell.setLeading(1F, 1.5F);
+        if (PdfPCell.ALIGN_MIDDLE != align) {
+            cell.setHorizontalAlignment(align);
+        } else {
+            //设置单元格的垂直方向对齐方式
+            cell.setVerticalAlignment(PdfPCell.ALIGN_MIDDLE);
+            //设置单元格的水平方向对齐方式
+            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+        }
+        return cell;
+    }
 
     private static PdfPCell cell(Font tableFont, String content, int align, Integer colspan, Integer rowspan, Integer lineSpacing) {
         PdfPCell cell = new PdfPCell(new Phrase(content, tableFont));
@@ -665,10 +688,11 @@ public class PdfUtil {
         PdfUtil.createPDFCell(tableFont, table, data.getCheckTypeText(), Element.ALIGN_MIDDLE, 11, 1);
 
         PdfUtil.createPDFCell(tableFont, table, "检查开始时间", Element.ALIGN_MIDDLE, 3, 1);
-        PdfUtil.createPDFCell(tableFont, table, data.getStartTimeStr(), Element.ALIGN_MIDDLE, 4, 1);
+        //PdfUtil.createPDFCell(tableFont, table, data.getStartTimeStr(), Element.ALIGN_MIDDLE, 4, 1);
+        table.addCell( cell(tableFont, data.getStartTimeStr(), Element.ALIGN_MIDDLE, 4, 1,2,2));
         PdfUtil.createPDFCell(tableFont, table, "检查结束时间", Element.ALIGN_MIDDLE, 3, 1);
-        PdfUtil.createPDFCell(tableFont, table, data.getEndTimeStr(), Element.ALIGN_MIDDLE, 4, 1);
-
+        //PdfUtil.createPDFCell(tableFont, table, data.getEndTimeStr(), Element.ALIGN_MIDDLE, 4, 1);
+        table.addCell( cell(tableFont, data.getEndTimeStr(), Element.ALIGN_MIDDLE, 4, 1,2,2));
         PdfUtil.createPDFCell(tableFont, table, "检查单位", Element.ALIGN_MIDDLE, 3, 1);
         PdfUtil.createPDFCell(tableFont, table, data.getCheckOrgName(), Element.ALIGN_MIDDLE, 4, 1);
         PdfUtil.createPDFCell(tableFont, table, "检查组成员", Element.ALIGN_MIDDLE, 3, 1);