|
@@ -694,82 +694,6 @@ public class DemandService {
|
|
.collect(Collectors.toMap(AlgSchemeStepWindow::getId, Function.identity()));
|
|
.collect(Collectors.toMap(AlgSchemeStepWindow::getId, Function.identity()));
|
|
}
|
|
}
|
|
|
|
|
|
- /**
|
|
|
|
- * 处理数传站数据
|
|
|
|
- * @param selectedRecordsMap:已选择窗口列表
|
|
|
|
- * @param dataTransferWindowPass:数传站数据
|
|
|
|
- * @return 选择的数传站集合
|
|
|
|
- */
|
|
|
|
- private List<StepWindowDataPassRelation> handleDataTransferWindowPassData(Map<String,AlgSchemeStepWindow> selectedRecordsMap, List<AlgSchemeWindowPass> dataTransferWindowPass) {
|
|
|
|
- List<StepWindowDataPassRelation> StepWindowDataPassRelations = new ArrayList<>();
|
|
|
|
-
|
|
|
|
- //将数传站集合转换为Map<String,AlgSchemeWindowPass>的结构
|
|
|
|
- Map<String, List<AlgSchemeWindowPass>> dataTransferWindowPassMap = dataTransferWindowPass.stream()
|
|
|
|
- .collect(Collectors.groupingBy(AlgSchemeWindowPass::getSchemeStepWindowId));
|
|
|
|
-
|
|
|
|
- for(Map.Entry<String, AlgSchemeStepWindow> algSchemeStepWindowEntry : selectedRecordsMap.entrySet()){
|
|
|
|
- String windowId = algSchemeStepWindowEntry.getKey();
|
|
|
|
- AlgSchemeStepWindow algSchemeStepWindow = algSchemeStepWindowEntry.getValue();
|
|
|
|
-
|
|
|
|
- List<AlgSchemeWindowPass> algSchemeWindowPasses = dataTransferWindowPassMap.get(windowId);
|
|
|
|
-
|
|
|
|
- //获取条带窗口结束时间
|
|
|
|
- Date windowEndTime = algSchemeStepWindow.getEndTime();
|
|
|
|
- //查询距离条带窗口结束时间最近的数传站
|
|
|
|
- Optional<AlgSchemeWindowPass> minTransferStationPass = algSchemeWindowPasses.stream()
|
|
|
|
- .min(Comparator.comparing(obj -> Math.abs(obj.getStartTime().getTime() - windowEndTime.getTime())));
|
|
|
|
- if(minTransferStationPass.isPresent()){
|
|
|
|
- AlgSchemeWindowPass algSchemeWindowPass = minTransferStationPass.get();
|
|
|
|
- StepWindowDataPassRelation stepWindowDataPassRelation = new StepWindowDataPassRelation();
|
|
|
|
- stepWindowDataPassRelation.setStepId(algSchemeStepWindow.getSchemeStepId());
|
|
|
|
- stepWindowDataPassRelation.setDataStationWindowId(algSchemeWindowPass.getId());
|
|
|
|
- stepWindowDataPassRelation.setWindowId(algSchemeWindowPass.getSchemeStepWindowId());
|
|
|
|
- stepWindowDataPassRelation.setIsConfirm(IS_CONFIRMED);
|
|
|
|
- StepWindowDataPassRelations.add(stepWindowDataPassRelation);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return StepWindowDataPassRelations;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 处理测控站数据
|
|
|
|
- * @param selectedRecordsMap:已选择窗口列表
|
|
|
|
- * @param controlWindowPass:测控站数据
|
|
|
|
- * @return 选择的测控站集合
|
|
|
|
- */
|
|
|
|
- private List<StepWindowControlPassRelation> handleControlWindowPassData(Map<String,AlgSchemeStepWindow> selectedRecordsMap, List<AlgSchemeWindowPass> controlWindowPass) {
|
|
|
|
- List<StepWindowControlPassRelation> controlPassRelations = new ArrayList<>();
|
|
|
|
-
|
|
|
|
- //根据窗口id分组
|
|
|
|
- Map<String, List<AlgSchemeWindowPass>> controlWindowPassMap = controlWindowPass.stream()
|
|
|
|
- .collect(Collectors.groupingBy(AlgSchemeWindowPass::getSchemeStepWindowId));
|
|
|
|
-
|
|
|
|
- for(Map.Entry<String, AlgSchemeStepWindow> algSchemeStepWindowEntry : selectedRecordsMap.entrySet()){
|
|
|
|
-
|
|
|
|
- String algSchemeStepWindowId = algSchemeStepWindowEntry.getKey();
|
|
|
|
- AlgSchemeStepWindow algSchemeStepWindow = algSchemeStepWindowEntry.getValue();
|
|
|
|
-
|
|
|
|
- //获取条带窗口访问时间
|
|
|
|
- Date accessTime = algSchemeStepWindow.getAccessTime();
|
|
|
|
- // 查询距离条带访问最远的测控站弧度
|
|
|
|
- List<AlgSchemeWindowPass> algSchemeWindowPasses = controlWindowPassMap.get(algSchemeStepWindowId);
|
|
|
|
- Optional<AlgSchemeWindowPass> maxControlWindowPass = algSchemeWindowPasses.stream()
|
|
|
|
- .max(Comparator.comparing(obj -> Math.abs(accessTime.getTime() - obj.getEndTime().getTime())));
|
|
|
|
- if(maxControlWindowPass.isPresent()){
|
|
|
|
- AlgSchemeWindowPass algSchemeWindowPass = maxControlWindowPass.get();
|
|
|
|
- StepWindowControlPassRelation stepWindowDataPassRelation = new StepWindowControlPassRelation();
|
|
|
|
- stepWindowDataPassRelation.setWindowId(algSchemeWindowPass.getSchemeStepWindowId());
|
|
|
|
- stepWindowDataPassRelation.setStepId(algSchemeStepWindow.getSchemeStepId());
|
|
|
|
- stepWindowDataPassRelation.setControlStationWindowId(algSchemeWindowPass.getId());
|
|
|
|
- stepWindowDataPassRelation.setIsConfirm(IS_CONFIRMED);
|
|
|
|
- controlPassRelations.add(stepWindowDataPassRelation);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- return controlPassRelations;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* 处理algSchemeStepWindowList
|
|
* 处理algSchemeStepWindowList
|
|
* @param algSchemeStepWindowList:待处理的条带窗口数据
|
|
* @param algSchemeStepWindowList:待处理的条带窗口数据
|