解决生产环境接口空指针报错
This commit is contained in:
@ -65,9 +65,13 @@ public class EmsStatsReportServiceImpl implements IEmsStatsReportService
|
||||
|
||||
// 总充总放
|
||||
String nowData = DateUtils.getDate();
|
||||
BigDecimal totalDischarge = BigDecimal.ZERO;
|
||||
BigDecimal totalCharge = BigDecimal.ZERO;
|
||||
Map<String, BigDecimal> totalMap = emsDailyChargeDataMapper.getAllSiteChargeData(nowData,requestVo.getSiteId());
|
||||
BigDecimal totalDischarge = totalMap.get("totalDischargedCap") != null ? totalMap.get("totalDischargedCap") : BigDecimal.ZERO;
|
||||
BigDecimal totalCharge = totalMap.get("totalChargedCap") != null ? totalMap.get("totalChargedCap") : BigDecimal.ZERO;
|
||||
if (!CollectionUtils.isEmpty(totalMap)) {
|
||||
totalDischarge = totalMap.get("totalDischargedCap");
|
||||
totalCharge = totalMap.get("totalChargedCap");
|
||||
}
|
||||
BigDecimal efficiency = new BigDecimal(0);
|
||||
if ( totalCharge.compareTo(BigDecimal.ZERO)>0){
|
||||
efficiency = totalDischarge.divide(totalCharge, 2, RoundingMode.HALF_UP)
|
||||
@ -265,7 +269,7 @@ public class EmsStatsReportServiceImpl implements IEmsStatsReportService
|
||||
public List<AmmeterStatisListVo> getAmmeterDataResult(StatisAmmeterDateRequest requestVo){
|
||||
List<AmmeterStatisListVo> dataList = emsDailyEnergyDataMapper.getDataBySiteId(requestVo.getSiteId(),requestVo.getStartTime(),requestVo.getEndTime());
|
||||
if (dataList == null || dataList.size()==0){
|
||||
return null;
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
BigDecimal activePower = new BigDecimal(0);
|
||||
|
||||
Reference in New Issue
Block a user