Quellcode durchsuchen

优化数据下载接口代码

tags/V1.0.1^2
chengwang vor 1 Jahr
Ursprung
Commit
e6ead441bb
2 geänderte Dateien mit 10 neuen und 4 gelöschten Zeilen
  1. +5
    -0
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/entity/vo/airData/AirDataExcelVo.java
  2. +5
    -4
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/airData/query/QueryAirDataListService.java

+ 5
- 0
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/entity/vo/airData/AirDataExcelVo.java Datei anzeigen

@@ -123,6 +123,11 @@ public class AirDataExcelVo {
@ExcelProperty(value = {"设备序列号"},index = 11)
private String serial;

/**
* 序号
*/
private Integer sequence;



}

+ 5
- 4
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/airData/query/QueryAirDataListService.java Datei anzeigen

@@ -33,10 +33,8 @@ import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;
import java.util.*;
import java.util.stream.Collectors;

/**
* @Author ChengWang
@@ -106,8 +104,11 @@ public class QueryAirDataListService {
vo.setPm_2_5(x.getPm25());
vo.setPm_10(x.getPm10());
vo.setVocs(x.getVocs());
vo.setSequence(x.getSequence());
airDataExcelVoList.add(vo);
});
//对列表进行排序
airDataExcelVoList.stream().sorted(Comparator.comparing(AirDataExcelVo::getSequence)).collect(Collectors.toList());

String fileName = inspection.getName()+"+"+inspection.getCode()+".xlsx";
String filePath = UploadFileConfig.uploadFolder + "/data/" + fileName;

Laden…
Abbrechen
Speichern