|
|
|
@ -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<IotCarbonUseC |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private IotCarbonProductionRecordService iotCarbonProductionRecordService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private CarbonEnergyVarietyService energyVarietyService; |
|
|
|
@Autowired |
|
|
|
private IotCarbonRatioService carbonRatioService; |
|
|
|
@Override |
|
|
|
public QueryWrapper getWrapper(Map<String, Object> params){ |
|
|
|
QueryWrapper wrapper = new QueryWrapper(); |
|
|
|
@ -103,7 +110,19 @@ public class IotCarbonUseConfigServiceImpl extends BaseServiceImpl<IotCarbonUseC |
|
|
|
wrapper.eq("customer_name",customerName,ObjectUtils.isNotEmpty(customerName)); |
|
|
|
wrapper.eq("customer_address",customerAddress,ObjectUtils.isNotEmpty(customerAddress)); |
|
|
|
wrapper.eq("type","1"); |
|
|
|
return this.listAs(wrapper,IotCarbonUseConfigDTO.class); |
|
|
|
List<IotCarbonUseConfigDTO> 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 |
|
|
|
|