This commit is contained in:
2023-10-13 14:46:47 +08:00
parent a0109b0967
commit 5f7ccf837b
7 changed files with 38 additions and 39 deletions

View File

@@ -37,38 +37,10 @@ public class DisPhotovoltaicController {
private final IBusinessService businessService;
private final DisPhotovoltaicService disPhotovoltaicService;
@ApiOperation(value = "获取10kv分布式光伏接入情况")
@PostMapping("/import10")
public void importTakeOrder(MultipartFile file, String startTime, String endTime) throws Exception {
List<ExcelData> list = EasyExcel.read(file.getInputStream())
.head(ExcelData.class)
.headRowNumber(2)
.sheet(2).doReadSync();
//排重
list = list.stream()
.filter(t -> StrUtil.isNotBlank(t.getGenerationUserID()))
.filter(StreamUtil.distinctByKey(ExcelData::getGenerationUserID))
.collect(Collectors.toList());
businessService.testInterfaceByUserId(list, startTime, endTime);
System.out.println();
}
@ApiOperation(value = "获取380kv分布式光伏接入情况")
@PostMapping("/import380")
public void import380(MultipartFile file, String startTime, String endTime) throws Exception {
List<ExcelData> list = EasyExcel.read(file.getInputStream())
.head(ExcelData.class)
.headRowNumber(2)
.sheet(3).doReadSync();
//排重
list = list.stream()
.filter(t -> StrUtil.isNotBlank(t.getGenerationUserID()))
.filter(StreamUtil.distinctByKey(ExcelData::getGenerationUserID))
.collect(Collectors.toList());
businessService.testInterfaceByUserId(list, startTime, endTime);
System.out.println();
@ApiOperation(value = "查询所有用户的遥测数据")
@PostMapping("/queryTelemetryData")
public void queryTelemetryData(String startTime, String endTime) {
businessService.queryTelemetryData(startTime, endTime);
}
@ApiOperation(value = "导入10kv分布式光伏接入情况", produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)