hjc 5 months ago
parent
commit
6f97db458d

+ 2 - 2
unis-plugin/unis-plugin-biz/src/main/java/com/unis/equipmentOnlineRateAssessment/modular/monitorCamera/controller/MonitorCameraController.java

@@ -205,8 +205,8 @@ public class MonitorCameraController {
205
     @ApiOperation("自动考核-导出")
205
     @ApiOperation("自动考核-导出")
206
     //@SaCheckPermission("/equipmentOnlineRateAssessment/monitorCamera/page")
206
     //@SaCheckPermission("/equipmentOnlineRateAssessment/monitorCamera/page")
207
     @GetMapping("/equipmentOnlineRateAssessment/monitorCamera/AutomatedAssessmentsExport")
207
     @GetMapping("/equipmentOnlineRateAssessment/monitorCamera/AutomatedAssessmentsExport")
208
-    public void AutomatedAssessmentsExport(String fileName, HttpServletResponse response) {
209
-        monitorCameraService.AutomatedAssessmentsExport(fileName,response);
208
+    public void AutomatedAssessmentsExport(AutomatedAssessmentsExportParam param) {
209
+        monitorCameraService.AutomatedAssessmentsExport(param.getFileName(), param.getResponse());
210
 
210
 
211
     }
211
     }
212
 
212
 

+ 21 - 0
unis-plugin/unis-plugin-biz/src/main/java/com/unis/equipmentOnlineRateAssessment/modular/monitorCamera/param/AutomatedAssessmentsExportParam.java

@@ -0,0 +1,21 @@
1
+package com.unis.equipmentOnlineRateAssessment.modular.monitorCamera.param;
2
+
3
+import lombok.Data;
4
+import org.springframework.web.bind.annotation.ModelAttribute;
5
+
6
+import javax.servlet.http.HttpServlet;
7
+import javax.servlet.http.HttpServletRequest;
8
+import javax.servlet.http.HttpServletResponse;
9
+
10
+/**
11
+ * @author hjc
12
+ * @date 2024/6/24 17:07
13
+ */
14
+@Data
15
+public class AutomatedAssessmentsExportParam{
16
+
17
+    private String fileName;
18
+
19
+    private HttpServletResponse response;
20
+
21
+}

+ 5 - 4
unis-plugin/unis-plugin-biz/src/main/java/com/unis/equipmentOnlineRateAssessment/modular/monitorCamera/service/impl/MonitorCameraServiceImpl.java

@@ -222,7 +222,7 @@ public class MonitorCameraServiceImpl extends ServiceImpl<MonitorCameraMapper, M
222
 
222
 
223
         try {
223
         try {
224
             if (StringUtils.isEmpty(fileName))
224
             if (StringUtils.isEmpty(fileName))
225
-                fileName = LocalDate.now()+"在线统计分析表";
225
+                fileName = LocalDate.now().toString();
226
             fileName = URLEncoder.encode(fileName, "UTF-8");
226
             fileName = URLEncoder.encode(fileName, "UTF-8");
227
             // 设置响应信息,让浏览器下载文件
227
             // 设置响应信息,让浏览器下载文件
228
             response.setContentType("application/vnd.ms-excel");
228
             response.setContentType("application/vnd.ms-excel");
@@ -234,7 +234,7 @@ public class MonitorCameraServiceImpl extends ServiceImpl<MonitorCameraMapper, M
234
                     .sheet(fileName)
234
                     .sheet(fileName)
235
                     .doWrite(orgInfoMapper.statisticalAnalysis());
235
                     .doWrite(orgInfoMapper.statisticalAnalysis());
236
         } catch (IOException e) {
236
         } catch (IOException e) {
237
-            log.error("在线统计分析导出异常:{}",e);
237
+            log.error("在线统计分析导出异常:{}", e);
238
             throw new RuntimeException(e);
238
             throw new RuntimeException(e);
239
         }
239
         }
240
     }
240
     }
@@ -354,7 +354,7 @@ public class MonitorCameraServiceImpl extends ServiceImpl<MonitorCameraMapper, M
354
 
354
 
355
         try {
355
         try {
356
             if (StringUtils.isEmpty(fileName))
356
             if (StringUtils.isEmpty(fileName))
357
-                fileName = LocalDate.now()+ "自动考核数据表";
357
+                fileName = LocalDate.now().toString();
358
             fileName = URLEncoder.encode(fileName, "UTF-8");
358
             fileName = URLEncoder.encode(fileName, "UTF-8");
359
             // 设置响应信息,让浏览器下载文件
359
             // 设置响应信息,让浏览器下载文件
360
             response.setContentType("application/vnd.ms-excel");
360
             response.setContentType("application/vnd.ms-excel");
@@ -365,8 +365,9 @@ public class MonitorCameraServiceImpl extends ServiceImpl<MonitorCameraMapper, M
365
                     .excelType(ExcelTypeEnum.XLSX)
365
                     .excelType(ExcelTypeEnum.XLSX)
366
                     .sheet(fileName)
366
                     .sheet(fileName)
367
                     .doWrite(this::data);
367
                     .doWrite(this::data);
368
+
368
         } catch (IOException e) {
369
         } catch (IOException e) {
369
-            log.error("自动考核导出异常:{}",e);
370
+            log.error("自动考核导出异常:{}", e);
370
             throw new RuntimeException(e);
371
             throw new RuntimeException(e);
371
         }
372
         }
372
 
373