dev #2
@ -345,16 +345,16 @@ public class EmsStatsReportServiceImpl implements IEmsStatsReportService
|
||||
public List<AmmeterRevenueStatisListVo> getAmmeterRevenueDataResult(StatisAmmeterDateRequest requestVo) {
|
||||
String siteId = requestVo.getSiteId();
|
||||
List<AmmeterRevenueStatisListVo> resultList = new ArrayList<>();
|
||||
//查询电价配置
|
||||
List<EnergyPriceConfigVo> priceConfigList = emsEnergyPriceConfigMapper.getConfigListByTimeFrame(siteId, requestVo.getStartTime(), requestVo.getEndTime());
|
||||
if (CollectionUtils.isEmpty(priceConfigList)){
|
||||
return Collections.emptyList();
|
||||
}
|
||||
//查询电表数据
|
||||
List<AmmeterStatisListVo> dataList = this.getAmmeterDataResult(requestVo);
|
||||
if (CollectionUtils.isEmpty(dataList)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
//查询电价配置
|
||||
List<EnergyPriceConfigVo> priceConfigList = emsEnergyPriceConfigMapper.getConfigListByTimeFrame(siteId, requestVo.getStartTime(), requestVo.getEndTime());
|
||||
if (CollectionUtils.isEmpty(priceConfigList)){
|
||||
return Collections.emptyList();
|
||||
}
|
||||
Map<String, List<EnergyPriceConfigVo>> priceConfigMap = priceConfigList.stream().collect(Collectors.groupingBy(EnergyPriceConfigVo::getYearMonth));
|
||||
dataList.forEach(ammeter -> {
|
||||
List<EnergyPriceConfigVo> priceConfigs = priceConfigMap.get(ammeter.getDataTime().substring(0, 7));
|
||||
|
||||
@ -1,14 +1,10 @@
|
||||
package com.xzzn.ems.utils;
|
||||
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.xzzn.common.annotation.Excel;
|
||||
import com.xzzn.common.constant.RedisKeyConstants;
|
||||
import com.xzzn.common.core.redis.RedisCache;
|
||||
|
||||
import com.xzzn.common.enums.PointType;
|
||||
import com.xzzn.common.utils.DataUtils;
|
||||
import com.xzzn.common.utils.StringUtils;
|
||||
import com.xzzn.ems.domain.EmsPointEnumMatch;
|
||||
import com.xzzn.ems.domain.EmsPointMatch;
|
||||
@ -27,13 +23,10 @@ import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@ -56,18 +49,18 @@ public class DevicePointMatchDataProcessor {
|
||||
/**
|
||||
* 初始化加载设备匹配点位配置数据
|
||||
*/
|
||||
@PostConstruct
|
||||
public void init()
|
||||
{
|
||||
try {
|
||||
ClassPathResource classPathResource = new ClassPathResource("biz/configData/DevicePointMatch.json");
|
||||
String configJson = DataUtils.getJSONFromFile(classPathResource.getInputStream());
|
||||
devicePointMatchInfo = JSONObject.parseObject(configJson, DevicePointMatchInfo.class);
|
||||
log.info("初始化设备匹配点位配置数据成功。"+ JSON.toJSONString(devicePointMatchInfo));
|
||||
} catch (Exception ex) {
|
||||
log.error("OcrMedicalStdHandler 设置mapping数据异常。", ex);
|
||||
}
|
||||
}
|
||||
// @PostConstruct
|
||||
// public void init()
|
||||
// {
|
||||
// try {
|
||||
// ClassPathResource classPathResource = new ClassPathResource("biz/configData/DevicePointMatch.json");
|
||||
// String configJson = DataUtils.getJSONFromFile(classPathResource.getInputStream());
|
||||
// devicePointMatchInfo = JSONObject.parseObject(configJson, DevicePointMatchInfo.class);
|
||||
// log.info("初始化设备匹配点位配置数据成功。"+ JSON.toJSONString(devicePointMatchInfo));
|
||||
// } catch (Exception ex) {
|
||||
// log.error("OcrMedicalStdHandler 设置mapping数据异常。", ex);
|
||||
// }
|
||||
// }
|
||||
|
||||
/**
|
||||
* 获取字段注解信息
|
||||
|
||||
Reference in New Issue
Block a user