fix:报告生成的图片按tag1排序
This commit is contained in:
@@ -35,4 +35,7 @@ public class SimulationTaskResultCurveResp extends BaseResp {
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "排序号")
|
||||
private String tag1;
|
||||
}
|
||||
|
||||
@@ -143,8 +143,18 @@ public class DataAnalysisServiceImpl implements IDataAnalysisService {
|
||||
.eq(FileMetadataInfo::getTenantId, ThreadLocalContext.getTenantId())
|
||||
.isNull(FileMetadataInfo::getDeletedAt)
|
||||
.list();
|
||||
List<FileMetadataInfo> sortedList = fileMetadataInfoList.stream()
|
||||
.sorted(Comparator.comparing(FileMetadataInfo::getTag1,
|
||||
PageInfo<FileMetadataInfo> page = new PageInfo<>(fileMetadataInfoList);
|
||||
long total = page.getTotal();
|
||||
|
||||
List<Long> fileIdList = fileMetadataInfoList.stream().map(FileMetadataInfo::getId).toList();
|
||||
List<SimulationTaskResultCurveResp> finalResultList = hierarchyHelper.processFileHierarchy(
|
||||
fileIdList,
|
||||
SimulationTaskResultCurveResp.class,
|
||||
FileMetadataHierarchyHelper::setFileHierarchy
|
||||
);
|
||||
|
||||
List<SimulationTaskResultCurveResp> sortedList = finalResultList.stream()
|
||||
.sorted(Comparator.comparing(SimulationTaskResultCurveResp::getTag1,
|
||||
Comparator.nullsLast((tag1, tag2) -> {
|
||||
try {
|
||||
int num1 = Integer.parseInt(tag1.trim());
|
||||
@@ -154,20 +164,11 @@ public class DataAnalysisServiceImpl implements IDataAnalysisService {
|
||||
return tag1.compareTo(tag2);
|
||||
}
|
||||
})))
|
||||
.collect(Collectors.toList());
|
||||
PageInfo<FileMetadataInfo> page = new PageInfo<>(sortedList);
|
||||
long total = page.getTotal();
|
||||
.toList();
|
||||
|
||||
List<Long> fileIdList = sortedList.stream().map(FileMetadataInfo::getId).toList();
|
||||
List<SimulationTaskResultCurveResp> finalResultList = hierarchyHelper.processFileHierarchy(
|
||||
fileIdList,
|
||||
SimulationTaskResultCurveResp.class,
|
||||
FileMetadataHierarchyHelper::setFileHierarchy
|
||||
);
|
||||
|
||||
PageInfo<SimulationTaskResultCurveResp> page1 = new PageInfo<>(finalResultList);
|
||||
PageInfo<SimulationTaskResultCurveResp> page1 = new PageInfo<>(sortedList);
|
||||
page1.setTotal(total);
|
||||
return PageUtils.getJsonObjectSdmResponse(finalResultList, page1);
|
||||
return PageUtils.getJsonObjectSdmResponse(sortedList, page1);
|
||||
}
|
||||
}
|
||||
return PageUtils.getJsonObjectSdmResponse(new ArrayList<>(), new PageInfo<>());
|
||||
|
||||
Reference in New Issue
Block a user