|
@@ -782,35 +782,81 @@ public class HomePageServiceImpl extends ServiceImpl<WindTowerDataParentTableMap
|
|
|
|
|
|
|
|
|
/**
|
|
|
+ * 项目测风塔下拉框(mongo)
|
|
|
+ *
|
|
|
+ * @return List<SelectLabForVal>
|
|
|
+ */
|
|
|
+// public List<SelectLabForVal> projectSelect() {
|
|
|
+// List<ProjectInfo> projectInfoList = projectInfoService.getProjectInfoList();
|
|
|
+// ArrayList<SelectLabForVal> selectList = new ArrayList<>();
|
|
|
+// if (projectInfoList.size() > 0) {
|
|
|
+// //循环数据 放入项目id和项目名称
|
|
|
+// for (ProjectInfo projectInfo : projectInfoList) {
|
|
|
+// SelectLabForVal selectLabForVal = new SelectLabForVal();
|
|
|
+// selectLabForVal.setLabel(projectInfo.getProjectBasicInfo().getProjectNameEasy());
|
|
|
+// selectLabForVal.setValue(projectInfo.getId());
|
|
|
+// if (projectInfo.getEquipment().size() > 0) {
|
|
|
+// ArrayList<EquipmentDto> equipmentDtoList = new ArrayList<>();
|
|
|
+// //循环数据 放入测风塔id和测风塔名称
|
|
|
+// for (Equipment equipment : projectInfo.getEquipment()) {
|
|
|
+// EquipmentDto equipmentDto = new EquipmentDto();
|
|
|
+// equipmentDto.setLabel(equipment.getName());
|
|
|
+// equipmentDto.setValue(equipment.getEquipmentNo());
|
|
|
+// equipmentDto.setWdHeight(equipment.getWdHeights());
|
|
|
+// equipmentDto.setType(equipment.getType());
|
|
|
+// equipmentDtoList.add(equipmentDto);
|
|
|
+// }
|
|
|
+// selectLabForVal.setEquipmentDto(equipmentDtoList);
|
|
|
+// }
|
|
|
+// selectList.add(selectLabForVal);
|
|
|
+// }
|
|
|
+//
|
|
|
+// }
|
|
|
+//
|
|
|
+// return selectList;
|
|
|
+// }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
* 项目测风塔下拉框
|
|
|
*
|
|
|
* @return List<SelectLabForVal>
|
|
|
*/
|
|
|
public List<SelectLabForVal> projectSelect() {
|
|
|
- List<ProjectInfo> projectInfoList = projectInfoService.getProjectInfoList();
|
|
|
+
|
|
|
+ List<Project> projectList = projectService.list();
|
|
|
+ List<WindTowerInfo> windTowerInfoList = windTowerInfoService.list();
|
|
|
+
|
|
|
ArrayList<SelectLabForVal> selectList = new ArrayList<>();
|
|
|
- if (projectInfoList.size() > 0) {
|
|
|
- //循环数据 放入项目id和项目名称
|
|
|
- for (ProjectInfo projectInfo : projectInfoList) {
|
|
|
- SelectLabForVal selectLabForVal = new SelectLabForVal();
|
|
|
- selectLabForVal.setLabel(projectInfo.getProjectBasicInfo().getProjectNameEasy());
|
|
|
- selectLabForVal.setValue(projectInfo.getId());
|
|
|
- if (projectInfo.getEquipment().size() > 0) {
|
|
|
- ArrayList<EquipmentDto> equipmentDtoList = new ArrayList<>();
|
|
|
- //循环数据 放入测风塔id和测风塔名称
|
|
|
- for (Equipment equipment : projectInfo.getEquipment()) {
|
|
|
- EquipmentDto equipmentDto = new EquipmentDto();
|
|
|
- equipmentDto.setLabel(equipment.getName());
|
|
|
- equipmentDto.setValue(equipment.getEquipmentNo());
|
|
|
- equipmentDto.setWdHeight(equipment.getWdHeights());
|
|
|
- equipmentDto.setType(equipment.getType());
|
|
|
- equipmentDtoList.add(equipmentDto);
|
|
|
- }
|
|
|
- selectLabForVal.setEquipmentDto(equipmentDtoList);
|
|
|
+ for (Project project : projectList) {
|
|
|
+ SelectLabForVal selectLabForVal = new SelectLabForVal();
|
|
|
+ selectLabForVal.setLabel(project.getProjectNameEasy());
|
|
|
+ selectLabForVal.setValue(project.getId());
|
|
|
+ ArrayList<EquipmentDto> equipmentDtoList = new ArrayList<>();
|
|
|
+ EquipmentDto equipmentDto = new EquipmentDto();
|
|
|
+ if(project.getRelationEquipment().contains(",")){
|
|
|
+ String[] equipments = project.getRelationEquipment().split(",");
|
|
|
+ for (String equipment : equipments) {
|
|
|
+ equipmentDto = new EquipmentDto();
|
|
|
+ List<WindTowerInfo> windTowerInfos = windTowerInfoList.stream().filter(w -> w.getEquipmentNo().equals(equipment)).collect(Collectors.toList());
|
|
|
+ equipmentDto.setLabel(windTowerInfos.get(0).getName());
|
|
|
+ equipmentDto.setValue(equipment);
|
|
|
+ equipmentDto.setWdHeight(windTowerInfos.get(0).getWdHeights());
|
|
|
+ equipmentDto.setType(windTowerInfos.get(0).getType());
|
|
|
+ equipmentDtoList.add(equipmentDto);
|
|
|
}
|
|
|
- selectList.add(selectLabForVal);
|
|
|
+ }else{
|
|
|
+ List<WindTowerInfo> windTowerInfos = windTowerInfoList.stream().filter(w -> w.getEquipmentNo().equals(project.getRelationEquipment())).collect(Collectors.toList());
|
|
|
+ equipmentDto.setLabel(windTowerInfos.get(0).getName());
|
|
|
+ equipmentDto.setValue(project.getRelationEquipment());
|
|
|
+ equipmentDto.setWdHeight(windTowerInfos.get(0).getWdHeights());
|
|
|
+ equipmentDto.setType(windTowerInfos.get(0).getType());
|
|
|
+ equipmentDtoList.add(equipmentDto);
|
|
|
}
|
|
|
-
|
|
|
+ equipmentDtoList.add(equipmentDto);
|
|
|
+ selectLabForVal.setEquipmentDto(equipmentDtoList);
|
|
|
+ selectLabForVal.setWeatherStationInfo(new ArrayList<>());
|
|
|
+ selectList.add(selectLabForVal);
|
|
|
}
|
|
|
|
|
|
return selectList;
|