From 2865154686dda6389d8c254e4bf7cf1b151c69d9 Mon Sep 17 00:00:00 2001 From: xiachao Date: Fri, 30 Aug 2024 15:45:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=87=BA=E5=BA=93=E8=AE=B0=E5=BD=95=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=20bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/IotCarbonUseConfigServiceImpl.java | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/modules/carbon-track/src/main/java/com/thing/carbontrack/useConfig/service/impl/IotCarbonUseConfigServiceImpl.java b/modules/carbon-track/src/main/java/com/thing/carbontrack/useConfig/service/impl/IotCarbonUseConfigServiceImpl.java index fed9ea1..f5d4880 100644 --- a/modules/carbon-track/src/main/java/com/thing/carbontrack/useConfig/service/impl/IotCarbonUseConfigServiceImpl.java +++ b/modules/carbon-track/src/main/java/com/thing/carbontrack/useConfig/service/impl/IotCarbonUseConfigServiceImpl.java @@ -1,11 +1,15 @@ package com.thing.carbontrack.useConfig.service.impl; import com.mybatisflex.core.query.QueryWrapper; +import com.thing.carbon.config.entity.CarbonEnergyVarietyEntity; +import com.thing.carbon.config.service.CarbonEnergyVarietyService; import com.thing.carbontrack.productionRecord.dto.ProductionOverviewReq; import com.thing.carbontrack.productionRecord.service.IotCarbonProductionRecordService; import com.thing.carbontrack.productionResult.dto.DisposeDetail; import com.thing.carbontrack.productionResult.dto.PtDetail; import com.thing.carbontrack.productionResult.dto.PuDetail; +import com.thing.carbontrack.ratio.entity.IotCarbonRatioEntity; +import com.thing.carbontrack.ratio.service.IotCarbonRatioService; import com.thing.carbontrack.useConfig.dto.IotCarbonUseConfigDTO; import com.thing.carbontrack.useConfig.entity.IotCarbonUseConfigEntity; import com.thing.carbontrack.useConfig.mapper.IotCarbonUseConfigMapper; @@ -32,7 +36,10 @@ public class IotCarbonUseConfigServiceImpl extends BaseServiceImpl params){ QueryWrapper wrapper = new QueryWrapper(); @@ -103,7 +110,19 @@ public class IotCarbonUseConfigServiceImpl extends BaseServiceImpl configDTOList = this.listAs(wrapper,IotCarbonUseConfigDTO.class); + + configDTOList.forEach(temp->{ + try { + IotCarbonRatioEntity ratioDTO = carbonRatioService.getById(temp.getEvId()); + CarbonEnergyVarietyEntity varietyEntity = energyVarietyService.getById(ratioDTO.getEvId()); + temp.setTransportName(varietyEntity.getName()); + } catch (Exception e) { + temp.setTransportName("未知"); + } + }); + + return configDTOList; } @Override