Browse Source

发电量单位处理

2025年1月15日17:03:58
qingyuan_dev_new
lishuai 1 year ago
parent
commit
96eec6b8a7
  1. 8
      modules/qingyuan/src/main/java/com/thing/qingyuan/manageboard/service/impl/PlantServiceImpl.java

8
modules/qingyuan/src/main/java/com/thing/qingyuan/manageboard/service/impl/PlantServiceImpl.java

@ -28,10 +28,7 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.*;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
@ -226,7 +223,7 @@ public class PlantServiceImpl extends BaseServiceImpl<PlantMapper, PlantEntity>
TsKvDTO tsKvDTO29 = tsKvService.findLatestByCodeAndAttr(String.valueOf(plantId), "A29yy");
if(!Objects.isNull(tsKvDTO29)){
plantDTO.setAttrKey29yy(tsKvDTO29.getAttrKey());
plantDTO.setVal29yy(tsKvDTO29.getVal());
plantDTO.setVal29yy(new BigDecimal(tsKvDTO29.getVal()).divide(new BigDecimal(10000)).setScale(4,RoundingMode.UP).toPlainString());
//年减排量
if(!Objects.isNull(plantDTO.getProfitco2())){
BigDecimal reductionUsage = CalculationUtil.getCarbonUsage(new BigDecimal(tsKvDTO29.getVal()), reductionFactor, coefficient, 2);
@ -251,6 +248,7 @@ public class PlantServiceImpl extends BaseServiceImpl<PlantMapper, PlantEntity>
}
}
}
plantDTOS.sort(Comparator.comparing(PlantDTO::getCapacity).reversed());
return plantDTOS;
}

Loading…
Cancel
Save