diff --git a/health-watch/health-watch-biz/src/main/java/com/renkang/watch/service/impl/WatchServiceImpl.java b/health-watch/health-watch-biz/src/main/java/com/renkang/watch/service/impl/WatchServiceImpl.java index 219087c..205b1bf 100644 --- a/health-watch/health-watch-biz/src/main/java/com/renkang/watch/service/impl/WatchServiceImpl.java +++ b/health-watch/health-watch-biz/src/main/java/com/renkang/watch/service/impl/WatchServiceImpl.java @@ -669,7 +669,7 @@ public class WatchServiceImpl implements IWatchService { wrapper.eq(WatchStatUserInfoDaySleep::getUserId, userId); wrapper.isNotNull(WatchStatUserInfoDaySleep::getLongDurationTotal); WatchIndexVo vo = daySleepMapper.selectJoinOne(WatchIndexVo.class,wrapper); - return vo.getAveSleep(); + return null != vo ? vo.getAveSleep() : 0; } private Integer queryTotalDistance(String userId) { @@ -677,7 +677,7 @@ public class WatchServiceImpl implements IWatchService { wrapper.selectSum(WatchStatUserInfoDaySdc::getDistanceValue,WatchIndexVo::getDistance); wrapper.eq(WatchStatUserInfoDaySdc::getUserId, userId); WatchIndexVo vo = statSdcMapper.selectJoinOne(WatchIndexVo.class,wrapper); - return vo.getDistance(); + return null != vo ? vo.getDistance() : 0; } @Override