解决生产环境接口空指针报错

This commit is contained in:
zq
2025-12-15 15:36:24 +08:00
parent 6af6232b51
commit 41b846c7f9

View File

@ -141,8 +141,11 @@ public class SingleSiteServiceImpl implements ISingleSiteService {
if (!StringUtils.isEmpty(siteId)) { if (!StringUtils.isEmpty(siteId)) {
// 实时有功功率/实时无功功率 // 实时有功功率/实时无功功率
SiteMonitorRunningHeadInfoVo tempVo = emsPcsDataMapper.getSiteRunningHeadInfo(siteId); SiteMonitorRunningHeadInfoVo tempVo = emsPcsDataMapper.getSiteRunningHeadInfo(siteId);
if (tempVo != null) {
siteMonitorRunningHeadInfoVo.setTotalActivePower(tempVo.getTotalActivePower()); siteMonitorRunningHeadInfoVo.setTotalActivePower(tempVo.getTotalActivePower());
siteMonitorRunningHeadInfoVo.setTotalReactivePower(tempVo.getTotalReactivePower()); siteMonitorRunningHeadInfoVo.setTotalReactivePower(tempVo.getTotalReactivePower());
}
// 今日充放电 // 今日充放电
LocalDateTime now = LocalDateTime.now(); LocalDateTime now = LocalDateTime.now();
LocalDateTime startOfDay = now.with(LocalTime.MIN); LocalDateTime startOfDay = now.with(LocalTime.MIN);