From 64d3e9657fb45b6415b19e23f483d46a82efe939 Mon Sep 17 00:00:00 2001
From: 13693261870 <252740454@qq.com>
Date: 星期一, 06 三月 2023 13:56:42 +0800
Subject: [PATCH] 1

---
 src/main/java/com/lf/server/controller/data/upload/UploadController.java |   37 +++++++++++++++++++------------------
 1 files changed, 19 insertions(+), 18 deletions(-)

diff --git a/src/main/java/com/lf/server/controller/data/upload/UploadController.java b/src/main/java/com/lf/server/controller/data/upload/UploadController.java
index a9798bf..28ff4cf 100644
--- a/src/main/java/com/lf/server/controller/data/upload/UploadController.java
+++ b/src/main/java/com/lf/server/controller/data/upload/UploadController.java
@@ -46,7 +46,8 @@
 
             return success(pathName);
         } catch (Exception ex) {
-            return fail(ex.getMessage(), null);
+            log.error(ex.getMessage(), ex);
+            return fail(ex, null);
         }
     }
 
@@ -59,7 +60,7 @@
     @PostMapping(value = "/uploadFiles")
     public ResponseMsg<Object> uploadFiles(String path, HttpServletRequest req, HttpServletResponse res) {
         try {
-            List<MetaFileEntity> list = uploadService.uploadData(null, path, req, res);
+            List<MetaFileEntity> list = uploadService.uploadData(null, path, false, req, res);
             if (null == list || list.isEmpty()) {
                 return fail("娌℃湁鎵惧埌涓婁紶鏂囦欢", null);
             }
@@ -68,7 +69,7 @@
 
             return success(list);
         } catch (Exception ex) {
-            return fail(ex.getMessage(), null);
+            return fail(ex, null);
         }
     }
 
@@ -82,7 +83,7 @@
     @ApiOperation(value = "涓婁紶Excel闄勪欢")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "path", value = "璺緞", dataType = "String", paramType = "query"),
-            @ApiImplicitParam(name = "ids", value = "婧愭暟鎹泦鍚�", dataType = "Integer", paramType = "query")
+            @ApiImplicitParam(name = "ids", value = "鍏冩暟鎹泦鍚�", dataType = "Integer", paramType = "query")
     })
     @ResponseBody
     @PostMapping(value = "/uploadXlsAnnex")
@@ -93,27 +94,27 @@
                 return fail("鐢ㄦ埛鏈櫥褰�", null);
             }
             if (null == ids || ids.length == 0) {
-                return fail("鎵句笉鍒版簮鏁版嵁鐨処D闆嗗悎");
+                return fail("鎵句笉鍒板厓鏁版嵁鐨処D闆嗗悎");
             }
 
             List<MetaEntity> ms = metaService.selectXlsAnnex(ids, UploadAttachService.getTabs());
             if (null == ms || ms.isEmpty()) {
-                return fail("鎵句笉鍒拌涓婁紶闄勪欢鐨勬簮鏁版嵁");
+                return fail("鎵句笉鍒拌涓婁紶闄勪欢鐨勫厓鏁版嵁");
             }
 
-            List<MetaFileEntity> list = uploadService.uploadData(null, path, req, res);
+            List<MetaFileEntity> list = uploadService.uploadData(null, path, false, req, res);
             if (null == list || list.isEmpty()) {
                 return fail("娌℃湁鎵惧埌涓婁紶鏂囦欢", null);
             }
 
             List<KeyValueEntity> rs = uploadAttachService.uploadXlsAnnex(ue, ms, list, path);
             if (null == rs || rs.size() == 0) {
-                return fail("娌℃湁瑕佹洿鏂扮殑婧愭暟鎹�");
+                return fail("娌℃湁瑕佹洿鏂扮殑鍏冩暟鎹�");
             }
 
             return success(rs);
         } catch (Exception ex) {
-            return fail(ex.getMessage(), null);
+            return fail(ex, null);
         }
     }
 
@@ -125,11 +126,11 @@
     @GetMapping(value = "/selectFiles")
     public ResponseMsg<List<MetaFileEntity>> selectFiles(String path) {
         try {
-            List<MetaFileEntity> list = uploadService.selectFiles(path, StaticData.ALL_EXTENSION);
+            List<MetaFileEntity> list = uploadService.selectFiles(path);
 
             return success(list);
         } catch (Exception ex) {
-            return fail(ex.getMessage(), null);
+            return fail(ex, null);
         }
     }
 
@@ -154,7 +155,7 @@
 
             return success("鎴愬姛", rows);
         } catch (Exception ex) {
-            return fail(ex.getMessage(), null);
+            return fail(ex, null);
         }
     }
 
@@ -189,14 +190,14 @@
 
             return success(list);
         } catch (Exception ex) {
-            return fail(ex.getMessage(), null);
+            return fail(ex, null);
         }
     }
 
     @SysLog()
     @ApiOperation(value = "鎻掑叆鏂囦欢")
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "list", value = "婧愭暟鎹枃浠堕泦鍚�", dataType = "MetaFileEntity", paramType = "body")
+            @ApiImplicitParam(name = "list", value = "鍏冩暟鎹枃浠堕泦鍚�", dataType = "MetaFileEntity", paramType = "body")
     })
     @ResponseBody
     @PostMapping(value = "/insertFiles")
@@ -207,19 +208,19 @@
                 return fail("鐢ㄦ埛鏈櫥褰�", null);
             }
             if (null == list || list.isEmpty()) {
-                return fail("婧愭暟鎹枃浠堕泦鍚堜负绌�", null);
+                return fail("鍏冩暟鎹枃浠堕泦鍚堜负绌�", null);
             }
 
             uploadService.insertFiles(ue, list, req);
 
             return success("鎴愬姛", list);
         } catch (Exception ex) {
-            return fail(ex.getMessage(), null);
+            return fail(ex, null);
         }
     }
 
     @SysLog()
-    @ApiOperation(value = "鍒犻櫎婧愭暟鎹�")
+    @ApiOperation(value = "鍒犻櫎鍏冩暟鎹�")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "ids", value = "ID鏁扮粍", dataType = "Integer", paramType = "query", example = "1,2")
     })
@@ -234,7 +235,7 @@
 
             return success(count);
         } catch (Exception ex) {
-            return fail(ex.getMessage(), -1);
+            return fail(ex, -1);
         }
     }
 }

--
Gitblit v1.9.3