瀏覽代碼

调整pdf导出的尺寸和字体的大小

xiari 1 年之前
父節點
當前提交
7be6448b40

+ 33 - 1
ruoyi-modules/ruoyi-backstage/src/main/java/org/dromara/backstage/cardCenter/controller/PtSubsidyitemController.java

@@ -8,6 +8,7 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Optional;
+import java.util.stream.Collectors;
 
 import com.itextpdf.kernel.geom.PageSize;
 import lombok.RequiredArgsConstructor;
@@ -15,6 +16,7 @@ import jakarta.servlet.http.HttpServletResponse;
 import jakarta.validation.constraints.*;
 import cn.dev33.satoken.annotation.SaCheckPermission;
 import org.dromara.backstage.cardCenter.domain.bo.PtSubsidyReportBo;
+import org.dromara.backstage.cardCenter.domain.vo.PtSubsidyFirstPageVo;
 import org.dromara.backstage.cardCenter.domain.vo.PtSubsidyReportVo;
 import org.dromara.common.core.utils.DateUtils;
 import org.dromara.common.core.utils.StringUtils;
@@ -132,6 +134,36 @@ public class PtSubsidyitemController extends BaseController {
         return ptSubsidyitemService.queryPageReportList(bo, pageQuery);
     }
 
+    /**
+     * 首页查询 每月的补助报表
+     * @param bo
+     * @param pageQuery
+     * @return
+     */
+    @GetMapping("/queryReportByManager")
+    public R<List<PtSubsidyFirstPageVo>> queryReportByManager() {
+
+
+        // todo 待完善: 获取当前登录用户的角色,如果角色是管理员、补助管理员、补助发放、补助审核人员则返回数据,否则返回个人的补助列表信息
+        //dict_first_page_show_role
+
+        // todo 提取到service类中
+
+        PtSubsidyReportBo bo = new PtSubsidyReportBo();
+        bo.setCountType("1");
+        PageQuery pageQuery = new PageQuery();
+        pageQuery.setPageNum(1);
+        pageQuery.setPageSize(12);
+
+        TableDataInfo<PtSubsidyReportVo> result = ptSubsidyitemService.queryPageReportList(bo, pageQuery);
+
+        List<PtSubsidyFirstPageVo> list = result.getRows().stream().map(item -> {
+            return new PtSubsidyFirstPageVo(item.getFillDate(), item.getFillMoney(), item.getCountNumber());
+        }).collect(Collectors.toList());
+
+        return R.ok(list);
+    }
+
     //补助报表导出
     @SaCheckPermission("subsidy:ptSubsidyitem:ptSubsidyitemReport")
     @Log(title = "补助报表导出", businessType = BusinessType.EXPORT)
@@ -179,7 +211,7 @@ public class PtSubsidyitemController extends BaseController {
             response.setContentType("application/pdf; charset=UTF-8");
             response.setHeader("Content-Disposition", URLEncoder.encode(fileName, StandardCharsets.UTF_8));
 
-            PdfUtil.renderPdf("PtSubsidyReport.html",hashMap, response.getOutputStream(), PageSize.A4);
+            PdfUtil.renderPdf("PtSubsidyReport.html",hashMap, response.getOutputStream(), PageSize.A4.rotate());
         } catch (IOException e) {
             throw new RuntimeException(e);
         }

+ 1 - 1
ruoyi-modules/ruoyi-backstage/src/main/java/org/dromara/backstage/consumption/controller/XfConsumeDetailController.java

@@ -212,7 +212,7 @@ public class XfConsumeDetailController extends BaseController {
             response.setContentType("application/pdf; charset=UTF-8");
             response.setHeader("Content-Disposition", URLEncoder.encode(fileName, StandardCharsets.UTF_8));
 
-            PdfUtil.renderPdf("bussinessTemplate1.html",hashMap, response.getOutputStream(), PageSize.A4);
+            PdfUtil.renderPdf("bussinessTemplate1.html",hashMap, response.getOutputStream(), PageSize.A4.rotate());
         } catch (IOException e) {
             throw new RuntimeException(e);
         }

+ 2 - 2
ruoyi-modules/ruoyi-backstage/src/main/resources/template/ftl/PtSubsidyReport.html

@@ -6,7 +6,7 @@
     <title>补助统计报表</title>
 </head>
 <body>
-<h3 style="text-align: center;font-size: 14px"><b>补助统计报表</b></h3>
+<h3 style="text-align: center;font-size: 20px"><b>补助统计报表</b></h3>
 <div style="margin: 0 auto;">
     <div style="width:100%;">
         <div class="item-space">
@@ -55,7 +55,7 @@
 </body>
 <style>
     body {
-        font-size: 8px;
+        font-size: 13px;
     }
     td,th {
         border: 1px solid #000;

+ 2 - 2
ruoyi-modules/ruoyi-backstage/src/main/resources/template/ftl/bussinessTemplate1.html

@@ -7,7 +7,7 @@
     <title>营业报表</title>
 </head>
 <body>
-<h3 style="text-align: center;font-size: 14px"><b>营业报表</b></h3>
+<h3 style="text-align: center;font-size: 20px"><b>营业报表</b></h3>
 <div style="margin: 0 auto;">
     <div style="width:100%;">
         <div class="item-space">
@@ -68,7 +68,7 @@
 </body>
 <style>
     body {
-        font-size: 8px;
+        font-size: 13px;
     }
     td,th {
         border: 1px solid #000;