|
@@ -15,26 +15,18 @@ package com.unis.equipmentOnlineRateAssessment.modular.monitorCamera.service.imp
|
15
|
15
|
import cn.hutool.core.bean.BeanUtil;
|
16
|
16
|
import cn.hutool.core.collection.CollStreamUtil;
|
17
|
17
|
import cn.hutool.core.collection.CollectionUtil;
|
18
|
|
-import cn.hutool.core.date.DateUnit;
|
19
|
|
-import cn.hutool.core.date.DateUtil;
|
20
|
18
|
import cn.hutool.core.util.ObjectUtil;
|
21
|
19
|
import com.alibaba.excel.EasyExcel;
|
22
|
20
|
import com.alibaba.excel.support.ExcelTypeEnum;
|
23
|
|
-import com.alibaba.excel.write.style.column.SimpleColumnWidthStyleStrategy;
|
24
|
|
-import com.alibaba.excel.write.style.row.SimpleRowHeightStyleStrategy;
|
25
|
|
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
26
|
|
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
27
|
21
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
28
|
22
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
29
|
23
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
30
|
24
|
import com.unis.basic.info.modular.orgInfo.entity.OrgInfo;
|
31
|
25
|
import com.unis.basic.info.modular.orgInfo.mapper.OrgInfoMapper;
|
32
|
|
-import com.unis.common.page.CommonPageRequest;
|
33
|
26
|
import com.unis.equipmentOnlineRateAssessment.modular.monitorCamera.param.*;
|
34
|
27
|
import com.unis.equipmentOnlineRateAssessment.modular.monitorCamera.vo.*;
|
35
|
28
|
import com.unis.equipmentOnlineRateAssessment.modular.monitorNvr.entity.MonitorNvr;
|
36
|
29
|
import com.unis.equipmentOnlineRateAssessment.modular.monitorNvr.mapper.MonitorNvrMapper;
|
37
|
|
-import com.unis.statisticalReport.info.modular.grainTempCheck.entity.GrainTempExcel;
|
38
|
30
|
import org.springframework.beans.factory.annotation.Autowired;
|
39
|
31
|
import org.springframework.stereotype.Service;
|
40
|
32
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -43,19 +35,15 @@ import com.unis.equipmentOnlineRateAssessment.modular.monitorCamera.entity.Monit
|
43
|
35
|
import com.unis.equipmentOnlineRateAssessment.modular.monitorCamera.mapper.MonitorCameraMapper;
|
44
|
36
|
import com.unis.equipmentOnlineRateAssessment.modular.monitorCamera.service.MonitorCameraService;
|
45
|
37
|
|
|
38
|
+import javax.servlet.http.HttpServletRequest;
|
46
|
39
|
import javax.servlet.http.HttpServletResponse;
|
47
|
|
-import javax.xml.crypto.Data;
|
48
|
|
-import java.io.File;
|
49
|
40
|
import java.io.IOException;
|
50
|
41
|
import java.math.BigDecimal;
|
51
|
42
|
import java.net.URLEncoder;
|
52
|
|
-import java.text.DecimalFormat;
|
53
|
|
-import java.text.SimpleDateFormat;
|
54
|
43
|
import java.time.*;
|
55
|
44
|
import java.util.ArrayList;
|
56
|
45
|
import java.util.Date;
|
57
|
46
|
import java.util.List;
|
58
|
|
-import java.util.stream.Collectors;
|
59
|
47
|
|
60
|
48
|
/**
|
61
|
49
|
* 摄像头基本信息表Service接口实现类
|
|
@@ -75,6 +63,7 @@ public class MonitorCameraServiceImpl extends ServiceImpl<MonitorCameraMapper, M
|
75
|
63
|
@Autowired
|
76
|
64
|
private MonitorNvrMapper monitorNvrMapper;
|
77
|
65
|
|
|
66
|
+
|
78
|
67
|
@Override
|
79
|
68
|
public Page<CameraAndNvrVO> page(MonitorCameraPageParam pageParam) {
|
80
|
69
|
|
|
@@ -350,21 +339,22 @@ public class MonitorCameraServiceImpl extends ServiceImpl<MonitorCameraMapper, M
|
350
|
339
|
* @date 2024/06/21 10:07
|
351
|
340
|
*/
|
352
|
341
|
@Override
|
353
|
|
- public void AutomatedAssessmentsExport(String fileName, HttpServletResponse response) {
|
354
|
|
-
|
|
342
|
+ public void AutomatedAssessmentsExport(AutomatedAssessmentsExportParam param , HttpServletRequest request, HttpServletResponse response) {
|
355
|
343
|
try {
|
356
|
|
- if (StringUtils.isEmpty(fileName))
|
357
|
|
- fileName = LocalDate.now().toString();
|
|
344
|
+ String fileName = param.getFileName();
|
|
345
|
+ if (StringUtils.isEmpty(fileName));
|
|
346
|
+ fileName = LocalDate.now().toString();
|
358
|
347
|
fileName = URLEncoder.encode(fileName, "UTF-8");
|
359
|
348
|
// 设置响应信息,让浏览器下载文件
|
360
|
|
- response.setContentType("application/vnd.ms-excel");
|
|
349
|
+ response.setContentType("application/xml");
|
361
|
350
|
response.setCharacterEncoding("utf-8");
|
362
|
|
- response.setHeader("Content-disposition", "attachment;filename=" + fileName + ExcelTypeEnum.XLSX.getValue());
|
|
351
|
+ response.setHeader("Content-Disposition", "attachment;filename=" + fileName + ExcelTypeEnum.XLSX.getValue());
|
|
352
|
+
|
363
|
353
|
EasyExcel.write(response.getOutputStream()) // 或, GrainTempExcel.class
|
364
|
354
|
.head(AutomatedAssessmentsExportVO.class) // write 中, GrainTempExcel.class 二选一
|
365
|
355
|
.excelType(ExcelTypeEnum.XLSX)
|
366
|
356
|
.sheet(fileName)
|
367
|
|
- .doWrite(this::data);
|
|
357
|
+ .doWrite(this.getData(param));
|
368
|
358
|
|
369
|
359
|
} catch (IOException e) {
|
370
|
360
|
log.error("自动考核导出异常:{}", e);
|
|
@@ -373,7 +363,18 @@ public class MonitorCameraServiceImpl extends ServiceImpl<MonitorCameraMapper, M
|
373
|
363
|
|
374
|
364
|
}
|
375
|
365
|
|
376
|
|
- private List<AutomatedAssessmentsExportVO> data() {
|
|
366
|
+
|
|
367
|
+ private List<AutomatedAssessmentsExportVO> getData(AutomatedAssessmentsExportParam param){
|
|
368
|
+ AutomatedAssessmentsExportVO vo = new AutomatedAssessmentsExportVO();
|
|
369
|
+ List<AutomatedAssessmentsExportVO> list = new ArrayList<>();
|
|
370
|
+ BeanUtil.copyProperties(param,vo);
|
|
371
|
+ list.add(vo);
|
|
372
|
+
|
|
373
|
+ return list;
|
|
374
|
+ }
|
|
375
|
+
|
|
376
|
+
|
|
377
|
+/* private List<AutomatedAssessmentsExportVO> data() {
|
377
|
378
|
AutomatedAssessmentsExportVO vo = new AutomatedAssessmentsExportVO();
|
378
|
379
|
//获取摄像头总数量
|
379
|
380
|
Integer cameraAllNum = monitorCameraMapper.selectAll(null);
|
|
@@ -409,6 +410,6 @@ public class MonitorCameraServiceImpl extends ServiceImpl<MonitorCameraMapper, M
|
409
|
410
|
list.add(vo);
|
410
|
411
|
|
411
|
412
|
return list;
|
412
|
|
- }
|
|
413
|
+ }*/
|
413
|
414
|
|
414
|
415
|
}
|