Forráskód Böngészése

整合 mongodb 项目进展

hxf 2 éve
szülő
commit
2a9383d2c1

+ 4 - 50
neim-biz/src/main/java/com/jiayue/biz/controller/HomePageController.java

@@ -157,47 +157,16 @@ public class HomePageController extends BaseController {
     @GetMapping("/projectSelect")
     public AjaxResult projectSelect() {
 
-//        label: 依兰四期
-//        value : 项目id
-//        towerInfo:[{label:‘依兰四起06171’value:‘006171’},{label:value}]
         return AjaxResult.success(homePageService.projectSelect());
     }
 
     @ApiOperation(value = "项目进展情况", notes = "查询项目进展情况")
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "项目编号", value = "eqId", paramType = "query", dataType = "String"),
+            @ApiImplicitParam(name = "项目编号", value = "projectId", paramType = "query", dataType = "String"),
     })
     @GetMapping("/projectEvolve")
-    public AjaxResult projectEvolve(String eqId) {
-        //表格
-//        {
-//            index: '一',
-//                    taskContent: '成立项目公司',
-//                planTime: '2023/2/15',
-//                detailedTaskContent: '',
-//                realTime: '',
-//                status: '已完成',
-//        },
-//        {index: '二', taskContent: '项目核准', planTime: '3月5日前必须完成', detailedTaskContent: '', realTime: '', status: '',},
-//        {
-//            index: '1',
-//                    taskContent: '项目土地预审批复',
-//                planTime: '2023/2/20',
-//                detailedTaskContent: '1.修编可研,将15万千瓦改成20万千瓦',
-//                realTime: '2023/2/5',
-//                status: '已完成',
-//        },
-//        {
-//            index: '1',
-//                    taskContent: '项目土地预审批复',
-//                planTime: '2023/2/20',
-//                detailedTaskContent: '2.完成场址区1:2000和升压站1:500地形图测绘',
-//                realTime: '2023/2/28',
-//                status: '正在开展',
-//        },
-
-
-        return null;
+    public AjaxResult projectEvolve(String projectId) {
+        return AjaxResult.success(homePageService.getProjectEvolve(projectId));
     }
 
     @ApiOperation(value = "场站总体信息", notes = "查询场站总体信息")
@@ -229,25 +198,10 @@ public class HomePageController extends BaseController {
     @GetMapping("/api/stationSelect")
     public AjaxResult stationSelect() {
 
-        HashMap<String, Object> hashMap = new HashMap<>();
-        HashMap<String, Object> towerInfo = new HashMap<>();
-        HashMap<String, Object> towerInfo2 = new HashMap<>();
-
-        ArrayList<Object> arrayList = new ArrayList<>();
-
-        towerInfo.put("label", "依兰四起06171");
-        towerInfo.put("value", "006171");
-        towerInfo2.put("label", "依兰四起06171");
-        towerInfo2.put("value", "006171");
-        arrayList.add(towerInfo);
-        arrayList.add(towerInfo2);
-
-        hashMap.put("towerInfo", arrayList);
-
 //        label: 依兰四期
 //        value : 项目id
 //        towerInfo:[{label:‘依兰四起06171’value:‘006171’},{label:value}]
-        return AjaxResult.success(hashMap);
+        return AjaxResult.success();
     }
 
 

+ 2 - 1
neim-biz/src/main/java/com/jiayue/biz/domain/ProjectMenusOne.java

@@ -19,6 +19,7 @@ public class ProjectMenusOne {
     private String workContent;
     //计划完成时间
     private String planTime;
-
+    //一级菜单状态
+    private String status;
     private List<ProjectMenusTow> projectMenusTows;
 }

+ 8 - 1
neim-biz/src/main/java/com/jiayue/biz/dto/projectEvolve.java → neim-biz/src/main/java/com/jiayue/biz/dto/ProjectEvolveDto.java

@@ -1,9 +1,16 @@
 package com.jiayue.biz.dto;
 
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
 /**
  * 项目进展表格Dto
  */
-public class projectEvolve {
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class ProjectEvolveDto {
     // 序号
     private String index;
     // 工作内容

+ 11 - 0
neim-biz/src/main/java/com/jiayue/biz/service/HomePageService.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
 import com.jiayue.biz.domain.ProvincialEnergyStations;
 import com.jiayue.biz.domain.WindTowerDataChildTable;
 import com.jiayue.biz.domain.WindTowerDataParentTable;
+import com.jiayue.biz.dto.ProjectEvolveDto;
 import com.jiayue.biz.dto.SelectLabForVal;
 
 import java.math.BigDecimal;
@@ -85,4 +86,14 @@ public interface HomePageService extends IService<WindTowerDataParentTable> {
      * 查询场站详细信息(风机、机型等)
      */
     HashMap<String, Object> getStationInfo(String stationId);
+
+    /**
+     * 场站测风塔下拉框
+     *
+     * @return List<SelectLabForVal>
+     */
+    List<SelectLabForVal> stationSelect();
+
+    //项目进展
+    List<ProjectEvolveDto> getProjectEvolve(String projectId);
 }

+ 96 - 8
neim-biz/src/main/java/com/jiayue/biz/service/impl/HomePageServiceImpl.java

@@ -4,6 +4,7 @@ import cn.hutool.core.util.ObjectUtil;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.jiayue.biz.domain.*;
 import com.jiayue.biz.dto.EquipmentDto;
+import com.jiayue.biz.dto.ProjectEvolveDto;
 import com.jiayue.biz.dto.ProjectInfoDto;
 import com.jiayue.biz.dto.SelectLabForVal;
 import com.jiayue.biz.eunms.WindDirectionEnum;
@@ -763,7 +764,6 @@ public class HomePageServiceImpl extends ServiceImpl<WindTowerDataParentTableMap
             //测风塔坐标
             dataMap.put("towerInfo", arrayList);
         }
-        //项目中所有的塔、拐点坐标、 TODO 地图四个角信息
         return dataMap;
     }
 
@@ -870,15 +870,15 @@ public class HomePageServiceImpl extends ServiceImpl<WindTowerDataParentTableMap
             }
             //过滤塔信息
             List<Equipment> equipmentList = stationInfoList.get(0).getEquipment();
-            ArrayList<HashMap<String,String>> towerList = new ArrayList<>();
-            if(equipmentList.size() > 0 ){
+            ArrayList<HashMap<String, String>> towerList = new ArrayList<>();
+            if (equipmentList.size() > 0) {
                 for (Equipment equipment : equipmentList) {
                     HashMap<String, String> towerMap = new HashMap<>();
-                    towerMap.put("name",equipment.getName());
-                    towerMap.put("towerId",equipment.getId());
-                    towerMap.put("equipmentNo",equipment.getEquipmentNo());
-                    towerMap.put("longitude",equipment.getLongitude());
-                    towerMap.put("latitude",equipment.getLatitude());
+                    towerMap.put("name", equipment.getName());
+                    towerMap.put("towerId", equipment.getId());
+                    towerMap.put("equipmentNo", equipment.getEquipmentNo());
+                    towerMap.put("longitude", equipment.getLongitude());
+                    towerMap.put("latitude", equipment.getLatitude());
                     towerList.add(towerMap);
                 }
 
@@ -891,4 +891,92 @@ public class HomePageServiceImpl extends ServiceImpl<WindTowerDataParentTableMap
         return dataMap;
     }
 
+    /**
+     * 场站测风塔下拉框
+     *
+     * @return List<SelectLabForVal>
+     */
+    public List<SelectLabForVal> stationSelect() {
+        List<StationInfo> stationInfoList = stationInfoService.selectStationInfo();
+        ArrayList<SelectLabForVal> selectList = new ArrayList<>();
+        if (stationInfoList.size() > 0) {
+            //循环数据 放入项目id和项目名称
+            for (StationInfo stationInfo : stationInfoList) {
+                SelectLabForVal selectLabForVal = new SelectLabForVal();
+                selectLabForVal.setLabel(stationInfo.getStationBasicInfo().getStationName());
+                selectLabForVal.setValue(stationInfo.getId());
+                if (stationInfo.getEquipment().size() > 0) {
+                    ArrayList<EquipmentDto> equipmentDtoList = new ArrayList<>();
+                    //循环数据 放入测风塔id和测风塔名称
+                    for (Equipment equipment : stationInfo.getEquipment()) {
+                        EquipmentDto equipmentDto = new EquipmentDto();
+                        equipmentDto.setLabel(equipment.getName());
+                        equipmentDto.setValue(equipment.getId());
+                        equipmentDtoList.add(equipmentDto);
+                    }
+                    selectLabForVal.setEquipmentDto(equipmentDtoList);
+                }
+                selectList.add(selectLabForVal);
+            }
+
+        }
+
+        return selectList;
+    }
+
+    //项目进展
+    public List<ProjectEvolveDto> getProjectEvolve(String projectId) {
+        //查询项目进展信息
+        List<ProjectProgress> projectProgresses = proProjectInfoService.selectProProjectInfo();
+        //根据项目id筛选数据
+        List<ProjectProgress> progressList = projectProgresses.stream().filter(p -> p.getProjectId().equals(projectId)).collect(Collectors.toList());
+        ArrayList<ProjectEvolveDto> projectEvolveList = new ArrayList<>();
+        if (progressList.size() > 0) {
+            //循环项目进展信息 一般只有一条
+            for (ProjectProgress progress : progressList) {
+                if (progress.getProjectMenusOneList().size() > 0) {
+                    //循环一级菜单
+                    for (ProjectMenusOne menusOne : progress.getProjectMenusOneList()) {
+                        ProjectEvolveDto projectEvolveDtoOne = new ProjectEvolveDto();
+                        //一级菜单
+                        projectEvolveDtoOne.setIndex(menusOne.getIndex());
+                        projectEvolveDtoOne.setTaskContent(menusOne.getWorkContent());
+                        projectEvolveDtoOne.setPlanTime(menusOne.getPlanTime());
+                        projectEvolveDtoOne.setStatus(menusOne.getStatus());
+                        projectEvolveList.add(projectEvolveDtoOne);
+
+                        if (menusOne.getProjectMenusTows() != null && menusOne.getProjectMenusTows().size() > 0) {
+                            //循环二级菜单
+                            for (ProjectMenusTow menusTow : menusOne.getProjectMenusTows()) {
+                                if (menusTow.getProjectMenusThreeList() != null && menusTow.getProjectMenusThreeList().size() > 0) {
+                                    //循环三级菜单
+                                    for (ProjectMenusThree menusThree : menusTow.getProjectMenusThreeList()) {
+                                        ProjectEvolveDto projectEvolveDto = new ProjectEvolveDto();
+                                        //放入二级序号
+                                        projectEvolveDto.setIndex(menusTow.getIndex());
+                                        //放入二级计划时间
+                                        projectEvolveDto.setPlanTime(menusOne.getPlanTime());
+                                        //放入二级工作内容
+                                        projectEvolveDto.setTaskContent(menusTow.getWorkContent());
+                                        //详细工作信息 三级工作内容
+                                        projectEvolveDto.setDetailedTaskContent(menusThree.getWorkContent());
+                                        //实际完成时间 三级时间
+                                        projectEvolveDto.setRealTime(menusThree.getRealTime());
+                                        //放入状态 三级备注
+                                        projectEvolveDto.setStatus(menusThree.getRemark());
+                                        projectEvolveList.add(projectEvolveDto);
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+
+            }
+        }
+        return projectEvolveList;
+
+    }
+
+
 }