|
@@ -1,42 +1,30 @@
|
|
package com.jiayue.biz.service.impl;
|
|
package com.jiayue.biz.service.impl;
|
|
|
|
|
|
import cn.hutool.core.date.DateTime;
|
|
import cn.hutool.core.date.DateTime;
|
|
-import cn.hutool.core.util.ObjectUtil;
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
import cn.hutool.db.Entity;
|
|
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.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
-import com.jiayue.biz.conf.RequestDataHelper;
|
|
|
|
import com.jiayue.biz.domain.*;
|
|
import com.jiayue.biz.domain.*;
|
|
import com.jiayue.biz.dto.EquipmentDto;
|
|
import com.jiayue.biz.dto.EquipmentDto;
|
|
import com.jiayue.biz.dto.ProjectEvolveDto;
|
|
import com.jiayue.biz.dto.ProjectEvolveDto;
|
|
import com.jiayue.biz.dto.ProjectInfoDto;
|
|
import com.jiayue.biz.dto.ProjectInfoDto;
|
|
import com.jiayue.biz.dto.SelectLabForVal;
|
|
import com.jiayue.biz.dto.SelectLabForVal;
|
|
import com.jiayue.biz.eunms.WindDirectionEnum;
|
|
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.mapper.WindTowerDataParentTableMapper;
|
|
import com.jiayue.biz.service.*;
|
|
import com.jiayue.biz.service.*;
|
|
import com.jiayue.biz.util.CalculationUtil;
|
|
import com.jiayue.biz.util.CalculationUtil;
|
|
import com.jiayue.biz.util.DateTimeUtil;
|
|
import com.jiayue.biz.util.DateTimeUtil;
|
|
-import com.jiayue.common.core.redis.RedisCache;
|
|
|
|
import com.jiayue.common.utils.DateUtil;
|
|
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 lombok.AllArgsConstructor;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
import java.math.RoundingMode;
|
|
import java.math.RoundingMode;
|
|
import java.sql.Timestamp;
|
|
import java.sql.Timestamp;
|
|
-import java.sql.Wrapper;
|
|
|
|
import java.text.ParseException;
|
|
import java.text.ParseException;
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
-import java.util.stream.Stream;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
* 首页Service业务层处理
|
|
* 首页Service业务层处理
|
|
@@ -159,7 +147,7 @@ public class HomePageServiceImpl extends ServiceImpl<WindTowerDataParentTableMap
|
|
Date beginTime = DateUtil.offsetMonth(DateUtil.beginOfMonth(yearDay), 1);
|
|
Date beginTime = DateUtil.offsetMonth(DateUtil.beginOfMonth(yearDay), 1);
|
|
Map<String, Long> startAndEnd = prophaseWeatherDataService.getDataTimeStartAndEnd(equipmentId);
|
|
Map<String, Long> startAndEnd = prophaseWeatherDataService.getDataTimeStartAndEnd(equipmentId);
|
|
|
|
|
|
- if(beginTime.getTime() < startAndEnd.get("startTime")){
|
|
|
|
|
|
+ if (beginTime.getTime() < startAndEnd.get("startTime")) {
|
|
beginTime = new Date(startAndEnd.get("startTime"));
|
|
beginTime = new Date(startAndEnd.get("startTime"));
|
|
}
|
|
}
|
|
Date endTime = lastDataCalculation.getTime();
|
|
Date endTime = lastDataCalculation.getTime();
|
|
@@ -838,7 +826,7 @@ public class HomePageServiceImpl extends ServiceImpl<WindTowerDataParentTableMap
|
|
selectLabForVal.setValue(project.getId());
|
|
selectLabForVal.setValue(project.getId());
|
|
ArrayList<EquipmentDto> equipmentDtoList = new ArrayList<>();
|
|
ArrayList<EquipmentDto> equipmentDtoList = new ArrayList<>();
|
|
EquipmentDto equipmentDto = new EquipmentDto();
|
|
EquipmentDto equipmentDto = new EquipmentDto();
|
|
- if(project.getRelationEquipment().contains(",")){
|
|
|
|
|
|
+ if (project.getRelationEquipment().contains(",")) {
|
|
String[] equipments = project.getRelationEquipment().split(",");
|
|
String[] equipments = project.getRelationEquipment().split(",");
|
|
for (String equipment : equipments) {
|
|
for (String equipment : equipments) {
|
|
equipmentDto = new EquipmentDto();
|
|
equipmentDto = new EquipmentDto();
|
|
@@ -849,7 +837,7 @@ public class HomePageServiceImpl extends ServiceImpl<WindTowerDataParentTableMap
|
|
equipmentDto.setType(windTowerInfos.get(0).getType());
|
|
equipmentDto.setType(windTowerInfos.get(0).getType());
|
|
equipmentDtoList.add(equipmentDto);
|
|
equipmentDtoList.add(equipmentDto);
|
|
}
|
|
}
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
List<WindTowerInfo> windTowerInfos = windTowerInfoList.stream().filter(w -> w.getEquipmentNo().equals(project.getRelationEquipment())).collect(Collectors.toList());
|
|
List<WindTowerInfo> windTowerInfos = windTowerInfoList.stream().filter(w -> w.getEquipmentNo().equals(project.getRelationEquipment())).collect(Collectors.toList());
|
|
equipmentDto.setLabel(windTowerInfos.get(0).getName());
|
|
equipmentDto.setLabel(windTowerInfos.get(0).getName());
|
|
equipmentDto.setValue(project.getRelationEquipment());
|
|
equipmentDto.setValue(project.getRelationEquipment());
|
|
@@ -1060,6 +1048,7 @@ public class HomePageServiceImpl extends ServiceImpl<WindTowerDataParentTableMap
|
|
|
|
|
|
return selectList;
|
|
return selectList;
|
|
}
|
|
}
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 光场站测风塔下拉框
|
|
* 光场站测风塔下拉框
|
|
*
|
|
*
|
|
@@ -1075,7 +1064,7 @@ public class HomePageServiceImpl extends ServiceImpl<WindTowerDataParentTableMap
|
|
SelectLabForVal selectLabForVal = new SelectLabForVal();
|
|
SelectLabForVal selectLabForVal = new SelectLabForVal();
|
|
selectLabForVal.setLabel(stationInfo.getStationBasicInfo().getStationName());
|
|
selectLabForVal.setLabel(stationInfo.getStationBasicInfo().getStationName());
|
|
selectLabForVal.setValue(stationInfo.getId());
|
|
selectLabForVal.setValue(stationInfo.getId());
|
|
- if (stationInfo.getWeatherStationInfos() !=null && stationInfo.getWeatherStationInfos().size() > 0) {
|
|
|
|
|
|
+ if (stationInfo.getWeatherStationInfos() != null && stationInfo.getWeatherStationInfos().size() > 0) {
|
|
ArrayList<WeatherStationInfo> weatherStationList = new ArrayList<>();
|
|
ArrayList<WeatherStationInfo> weatherStationList = new ArrayList<>();
|
|
//循环数据 放入测风塔id和测风塔名称
|
|
//循环数据 放入测风塔id和测风塔名称
|
|
for (WeatherStationInfo weatherStationInfo : stationInfo.getWeatherStationInfos()) {
|
|
for (WeatherStationInfo weatherStationInfo : stationInfo.getWeatherStationInfos()) {
|