package com.jiayue.biz.service.impl; import cn.hutool.core.date.DateTime; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import cn.hutool.db.Entity; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.jiayue.biz.conf.RequestDataHelper; 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; import com.jiayue.biz.mapper.ProphaseAnemometryDataMapper; import com.jiayue.biz.mapper.ProphaseWeatherDataMapper; import com.jiayue.biz.mapper.WindTowerDataParentTableMapper; import com.jiayue.biz.service.*; import com.jiayue.biz.util.CalculationUtil; import com.jiayue.biz.util.DateTimeUtil; import com.jiayue.common.core.redis.RedisCache; import com.jiayue.common.utils.DateUtil; import com.jiayue.common.utils.spring.SpringUtils; import com.sun.corba.se.spi.ior.ObjectKey; import lombok.AllArgsConstructor; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.math.BigDecimal; import java.math.RoundingMode; import java.sql.Timestamp; import java.sql.Wrapper; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.*; import java.util.stream.Collectors; import java.util.stream.Stream; /** * 首页Service业务层处理 * * @author L.ym * @date 2022-05-11 */ @Service @AllArgsConstructor public class HomePageServiceImpl extends ServiceImpl implements HomePageService { private final WindTowerInfoService windTowerInfoService; private final EquipmentAttributeService equipmentAttributeService; private final WindTowerCalculationDataServiceImpl windTowerCalculationDataService; private final WindTowerDataParentTableService windTowerDataParentTableService; private final StatisticsSituationService iStatisticsSituationService; private final ProjectService projectService; private final ElectricStationService electricStationService; private final ProvincialEnergyStationsService provincialEnergyStationsService; private final ProjectInfoService projectInfoService; private final StationInfoService stationInfoService; private final ProjectProgressService proProjectInfoService; private final TotalityInfoService totalityInfoService; private final FanModelDataService fanModelDataService; private final ProphaseAnemometryDataService prophaseAnemometryDataService; private final ProphaseWeatherDataService prophaseWeatherDataService; private final OtherStationInfoService otherStationInfoService; private final WindDirectionStatisticsDataService windDirectionStatisticsDataService; private final BigDecimal threeParameterOne = new BigDecimal("1.146"); private final BigDecimal threeParameterTow = new BigDecimal("77.42"); private final BigDecimal threeParameterThree = new BigDecimal("1672"); private final BigDecimal threeParameterFour = new BigDecimal("5251"); private final Double e = 10.0; /** * 风速 风功率 柱状图 * * @param equipmentId 设备编号 * @return Map */ public Map getWsAndWpdForHeight(String equipmentId, String month) { List windTowerInfoList = windTowerInfoService.getByEquipmentNo(equipmentId); String[] heights = windTowerInfoList.get(0).getHeights().split(","); //获取最后一条记录 WindTowerCalculationData lastDataCalculation = windTowerCalculationDataService.getLastDataCalculation(equipmentId); Date yearDay = DateTimeUtil.getYearDay(lastDataCalculation.getTime().getTime()); //获取去年月份开始时间 Date beginTime = DateUtil.offsetMonth(DateUtil.beginOfMonth(yearDay), 1); Date endTime = lastDataCalculation.getTime(); List equipmentAttributeList = equipmentAttributeService.lambdaQuery().likeLeft(EquipmentAttribute::getFieldName, "wpdMonth").or().likeLeft(EquipmentAttribute::getFieldName, "awsMonth").list(); List windTowerCalculationData = windTowerCalculationDataService.getByBetweenTimeAndEquipmentIdAndEbId(beginTime, endTime, equipmentId, equipmentAttributeList); HashMap dataMap = new HashMap<>(); ArrayList wpdList = new ArrayList<>(); ArrayList wsList = new ArrayList<>(); ArrayList heightList = new ArrayList<>(); //循环层高 for (String height : heights) { //获取风速风功率的统计id List equipmentAttributeWpd = equipmentAttributeList.stream().filter(e -> e.getFieldName().equals(height + "wpdMonth")).collect(Collectors.toList()); List equipmentAttributeWs = equipmentAttributeList.stream().filter(e -> e.getFieldName().equals(height + "awsMonth")).collect(Collectors.toList()); heightList.add(height + "m"); //根据id和时间过滤 BigDecimal wpd = this.getDataForTimeAndId(windTowerCalculationData, equipmentAttributeWpd.get(0).getId(), beginTime.getTime(), endTime.getTime()); wpdList.add(wpd); //根据id和时间过滤 BigDecimal ws = this.getDataForTimeAndId(windTowerCalculationData, equipmentAttributeWs.get(0).getId(), beginTime.getTime(), endTime.getTime()); wsList.add(ws); } dataMap.put("ws", wsList); dataMap.put("wpd", wpdList); dataMap.put("height", heightList); return dataMap; } //计算统计数据时间段内平均值 public BigDecimal getDataForTimeAndId(List windTowerCalculationData, String ebId, Long startTime, Long endTime) { List calculationData = windTowerCalculationData.stream().filter(w -> w.getEbId().equals(ebId) && w.getTime().getTime() >= startTime && w.getTime().getTime() <= endTime).map(WindTowerCalculationData::getValue).collect(Collectors.toList()); return calculationData.size() > 0 ? CalculationUtil.getAvgWind(calculationData) : BigDecimal.ZERO; } /** * 首页查询风速对比 * * @param equipmentId 设备编号 * @return */ public Map homePageCharts(String equipmentId, String month) { HashMap everyMap = new HashMap(); List windTowerInfoList = windTowerInfoService.getByEquipmentNo(equipmentId); String[] heights = windTowerInfoList.get(0).getHeights().split(","); //获取最后一条记录 WindTowerCalculationData lastDataCalculation = windTowerCalculationDataService.getLastDataCalculation(equipmentId); Date yearDay = DateTimeUtil.getYearDay(lastDataCalculation.getTime().getTime()); //获取去年月份开始时间 Date beginTime = DateUtil.offsetMonth(DateUtil.beginOfMonth(yearDay), 1); Map startAndEnd = prophaseWeatherDataService.getDataTimeStartAndEnd(equipmentId); if(beginTime.getTime() < startAndEnd.get("startTime")){ beginTime = new Date(startAndEnd.get("startTime")); } Date endTime = lastDataCalculation.getTime(); List equipmentAttributeList = equipmentAttributeService.lambdaQuery().likeLeft(EquipmentAttribute::getFieldName, "awsDay").list(); List windTowerCalculationData = windTowerCalculationDataService.getByBetweenTimeAndEquipmentIdAndEbId(beginTime, endTime, equipmentId, equipmentAttributeList); //数据list 风速 层高 ArrayList everyData = new ArrayList<>(); //时间list ArrayList timeList = new ArrayList(); boolean type = true; for (String height : heights) { List equipmentAttributes = equipmentAttributeList.stream().filter(e -> e.getFieldName().equals(height + "awsDay")).collect(Collectors.toList()); ArrayList hList = new ArrayList(); HashMap hMap = new HashMap(); for (long i = beginTime.getTime(); i <= endTime.getTime(); i = i + 86400000) { long finalI = i; List calculationData = windTowerCalculationData.stream().filter(w -> w.getEbId().equals(equipmentAttributes.get(0).getId()) && w.getTime().getTime() == finalI).collect(Collectors.toList()); if (type) { timeList.add(DateUtil.format(new Date(i), "yyyy-MM-dd")); } hList.add(calculationData.size() > 0 ? calculationData.get(0).getValue() : BigDecimal.ZERO); } hMap.put("height", height); hMap.put("value", hList); everyData.add(hMap); type = false; } everyMap.put("chart", everyData); everyMap.put("time", timeList); // List mapList = new ArrayList<>(); // if (!month.equals("")) { // SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM"); // try { // Date startDate = sdf.parse(month); // Date endDate = DateTimeUtil.endOfMonth(startDate); // mapList = prophaseAnemometryDataService.selectWsAve(equipmentId, new Timestamp(startDate.getTime()), new Timestamp(endDate.getTime())); // } catch (ParseException e) { // e.printStackTrace(); // } // } else { // // 最新一天数据 // List lastData = prophaseWeatherDataService.getLastData(equipmentId); // Timestamp timeEnd = (Timestamp) lastData.get(0).get("last (ts)"); // DateTime startTime = DateUtil.beginOfDay(new Date(timeEnd.getTime())); // mapList = prophaseAnemometryDataService.selectWsAve(equipmentId, new Timestamp(startTime.getTime()), timeEnd); // // } //// HashMap everyMap = new HashMap(); // //获取风速层高 // List windTowerInfos = windTowerInfoService.getByEquipmentNo(equipmentId); // String height = windTowerInfos.get(0).getHeights(); // String[] heightAll = height.split(","); // // // 时间list //// ArrayList timeList = new ArrayList(); //// ArrayList everyData = new ArrayList<>(); // // for (String h : heightAll) { // timeList = new ArrayList(); // ArrayList hList = new ArrayList(); // HashMap hMap = new HashMap(); // //根据层高过滤时间和风速 // TreeMap heightForTimeAndWs = new TreeMap<>(mapList.stream().filter(p -> p.getLayerHeight().equals(h)) // .collect(Collectors.toMap(prophaseAnemometryData -> prophaseAnemometryData != null ? prophaseAnemometryData.getTs().getTime() : null, prophaseAnemometryData1 -> prophaseAnemometryData1 != null ? prophaseAnemometryData1.getWsAve() : null))); // for (Map.Entry entry : heightForTimeAndWs.entrySet()) { // String time = DateUtil.format(new Date(entry.getKey()), "yyyy-MM-dd HH:mm:ss"); // timeList.add(time); // hList.add(entry.getValue()); // } // hMap.put("height", h); // hMap.put("value", hList); // everyData.add(hMap); // } return everyMap; } /*首页地图 测风塔信息*/ public List> homePageMap() { List> list = new ArrayList<>(); try { SimpleDateFormat sdfTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); Date startDay = DateTimeUtil.getDayStartTime(new Date().getTime() - 1000 * 60 * 60 * 24); Date endDay = DateTimeUtil.getDayLastTime(new Date().getTime() - 1000 * 60 * 60 * 24); /*测风塔设备*/ List windTowerInfoList = windTowerInfoService.getAllWindTower(); List statisticsSituationList = iStatisticsSituationService.list(); /*系统昨日的时间戳*/ long date = DateTimeUtil.getDayStartTime(new Date().getTime()).getTime() - 86400000; for (WindTowerInfo windTowerInfo : windTowerInfoList) { Map map = new HashMap(); // 状态 Boolean status = true; /*判断此塔是否停机状态 若运行状态 计算是否10天内没接入数据*/ if (windTowerInfo.getStatus() == null || windTowerInfo.getStatus().equals("1")) { /*根据设备编号获取该塔的最后一条数据*/ WindTowerDataParentTable lastData = windTowerDataParentTableService.getLastData(windTowerInfo.getEquipmentNo()); /*获取该塔接入的时间*/ long startTime = DateTimeUtil.getDayStartTime(lastData.getTime().getTime()).getTime(); /*测风塔最新接入时间 - 今日系统时间 = 差值 差值代表此塔几天没有接入数据,若差值>=10 将此塔状态设置为异常*/ long differenceDays = date - startTime; if ((differenceDays / 86400000) >= 10) { status = false; } else { status = true; } } // 缺失的数据条数 BigDecimal defectCount = new BigDecimal(144); /*昨日数据条数*/ List> maps = windTowerDataParentTableService.countDataIntegrity(windTowerInfo.getEquipmentNo(), sdfTime.format(startDay), sdfTime.format(endDay)); List statisticsSituations = statisticsSituationList.stream().filter(w -> w.getEquipmentId().equals(windTowerInfo.getEquipmentNo())).collect(Collectors.toList()); String info = ""; if (!statisticsSituations.isEmpty()) { StatisticsSituation statisticsSituation = statisticsSituations.get(0); String[] split = statisticsSituation.getStartTimeAndEndTime().split(","); info = info + "数据起止时间:" + sdf.format(new Date(Long.parseLong(split[0]))) + " - " + sdf.format(new Date(Long.parseLong(split[1]))); // if (statisticsSituation.getWsAve140() != null) // info = info + ";140米风速:" + statisticsSituation.getWsAve140().setScale(2, RoundingMode.HALF_UP); // if (statisticsSituation.getWsAve120() != null) // info = info + ";120米风速:" + statisticsSituation.getWsAve120().setScale(2, RoundingMode.HALF_UP); // if (statisticsSituation.getWsAve100() != null) // info = info + ";100米风速:" + statisticsSituation.getWsAve100().setScale(2, RoundingMode.HALF_UP); // if (statisticsSituation.getWsAve80() != null) // info = info + ";80米风速:" + statisticsSituation.getWsAve80().setScale(2, RoundingMode.HALF_UP); // if (statisticsSituation.getWsAve70() != null) // info = info + ";70米风速:" + statisticsSituation.getWsAve70().setScale(2, RoundingMode.HALF_UP); // if (statisticsSituation.getWsAve50() != null) // info = info + ";50米风速:" + statisticsSituation.getWsAve50().setScale(2, RoundingMode.HALF_UP); // if (statisticsSituation.getWsAve30() != null) // info = info + ";30米风速:" + statisticsSituation.getWsAve30().setScale(2, RoundingMode.HALF_UP); // if (statisticsSituation.getWsAve10() != null) // info = info + ";10米风速:" + statisticsSituation.getWsAve10().setScale(2, RoundingMode.HALF_UP); } if (!maps.isEmpty()) { defectCount = new BigDecimal(maps.get(0).get("num").toString()).subtract(new BigDecimal(144)); } map.put("name", windTowerInfo.getName()); map.put("equipmentNo", windTowerInfo.getEquipmentNo()); map.put("lon", windTowerInfo.getLongitude()); map.put("lat", windTowerInfo.getLatitude()); map.put("defectCount", defectCount); map.put("status", status); map.put("info", info); list.add(map); } } catch (Exception e) { e.printStackTrace(); } return list; }/*首页地图 测风塔信息*/ public List> homePageAllWindMap() { List> list = new ArrayList<>(); try { /*项目信息*/ List projectList = projectService.list(); /*场站信息*/ List electricStationList = electricStationService.list(); /*测风塔设备*/ // List windTowerInfoList = windTowerInfoService.list(); List windTowerInfoList = windTowerInfoService.getAllWindTower(); /*项目塔信息*/ List> projectTowerList = projectTowerMap(projectList, windTowerInfoList); list.addAll(projectTowerList); /*场站塔信息*/ List> electricStationTowerList = electricStationTowerMap(electricStationList, windTowerInfoList); list.addAll(electricStationTowerList); } catch (Exception e) { e.printStackTrace(); } return list; } /*首页地图项目塔*/ public List> projectTowerMap(List projectList, List windTowerInfoList) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); List> list = new ArrayList<>(); /*统计概述*/ List statisticsSituationList = iStatisticsSituationService.list(); /*系统昨日的时间戳*/ long date = DateTimeUtil.getDayStartTime(new Date().getTime()).getTime() - 86400000; /*项目塔*/ for (Project project : projectList) { /*项目关联的塔*/ String[] strings = project.getRelationEquipment().split(","); if (strings.length > 0) { for (String equipmentNo : strings) { Map map = new HashMap(); map.put("type", "emailWind"); map.put("projectId", project.getId()); List windTowerInfos = windTowerInfoList.stream().filter(w -> w.getEquipmentNo().equals(equipmentNo)).collect(Collectors.toList()); WindTowerInfo windTowerInfo = windTowerInfos.get(0); // 状态 Boolean status = true; /*判断此塔是否停机状态 若运行状态 计算是否10天内没接入数据*/ if (windTowerInfo.getStatus() == null || windTowerInfo.getStatus().equals("1")) { /*根据设备编号获取该塔的最后一条数据*/ WindTowerDataParentTable lastData = windTowerDataParentTableService.getLastData(windTowerInfo.getEquipmentNo()); /*获取该塔接入的时间*/ long startTime = DateTimeUtil.getDayStartTime(lastData.getTime().getTime()).getTime(); /*测风塔最新接入时间 - 今日系统时间 = 差值 差值代表此塔几天没有接入数据,若差值>=10 将此塔状态设置为异常*/ long differenceDays = date - startTime; if ((differenceDays / 86400000) >= 10) { status = false; } else { status = true; } } /*获取数据的起止时间*/ List statisticsSituations = statisticsSituationList.stream().filter(w -> w.getEquipmentId().equals(windTowerInfo.getEquipmentNo())).collect(Collectors.toList()); String info = ""; if (!statisticsSituations.isEmpty()) { StatisticsSituation statisticsSituation = statisticsSituations.get(0); String[] split = statisticsSituation.getStartTimeAndEndTime().split(","); info = info + "数据起止时间:" + sdf.format(new Date(Long.parseLong(split[0]))) + " - " + sdf.format(new Date(Long.parseLong(split[1]))); } map.put("name", windTowerInfo.getName()); map.put("equipmentNo", windTowerInfo.getEquipmentNo()); map.put("lon", windTowerInfo.getLongitude()); map.put("lat", windTowerInfo.getLatitude()); map.put("status", status); map.put("info", info); list.add(map); } } } return list; } /*首页地图实时塔*/ public List> electricStationTowerMap(List electricStationList, List windTowerInfoList) { List> list = new ArrayList<>(); /*实时塔*/ for (ElectricStation electricStation : electricStationList) { /*风场站关联的塔*/ String[] strings = electricStation.getRelationEquipment().split(","); if (strings.length > 0) { for (String equipmentNo : strings) { Map map = new HashMap(); map.put("type", "realWind"); map.put("electricStationId", electricStation.getId()); List windTowerInfos = windTowerInfoList.stream().filter(w -> w.getEquipmentNo().equals(equipmentNo)).collect(Collectors.toList()); if (!windTowerInfos.isEmpty()) { WindTowerInfo windTowerInfo = windTowerInfos.get(0); // 状态 Boolean status = windTowerInfo.getStatus() == null || windTowerInfo.getStatus().equals("1") ? true : false; map.put("name", windTowerInfo.getName()); map.put("equipmentNo", windTowerInfo.getEquipmentNo()); map.put("lon", windTowerInfo.getLongitude()); map.put("lat", windTowerInfo.getLatitude()); map.put("status", status); list.add(map); } } } } return list; } /** * 首页查询最新一天的风向玫瑰图 * * @param equipmentId 设备编号 * @param height 层高 * @return List> */ @Override public HashMap homePageRose(String equipmentId, String height, String month) { List anemometryData = new ArrayList<>(); if (!month.equals("")) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM"); try { Date startDate = sdf.parse(month); Date endDate = DateTimeUtil.endOfMonth(startDate); anemometryData = prophaseAnemometryDataService.selectWdAveAndWdAveAndWsStaForHeight(equipmentId, new Timestamp(startDate.getTime()), new Timestamp(endDate.getTime()), height); } catch (ParseException e) { e.printStackTrace(); } } else { // 最新一天数据 List lastData = prophaseWeatherDataService.getLastData(equipmentId); Timestamp timeEnd = (Timestamp) lastData.get(0).get("last (ts)"); DateTime startTime = DateUtil.beginOfDay(DateTimeUtil.getYearDay(timeEnd.getTime())); anemometryData = prophaseAnemometryDataService.selectWdAveAndWdAveAndWsStaForHeight(equipmentId, new Timestamp(startTime.getTime()), timeEnd, height); } HashMap hashMap = new HashMap<>(); Map map = new HashMap<>(); Map windPowerMap = new HashMap<>(); for (WindDirectionEnum value : WindDirectionEnum.values()) { //根据设备属性风向获取数据 List heightAndWindDirectionEnum = CalculationUtil.getForHeightAndWindDirectionEnum(anemometryData, value); BigDecimal wsAve = BigDecimal.ZERO; if (heightAndWindDirectionEnum.size() > 0) { wsAve = BigDecimal.valueOf(heightAndWindDirectionEnum.stream().map(h -> { return BigDecimal.valueOf(h.getWsAve()); }).collect(Collectors.averagingDouble(BigDecimal::doubleValue))); } hashMap.put(value.name(), heightAndWindDirectionEnum.size()); if (anemometryData.size() > 0) { //风向频率 BigDecimal wdF = BigDecimal.valueOf(heightAndWindDirectionEnum.size()).divide(BigDecimal.valueOf(anemometryData.size()), 2, RoundingMode.HALF_UP); map.put(value.name(), BigDecimal.valueOf(100).multiply(wdF)); // 风能:风向频率 * 平均风速的立方 windPowerMap.put(value.name(), wsAve.multiply(wsAve).multiply(wsAve).multiply(wdF).setScale(2, RoundingMode.HALF_UP)); } else { map.put(value.name(), BigDecimal.ZERO); windPowerMap.put(value.name(), BigDecimal.ZERO); } } ArrayList> entries = new ArrayList<>(map.entrySet()); entries.sort((o1, o2) -> { return o2.getValue().compareTo(o1.getValue()); }); List> entries1 = entries.subList(0, 3); HashMap everyMap = new HashMap<>(); everyMap.put("echars", map); everyMap.put("windPowerEchars", windPowerMap); everyMap.put("proportion", entries1); return everyMap; } /** * 首页空气密度、温度、压强平均值 湍流 风切变 满发小时数 日发电量 经纬度 数据起止时间 * * @param equipmentId 场站编号 * @return Map */ public Map getAirAndPaAndT(String equipmentId, String month) { List windTowerInfoList = windTowerInfoService.getByEquipmentNo(equipmentId); String[] wdHeight = windTowerInfoList.get(0).getWdHeights().split(","); ArrayList arrayList = new ArrayList(Arrays.asList(windTowerInfoList.get(0).getHeights().split(","))); //层高排序 List heightList = arrayList.stream().map(s -> Integer.parseInt(CalculationUtil.getNumberFromString(s))).sorted().collect(Collectors.toList()); Integer maxHeight = heightList.get(heightList.size() - 1); //获取最后一条记录 WindTowerCalculationData lastDataCalculation = windTowerCalculationDataService.getLastDataCalculation(equipmentId); Date yearDay = DateTimeUtil.getYearDay(lastDataCalculation.getTime().getTime()); //获取去年月份开始时间 Date beginTime = DateUtil.offsetMonth(DateUtil.beginOfMonth(yearDay), 1); Date endTime = lastDataCalculation.getTime(); List equipmentAttributeList = equipmentAttributeService.lambdaQuery().eq(EquipmentAttribute::getFieldName, "airDensityMonth").or().eq(EquipmentAttribute::getFieldName, "tAVE").or(). eq(EquipmentAttribute::getFieldName, "paAVE").or().eq(EquipmentAttribute::getFieldName, maxHeight + "turbulenceMonth").or(). eq(EquipmentAttribute::getFieldName, "windShearMonth").or().eq(EquipmentAttribute::getFieldName, "batteryDay") .or().eq(EquipmentAttribute::getFieldName, wdHeight[0] + "monthWdRose").list(); List windTowerCalculationDataList = windTowerCalculationDataService.getByBetweenTimeAndEquipmentIdAndEbId(beginTime, endTime, equipmentId, equipmentAttributeList); HashMap dataMap = new HashMap<>(); //温度 dataMap.put("t", this.getDataForCalculationByEb(equipmentAttributeList, windTowerCalculationDataList, "tAVE")); //空气密度 dataMap.put("air", this.getDataForCalculationByEb(equipmentAttributeList, windTowerCalculationDataList, "airDensityMonth")); //压强 dataMap.put("pa", this.getDataForCalculationByEb(equipmentAttributeList, windTowerCalculationDataList, "paAVE")); //湍流 dataMap.put("turbulence", this.getDataForCalculationByEb(equipmentAttributeList, windTowerCalculationDataList, maxHeight + "turbulenceMonth")); //风切变 dataMap.put("windShear", this.getDataForCalculationByEb(equipmentAttributeList, windTowerCalculationDataList, "windShearMonth")); //层高 dataMap.put("height", maxHeight); List batteryDay1 = equipmentAttributeList.stream().filter(e -> e.getFieldName().equals("batteryDay")).collect(Collectors.toList()); List calculationDataList = windTowerCalculationDataList.stream().filter(w -> w.getEbId().equals(batteryDay1.get(0).getId())).collect(Collectors.toList()); BigDecimal batteryDay = calculationDataList.stream().map(WindTowerCalculationData::getValue).reduce(BigDecimal.ZERO, BigDecimal::add); BigDecimal hourMax = batteryDay.divide(BigDecimal.valueOf(6.25), 2, RoundingMode.HALF_UP); //发电量 dataMap.put("battery", batteryDay); //满发小时数 dataMap.put("hour", hourMax); List equipmentAttributes = equipmentAttributeList.stream().filter(e -> e.getFieldName().equals(wdHeight[0] + "monthWdRose")).collect(Collectors.toList()); List windDirectionStatisticsDataList = windDirectionStatisticsDataService.lambdaQuery().eq(WindDirectionStatisticsData::getEbId, equipmentAttributes.get(0).getId()).between(WindDirectionStatisticsData::getTime, beginTime, endTime) .eq(WindDirectionStatisticsData::getEquipmentId, equipmentId).list(); Map> collect = windDirectionStatisticsDataList.stream().collect(Collectors.groupingBy(w -> w.getDirection())); HashMap hashMap = new HashMap<>(); for (Map.Entry> k : collect.entrySet()) { BigDecimal reduce = k.getValue().stream().map(WindDirectionStatisticsData::getValue).reduce(BigDecimal.ZERO, BigDecimal::add); hashMap.put(k.getKey(), reduce); } Map.Entry stringBigDecimalEntry = hashMap.entrySet().stream().max(Comparator.comparing(Map.Entry::getValue)).get(); //主风向 dataMap.put("wdSum", stringBigDecimalEntry.getKey()); //起止时间 Map dataTimeStartAndEnd = prophaseWeatherDataService.getDataTimeStartAndEnd(equipmentId); String startTime = DateUtil.format(new Date(dataTimeStartAndEnd.get("startTime")), "yyyy-MM-dd"); String endTimeStr = DateUtil.format(endTime, "yyyy-MM-dd"); dataMap.put("dataTime", startTime + "-" + endTimeStr); dataMap.put("longitude", windTowerInfoList.get(0).getLongitude()); dataMap.put("latitude", windTowerInfoList.get(0).getLatitude()); return dataMap; } public BigDecimal getDataForCalculationByEb(List equipmentAttributeList, List windTowerCalculationDataList, String fieldName) { List ebId = equipmentAttributeList.stream().filter(e -> e.getFieldName().equals(fieldName)).map(EquipmentAttribute::getId).collect(Collectors.toList()); List dataList = windTowerCalculationDataList.stream().filter(w -> w.getEbId().equals(ebId.get(0))).map(WindTowerCalculationData::getValue).collect(Collectors.toList()); return dataList.size() > 0 ? CalculationUtil.getAvgWind(dataList) : BigDecimal.ZERO; } //首页全省资源概述 public HashMap getResourcesOverview() { ProvincialEnergyStations provincialEnergyStations = provincialEnergyStationsService.getProvincialEnergyStations(); HashMap hashMap = new HashMap<>(); hashMap.put("resourcesOverview", provincialEnergyStations.getResourcesOverview()); return hashMap; } //获取华电以及全省资源概况 public ProvincialEnergyStations getProvincialEnergyStations() { return provincialEnergyStationsService.getProvincialEnergyStations(); } //获取项目类别以及项目概况 public HashMap getProjectSort() { HashMap dataMap = new HashMap<>(); List totalityInfos = totalityInfoService.selectTotalityInfoList(); List projectInfoList = projectInfoService.getProjectInfoList(); //根据类别分组 Map> four = projectInfoList.stream() .filter(p -> !p.getProjectBasicInfo().getProjectSort().equals("four")) .collect(Collectors.groupingBy((ProjectInfo pro) -> { return pro.getProjectBasicInfo().getProjectSort(); })); //循环数据 存放Id和项目名称 for (Map.Entry> entry : four.entrySet()) { ArrayList projectInfoDtoList = new ArrayList<>(); for (ProjectInfo projectInfo : entry.getValue()) { ProjectInfoDto projectInfoDto = new ProjectInfoDto(); projectInfoDto.setId(projectInfo.getId()); projectInfoDto.setProjectSort(projectInfo.getProjectBasicInfo().getProjectName()); projectInfoDtoList.add(projectInfoDto); } dataMap.put(entry.getKey(), projectInfoDtoList); } //项目基本信息 dataMap.put("pInfo", totalityInfos.get(0).getPInfo()); return dataMap; } //查询项目概况 public HashMap projectMapInfo(String projectId) { HashMap dataMap = new HashMap<>(); //获取项目信息 List projectInfoList = projectInfoService.getProjectInfoList(); //根据项目ID过滤指定数据 List collect = projectInfoList.stream().filter(p -> p.getId().equals(projectId)).collect(Collectors.toList()); //获取对应项目概述 if (!collect.isEmpty()) { for (ProjectInfo projectInfo : collect) { dataMap.put("projectOverview", projectInfo.getProjectBasicInfo().getProjectOverview()); dataMap.put("resourcesOverview", projectInfo.getProjectBasicInfo().getResourcesOverview()); // if (projectInfo.getEquipment() != null && projectInfo.getEquipment().size() > 0) { // dataMap.put("longitude", projectInfo.getEquipment().get(0).getLongitude()); // dataMap.put("latitude", projectInfo.getEquipment().get(0).getLatitude()); // } if (StrUtil.isNotBlank(projectInfo.getProjectBasicInfo().getPosition())) { String[] split = projectInfo.getProjectBasicInfo().getPosition().split(","); dataMap.put("longitude", split[0]); dataMap.put("latitude", split[1]); } } } return dataMap; } //地图点位坐标 (风机、测风塔、拐点) public HashMap getPointMap() { HashMap dataMap = new HashMap<>(); //获取项目信息 List projectInfoList = projectInfoService.getProjectInfoList(); //获取场站数据 List stationInfoList = stationInfoService.selectStationInfo(); //循环所有项目于信息 //测风塔List HashSet> towerList = new HashSet<>(); //拐点坐标List ArrayList>>> coordinateList = new ArrayList<>(); //风机List List> fanList = new ArrayList<>(); // 环境监测仪 List> weatherList = new ArrayList<>(); List> inverterList = new ArrayList<>(); HashSet eqNoList = new HashSet<>(); for (StationInfo stationInfo : stationInfoList) { if (stationInfo.getEquipment() != null && stationInfo.getEquipment().size() > 0) { //循环测风塔信息 ArrayList> arrayList = new ArrayList<>(); for (Equipment equipment : stationInfo.getEquipment()) { eqNoList.add(equipment.getEquipmentNo()); HashMap map = new HashMap<>(); map.put("type", "station"); map.put("longitude", equipment.getLongitude()); map.put("latitude", equipment.getLatitude()); map.put("towerName", equipment.getName()); map.put("towerNo", equipment.getEquipmentNo()); map.put("projectId", stationInfo.getId()); arrayList.add(map); } towerList.addAll(arrayList); } if (stationInfo.getFanTowerList() != null && stationInfo.getFanTowerList().size() > 0) { Map> collect = stationInfo.getFanTowerList().stream().collect(Collectors.groupingBy(FanTower::getFanModel)); for (Map.Entry> entry : collect.entrySet()) { HashMap map = new HashMap<>(); List collect1 = stationInfo.getFanTowerList().stream().filter(w -> w.getFanModel().equals(entry.getKey())).collect(Collectors.toList()); map.put("type", "station"); map.put("name", stationInfo.getStationBasicInfo().getStationName()); map.put("data", collect1); fanList.add(map); } } if (stationInfo.getWeatherStationInfos() != null && stationInfo.getWeatherStationInfos().size() > 0) { ArrayList> arrayList = new ArrayList<>(); for (WeatherStationInfo weatherStationInfo : stationInfo.getWeatherStationInfos()) { HashMap map = new HashMap<>(); map.put("type", "station"); map.put("longitude", weatherStationInfo.getLongitude()); map.put("latitude", weatherStationInfo.getLatitude()); map.put("name", weatherStationInfo.getName()); map.put("id", weatherStationInfo.getId()); map.put("stationId", stationInfo.getId()); arrayList.add(map); } weatherList.addAll(arrayList); } if (stationInfo.getInverterInfos() != null && stationInfo.getInverterInfos().size() > 0) { ArrayList> arrayList = new ArrayList<>(); HashMap map = new HashMap<>(); map.put("type", "station"); map.put("name", stationInfo.getStationBasicInfo().getStationName()); map.put("data", stationInfo.getInverterInfos()); arrayList.add(map); inverterList.addAll(arrayList); } } for (ProjectInfo projectInfo : projectInfoList) { Map>> cmap = new HashMap<>(); cmap.put(projectInfo.getProjectBasicInfo().getProjectNameEasy(), projectInfo.getCoordinates()); //拐点坐标 coordinateList.add(cmap); if (projectInfo.getEquipment() != null && projectInfo.getEquipment().size() > 0) { //循环测风塔信息 for (Equipment equipment : projectInfo.getEquipment()) { HashMap map = new HashMap<>(); eqNoList.add(equipment.getEquipmentNo()); map.put("type", "project"); map.put("longitude", equipment.getLongitude()); map.put("latitude", equipment.getLatitude()); map.put("towerName", equipment.getName()); map.put("towerNo", equipment.getEquipmentNo()); map.put("projectId", projectInfo.getId()); towerList.add(map); } } if (projectInfo.getFanTowerList() != null && projectInfo.getFanTowerList().size() > 0) { HashMap map = new HashMap<>(); map.put("type", "project"); map.put("name", projectInfo.getProjectBasicInfo().getProjectName()); map.put("data", projectInfo.getFanTowerList()); fanList.add(map); } } dataMap.put("coordinatesList", coordinateList); List> listMap = new ArrayList<>(); //利用塔编号过滤分组项目以及场站的id for (String s : eqNoList) { ArrayList arrayList = new ArrayList<>(); List> towerNo = towerList.stream().filter(key -> key.get("towerNo").equals(s)).collect(Collectors.toList()); //有多条只添加一个其他都是一样的只需要替换id 多余的需要删除 for (Map map : towerNo) { HashMap hashMap1 = new HashMap<>(); hashMap1.put("type", map.get("type")); if (map.containsKey("projectId")) { hashMap1.put("id", map.get("projectId")); arrayList.add(hashMap1); } } //替换id值 towerNo.get(0).put("projectId", arrayList); listMap.add(towerNo.get(0)); } dataMap.put("towerList", listMap); dataMap.put("fan", fanList); dataMap.put("weather", weatherList); dataMap.put("inverter", inverterList); return dataMap; } /** * 项目测风塔下拉框(mongo) * * @return List */ // public List projectSelect() { // List projectInfoList = projectInfoService.getProjectInfoList(); // ArrayList 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 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 */ public List projectSelect() { List projectList = projectService.list(); List windTowerInfoList = windTowerInfoService.getAllWindTower(); ArrayList selectList = new ArrayList<>(); for (Project project : projectList) { SelectLabForVal selectLabForVal = new SelectLabForVal(); selectLabForVal.setLabel(project.getProjectNameEasy()); selectLabForVal.setValue(project.getId()); ArrayList equipmentDtoList = new ArrayList<>(); EquipmentDto equipmentDto = new EquipmentDto(); if(project.getRelationEquipment().contains(",")){ String[] equipments = project.getRelationEquipment().split(","); for (String equipment : equipments) { equipmentDto = new EquipmentDto(); List 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); } }else{ List 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; } //查询场站信息以及场站列表 public HashMap getStationTotalityInfo() { //总体信息 List totalityInfos = totalityInfoService.selectTotalityInfoList(); //场站信息 List stationInfos = stationInfoService.selectStationInfo(); HashMap stationMap = new HashMap<>(); if (totalityInfos.size() > 0) { stationMap.put("fInfo", totalityInfos.get(0).getFInfo()); stationMap.put("gInfo", totalityInfos.get(0).getGInfo()); if (stationInfos.size() > 0) { ArrayList arrayList = new ArrayList<>(); for (StationInfo stationInfo : stationInfos) { HashMap hashMap = new HashMap<>(); hashMap.put("id", stationInfo.getId()); hashMap.put("stationName", stationInfo.getStationBasicInfo().getStationName()); //经度 hashMap.put("longitude", stationInfo.getStationBasicInfo().getLongitude()); //纬度 hashMap.put("latitude", stationInfo.getStationBasicInfo().getLatitude()); hashMap.put("type", stationInfo.getStationBasicInfo().getStationType()); arrayList.add(hashMap); } stationMap.put("station", arrayList); } } return stationMap; } /** * 查询所有的场站坐标 */ public HashMap getStationSeat() { HashMap dataMap = new HashMap<>(); List otherStationInfoList = otherStationInfoService.selectOtherStationInfo(); List stationInfos = stationInfoService.selectStationInfo(); ArrayList> stationList = new ArrayList<>(); for (StationInfo stationInfo : stationInfos) { HashMap hashMap = new HashMap<>(); hashMap.put("id", stationInfo.getId()); hashMap.put("stationName", stationInfo.getStationBasicInfo().getStationName()); //经度 hashMap.put("longitude", stationInfo.getStationBasicInfo().getLongitude()); //纬度 hashMap.put("latitude", stationInfo.getStationBasicInfo().getLatitude()); hashMap.put("type", stationInfo.getStationBasicInfo().getStationType()); stationList.add(hashMap); } ArrayList> otherStationList = new ArrayList<>(); for (OtherStationInfo otherStationInfo : otherStationInfoList) { if (otherStationInfo.getStationType().equals("风")) {//目前只要风 HashMap hashMap = new HashMap<>(); hashMap.put("id", otherStationInfo.getId()); hashMap.put("stationName", otherStationInfo.getStationName()); //经度 hashMap.put("longitude", otherStationInfo.getLongitude()); //纬度 hashMap.put("latitude", otherStationInfo.getLatitude()); hashMap.put("type", otherStationInfo.getStationType()); otherStationList.add(hashMap); } } dataMap.put("HDStation", stationList); dataMap.put("otherStation", otherStationList); return dataMap; } /** * 查询所有的项目坐标 */ public ArrayList getProjectSeat() { ArrayList arrayList = new ArrayList<>(); //获取项目信息 List projectInfoList = projectInfoService.getProjectInfoList(); for (ProjectInfo projectInfo : projectInfoList) { HashMap map = new HashMap<>(); if (StrUtil.isNotBlank(projectInfo.getProjectBasicInfo().getPosition())) { map.put("id", projectInfo.getId()); map.put("projectNameEasy", projectInfo.getProjectBasicInfo().getProjectNameEasy()); map.put("projectName", projectInfo.getProjectBasicInfo().getProjectName()); String[] split = projectInfo.getProjectBasicInfo().getPosition().split(","); map.put("longitude", split[0]); map.put("latitude", split[1]); map.put("type", projectInfo.getProjectBasicInfo().getProjectType()); } // if (projectInfo.getEquipment() != null && projectInfo.getEquipment().size() > 0) { // // } arrayList.add(map); } return arrayList; } /** * 查询场站详细信息(风机、机型等) */ public HashMap getStationInfo(String stationId) { //场站信息 List stationInfos = stationInfoService.selectStationInfo(); List stationInfoList = stationInfos.stream().filter(s -> s.getId().equals(stationId)).collect(Collectors.toList()); List fanModelDataList = fanModelDataService.getFanModelDataList(); //过滤 List collect = fanModelDataList.stream().filter(f -> f.getStationId().equals(stationId)).collect(Collectors.toList()); HashMap dataMap = new HashMap<>(); if (stationInfoList.size() > 0) { ArrayList> arrayList = new ArrayList<>(); if (stationInfoList.get(0).getStationBasicInfo().getStationType().equals("风")) { //根据风机类型分组 Map> modelMap = stationInfoList.get(0).getFanTowerList().stream() .collect(Collectors.groupingBy(FanTower::getFanModel)); //遍历map指定key for (Map.Entry> entry : modelMap.entrySet()) { dataPag(collect, entry.getKey(), entry.getValue().size(), arrayList); } } else { //根据逆变器类型分组 Map> modelMap = stationInfoList.get(0).getInverterInfos().stream() .collect(Collectors.groupingBy(InverterInfo::getModelNumber)); //遍历map指定key for (Map.Entry> entry : modelMap.entrySet()) { dataPag(collect, entry.getKey(), entry.getValue().size(), arrayList); } } //过滤塔信息 StationInfo stationInfo = stationInfoList.get(0); dataMap.put("longitude", stationInfo.getStationBasicInfo().getLongitude()); dataMap.put("latitude", stationInfo.getStationBasicInfo().getLatitude()); dataMap.put("modelT", arrayList); } return dataMap; } //组装数据 public void dataPag(List collect, String key, int size, ArrayList> arrayList) { for (FanModelData fanModelData : collect) { if (fanModelData.getModelName().equals(key)) { HashMap map = new HashMap<>(); //风机名称 map.put("modelType", key); //风机数量 map.put("modelTotal", size); //平均风速 map.put("wsAve", fanModelData.getWsAve()); //主风向 map.put("wdSum", fanModelData.getWdSum()); //发电量 map.put("generatingCapacity", fanModelData.getGeneratingCapacity()); //等效小时数 map.put("realTimeTotal", size == 0 ? 0 : fanModelData.getRealTimeTotal()); arrayList.add(map); } } } /** * 风场站测风塔下拉框 * * @return List */ public List stationSelect() { List stationInfos = stationInfoService.selectStationInfo(); List stationInfoList = stationInfos.stream().filter(w -> w.getStationBasicInfo().getStationType().equals("风")).collect(Collectors.toList()); ArrayList 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 equipmentDtoList = new ArrayList<>(); //循环数据 放入测风塔id和测风塔名称 for (Equipment equipment : stationInfo.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 */ public List gStationSelect() { List stationInfos = stationInfoService.selectStationInfo(); List stationInfoList = stationInfos.stream().filter(w -> w.getStationBasicInfo().getStationType().equals("光")).collect(Collectors.toList()); ArrayList 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.getWeatherStationInfos() !=null && stationInfo.getWeatherStationInfos().size() > 0) { ArrayList weatherStationList = new ArrayList<>(); //循环数据 放入测风塔id和测风塔名称 for (WeatherStationInfo weatherStationInfo : stationInfo.getWeatherStationInfos()) { weatherStationList.add(weatherStationInfo); } selectLabForVal.setWeatherStationInfo(weatherStationList); } selectList.add(selectLabForVal); } } return selectList; } //项目进展 public List getProjectEvolve(String projectId) { //查询项目进展信息 List projectProgresses = proProjectInfoService.selectProProjectInfo(); //根据项目id筛选数据 List progressList = projectProgresses.stream().filter(p -> p.getProjectId().equals(projectId)).collect(Collectors.toList()); ArrayList 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()); if (menusOne.getProjectMenusTows().size() > 0 && menusOne.getProjectMenusTows().get(0).getIndex().equals("")) { if (menusOne.getProjectMenusTows().get(0).getProjectMenusThreeList().size() > 0) { //设置三级详细工作内容 projectEvolveDtoOne.setDetailedTaskContent(menusOne.getProjectMenusTows().get(0).getProjectMenusThreeList().get(0).getWorkContent()); //设置三级实际完成时间 projectEvolveDtoOne.setRealTime(menusOne.getProjectMenusTows().get(0).getProjectMenusThreeList().get(0).getRealTime()); //设置备注 projectEvolveDtoOne.setStatus(menusOne.getProjectMenusTows().get(0).getProjectMenusThreeList().get(0).getRemark()); projectEvolveList.add(projectEvolveDtoOne); } } else { 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(menusTow.getPlanTime()); //放入二级工作内容 projectEvolveDto.setTaskContent(menusTow.getWorkContent()); //详细工作信息 三级工作内容 projectEvolveDto.setDetailedTaskContent(menusThree.getWorkContent()); //实际完成时间 三级时间 projectEvolveDto.setRealTime(menusThree.getRealTime()); //放入状态 三级备注 projectEvolveDto.setStatus(menusThree.getRemark()); projectEvolveList.add(projectEvolveDto); } } else { ProjectEvolveDto projectEvolveDto = new ProjectEvolveDto(); projectEvolveDto.setIndex(menusTow.getIndex()); projectEvolveDto.setTaskContent(menusTow.getWorkContent()); projectEvolveDto.setPlanTime(menusTow.getPlanTime()); projectEvolveList.add(projectEvolveDto); } } } } } } } } return projectEvolveList; } }