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