Преглед на файлове

Merge remote-tracking branch 'origin/master'

zhoufan преди 2 години
родител
ревизия
49f4df9130

+ 4 - 11
zxkf-api/src/main/java/api/controller/call/RecordController.java

@@ -1,9 +1,5 @@
1 1
 package api.controller.call;
2
-
3
-import api.entity.database.system.Config;
4
-import api.entity.database.system.Customer;
5 2
 import api.service.system.IConfigService;
6
-import api.util.annotation.Anonymous;
7 3
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
8 4
 import com.baomidou.mybatisplus.core.metadata.IPage;
9 5
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -17,7 +13,6 @@ import api.util.enums.BusinessType;
17 13
 import api.util.helper.StringHelper;
18 14
 import io.swagger.annotations.Api;
19 15
 import io.swagger.annotations.ApiOperation;
20
-import lombok.var;
21 16
 import org.springframework.beans.factory.annotation.Autowired;
22 17
 import org.springframework.web.bind.annotation.*;
23 18
 import java.util.Arrays;
@@ -36,7 +31,7 @@ public class RecordController extends BaseController {
36 31
     @Log(title = "查询通话记录表列表",businessType = BusinessType.QUERY)
37 32
     @GetMapping
38 33
     public AjaxResult getList(Record input, PageInput pageInput) {
39
-        LambdaQueryWrapper<Record> qw = new LambdaQueryWrapper();
34
+        LambdaQueryWrapper<Record> qw = new LambdaQueryWrapper<>();
40 35
         qw.eq(input.getRecordId() != null && input.getRecordId() > 0, Record::getRecordId, input.getRecordId());
41 36
         qw.like(!StringHelper.isEmpty(input.getUuid()), Record::getUuid, input.getUuid());
42 37
         qw.like(!StringHelper.isEmpty(input.getBaseNumber()), Record::getBaseNumber, input.getBaseNumber());
@@ -81,11 +76,9 @@ public class RecordController extends BaseController {
81 76
         //添加录音路径
82 77
         if (Records!=null && Records.size()>0)
83 78
         {
84
-            for (int i=0;i<Records.size();i++)
85
-            {
86
-                if (!StringHelper.isEmpty(Records.get(i ).getFilePath()))
87
-                {
88
-                    Records.get(i ).setFilePath(captchaEnabled+ Records.get(i ).getFilePath());
79
+            for (Record record : Records) {
80
+                if (!StringHelper.isEmpty(record.getFilePath())) {
81
+                    record.setFilePath(captchaEnabled + record.getFilePath());
89 82
                 }
90 83
             }
91 84
         }

+ 1 - 0
zxkf-api/src/main/java/api/controller/system/CustomerController.java

@@ -79,6 +79,7 @@ public class CustomerController extends BaseController {
79 79
         {
80 80
             return Success("成功", customer);
81 81
         }
82
+
82 83
         else
83 84
         {
84 85
             return Error("该客户不存在");

+ 4 - 6
zxkf-api/src/main/java/api/controller/system/SysAccessoriesController.java

@@ -48,18 +48,16 @@ public class SysAccessoriesController extends BaseController {
48 48
 
49 49
         //全部文件名,若多个,则逗号分隔
50 50
         StringBuilder allFileNames = new StringBuilder();
51
-
52
-        //上传路径
53
-       // String fileSavePath = "files";
54
-
55
-
56 51
         String fileSavePath = "files/order/" + DateHelper.getDate();
57 52
         //若文件夹不存在,则创建文件夹
58 53
         File pFile = new File(fileSavePath);
59 54
         if (!pFile.exists()) {
60 55
             pFile.mkdirs();
61 56
         }
62
-
57
+        long size = file.getSize();
58
+        if (size > 20 * 1024 * 1024) {
59
+            return Error("文件大小不能超过20mb");
60
+        }
63 61
             //得到原始文件名
64 62
             newFileName = new StringBuilder(file.getOriginalFilename());
65 63
             //查询文件名中点号所处位置

+ 2 - 2
zxkf-util/src/main/java/api/util/helper/FileUploadHelper.java

@@ -90,8 +90,8 @@ public class FileUploadHelper {
90 90
                 throw new IOException("文件名不能超过50");
91 91
             }
92 92
             long size = file.getSize();
93
-            if (size > 50 * 1024 * 1024) {
94
-                throw new IOException("文件大小不能超过50mb");
93
+            if (size > 20 * 1024 * 1024) {
94
+                throw new IOException("文件大小不能超过20mb");
95 95
             }
96 96
             List<String> exts = Arrays.asList("bmp", "gif", "jpg", "jpeg", "png");
97 97
             String fileName = file.getOriginalFilename();