style(watch): 睡眠接口午睡(短睡)兼容问题处理
This commit is contained in:
+7
-1
@@ -974,7 +974,13 @@ public class WatchDataApiServiceImpl implements WatchDataApiService {
|
||||
wrapper.eq(WatchStatUserInfoDaySleep::getUserId, userId);
|
||||
wrapper.orderByDesc(WatchStatUserInfoDaySleep::getDataDate);
|
||||
wrapper.last("FETCH FIRST 1 ROWS ONLY");
|
||||
return watchStatUserInfoDaySleepMapper.selectJoinOne(WatchH5IndexItemNewVo.class,wrapper);
|
||||
WatchH5IndexItemNewVo vo = watchStatUserInfoDaySleepMapper.selectJoinOne(WatchH5IndexItemNewVo.class, wrapper);
|
||||
// 浅睡有值但深睡为空 → 当天仅有浅睡数据,用浅睡补齐 dataValue/dataMax
|
||||
if (vo != null && StrUtil.isNotEmpty(vo.getDataMin()) && StrUtil.isEmpty(vo.getDataMax())) {
|
||||
vo.setDataValue(vo.getDataMin());
|
||||
vo.setDataMax(vo.getDataMin());
|
||||
}
|
||||
return vo;
|
||||
}
|
||||
|
||||
private WatchH5IndexItemNewVo latestHeartRateData(String userId) {
|
||||
|
||||
+7
-1
@@ -587,7 +587,13 @@ public class WatchServiceImpl implements IWatchService {
|
||||
wrapper.eq(WatchStatUserInfoDaySleep::getUserId, userId);
|
||||
wrapper.orderByDesc(WatchStatUserInfoDaySleep::getDataDate);
|
||||
wrapper.last("FETCH FIRST 1 ROWS ONLY");
|
||||
return daySleepMapper.selectJoinOne(WatchH5IndexItemNewVo.class,wrapper);
|
||||
WatchH5IndexItemNewVo vo = daySleepMapper.selectJoinOne(WatchH5IndexItemNewVo.class, wrapper);
|
||||
// 短睡(午睡)有值但长睡为空 → 当天仅有午睡数据,用短睡补齐 dataValue/dataMax
|
||||
if (vo != null && StrUtil.isNotEmpty(vo.getDataMin()) && StrUtil.isEmpty(vo.getDataMax())) {
|
||||
vo.setDataValue(vo.getDataMin());
|
||||
vo.setDataMax(vo.getDataMin());
|
||||
}
|
||||
return vo;
|
||||
}
|
||||
|
||||
private WatchH5IndexItemNewVo latestStepsData(String userId) {
|
||||
|
||||
Reference in New Issue
Block a user