From 9b44e841586ce281e4e3e9d7296d74b29939418b Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期三, 22 五月 2024 10:53:17 +0800
Subject: [PATCH] 代码提交

---
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceFundController.java |   24 +++++++++++++-----------
 1 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceFundController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceFundController.java
index 3476b1a..5963349 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceFundController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceFundController.java
@@ -102,7 +102,7 @@
      * 鏌ヨ璐圭敤鐢宠涓诲垪琛�
      */
     @ApiOperation("鏌ヨ璐圭敤鐢宠涓诲垪琛�")
-    //@PreAuthorize("@ss.hasPermi('project:fund:list')")
+    //// @PreAuthorize("@ss.hasPermi('project:fund:list')")
     @GetMapping("/list")
     public TableDataInfo list(ServiceFund serviceFund) {
         startPage();
@@ -196,7 +196,7 @@
     }
 
     @ApiOperation("鏌ヨ璐圭敤鐢宠涓诲垪琛�")
-    //@PreAuthorize("@ss.hasPermi('project:fund:list')")
+    //// @PreAuthorize("@ss.hasPermi('project:fund:list')")
     @GetMapping(value = "/getInfo/{infoid}")
     public AjaxResult getInfoByInfoId(@PathVariable("infoid") Long infoid) {
         return AjaxResult.success(serviceFundService.getInfoByInfoId(infoid));
@@ -218,7 +218,7 @@
      * 瀵煎嚭璐圭敤鐢宠涓诲垪琛�
      */
     @ApiOperation("瀵煎嚭璐圭敤鐢宠涓诲垪琛�")
-    //@PreAuthorize("@ss.hasPermi('project:fund:export')")
+    //// @PreAuthorize("@ss.hasPermi('project:fund:export')")
     @Log(title = "璐圭敤鐢宠涓�", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(ServiceFund serviceFund) {
@@ -232,7 +232,7 @@
      * 鑾峰彇璐圭敤鐢宠涓昏缁嗕俊鎭�
      */
     @ApiOperation("鑾峰彇璐圭敤鐢宠涓昏缁嗕俊鎭�")
-    //@PreAuthorize("@ss.hasPermi('project:fund:query')")
+    //// @PreAuthorize("@ss.hasPermi('project:fund:query')")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id) {
         return AjaxResult.success(serviceFundService.getById(id));
@@ -242,7 +242,7 @@
      * 鏂板璐圭敤鐢宠涓�
      */
     @ApiOperation("鏂板璐圭敤鐢宠涓�")
-    //@PreAuthorize("@ss.hasPermi('project:fund:add')")
+    //// @PreAuthorize("@ss.hasPermi('project:fund:add')")
     @Log(title = "璐圭敤鐢宠涓�", businessType = BusinessType.INSERT)
     @PostMapping("/add")
     @RepeatSubmit
@@ -571,7 +571,7 @@
      * 鍒犻櫎璐圭敤鐢宠涓�
      */
     @ApiOperation("鍒犻櫎璐圭敤鐢宠涓�")
-    //@PreAuthorize("@ss.hasPermi('project:fund:remove')")
+    //// @PreAuthorize("@ss.hasPermi('project:fund:remove')")
     @Log(title = "璐圭敤鐢宠涓�", businessType = BusinessType.DELETE)
     @GetMapping("/remove/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids) {
@@ -956,6 +956,7 @@
         Map dataMap = new HashMap();
         String dataYX = getDataYX(dataMap, id);
         String filePath = getClass().getResource("/template/").getPath();
+        log.info("filePath鐨勫�间负:{}", filePath);
         System.out.println(filePath);
         //璁剧疆妯℃湰瑁呯疆鏂规硶鍜岃矾寰�,FreeMarker鏀寔澶氱妯℃澘瑁呰浇鏂规硶銆傚彲浠ラ噸servlet锛宑lasspath锛屾暟鎹簱鏁欑▼瑁呰浇锛�
         configuration.setDirectoryForTemplateLoading(new File(filePath));
@@ -986,18 +987,19 @@
         //杈撳嚭鏂囨。璺緞鍙婂悕绉�
         File outFile = new File(RuoYiConfig.getProfile() + "/download/wordtemplate/" + name + ".doc");
         Writer out = null;
-
         try {
             out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outFile), "utf-8"));
 
         } catch (FileNotFoundException e1) {
-            e1.printStackTrace();
+            log.error("FileNotFoundException鎶ラ敊淇℃伅鏄細{}",e1.getMessage());
+//            e1.printStackTrace();
         }
         try {
 
             t.process(dataMap, out);
         } catch (TemplateException e) {
-            e.printStackTrace();
+            log.error("TemplateException鎶ラ敊淇¤嚜鏄細{}",e.getMessage());
+            e.getMessage();
         }
         Map<String, Object> map = new HashMap<>();
         map.put("downloadUrl", "/profile/download/wordtemplate/" + name + ".doc");
@@ -1012,7 +1014,7 @@
             throw new ServiceException("涓嬭浇澶辫触锛岀敤鎴蜂俊鎭嚭閿�", HttpStatus.NO_CONTENT);
         }
         ServiceExternalperson infoByUserNo = null;
-        if (StringUtils.isNotBlank(serviceFund.getUserno())) {
+        if (StringUtils.isNotBlank(serviceFund.getUserno()) && serviceFund.getApplytype().equals("5")) {
             infoByUserNo = externalpersonService.getInfoByUserNo(serviceFund.getUserno());
         }
 
@@ -1139,7 +1141,7 @@
         dataMap.put("CWSH", serviceFund.getFinancechecher() == null ? "" : serviceFund.getFinancechecher());
 
         dataMap.put("YYMMDD", time);
-        dataMap.put("XM", serviceFund.getDonorname() == null ? "" : serviceFund.getDonorname());
+        dataMap.put("XM", serviceFund.getDonorname() == null ? "" : serviceFund.getDonorname().trim());
         dataMap.put("GZRY", serviceFund.getUsername() == null ? "" : serviceFund.getUsername());
         dataMap.put("ZZ", serviceFund.getManagername() == null ? "" : serviceFund.getManagername());
 

--
Gitblit v1.9.3