调整查询心电数据
Some checks are pending
Java CI with Maven / build (11) (push) Waiting to run
Java CI with Maven / build (17) (push) Waiting to run
Java CI with Maven / build (8) (push) Waiting to run
yudao-ui-admin CI / build (14.x) (push) Waiting to run
yudao-ui-admin CI / build (16.x) (push) Waiting to run
Some checks are pending
Java CI with Maven / build (11) (push) Waiting to run
Java CI with Maven / build (17) (push) Waiting to run
Java CI with Maven / build (8) (push) Waiting to run
yudao-ui-admin CI / build (14.x) (push) Waiting to run
yudao-ui-admin CI / build (16.x) (push) Waiting to run
This commit is contained in:
parent
22ef44a772
commit
c574d6a774
@ -108,31 +108,18 @@ public class EcgdataController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/getByTime")
|
@GetMapping("/getByTime")
|
||||||
@Operation(summary = "根据时间戳和用户ID获得心电数据(聚合图片URL)")
|
@Operation(summary = "根据时间戳和用户ID获得心电数据")
|
||||||
@Parameter(name = "collecttime", description = "采集时间戳", required = true)
|
@Parameter(name = "collecttime", description = "采集时间戳", required = true)
|
||||||
@Parameter(name = "userId", description = "用户编号", required = true)
|
@Parameter(name = "userId", description = "用户编号", required = true)
|
||||||
public CommonResult<EcgdataTimeImageRespVO> getEcgdataByTime(@RequestParam("collecttime") Long collecttime,
|
public CommonResult<EcgdataRespVO> getEcgdataByTime(@RequestParam("collecttime") Long collecttime,
|
||||||
@RequestParam("userId") Integer userId) {
|
@RequestParam("userId") Integer userId) {
|
||||||
List<EcgdataDO> ecgdataList = ecgdataService.getEcgdataListByTime(collecttime, userId);
|
EcgdataDO ecgdata = ecgdataService.getEcgdataByTime(collecttime, userId);
|
||||||
|
|
||||||
if (ecgdataList == null || ecgdataList.isEmpty()) {
|
if (ecgdata == null) {
|
||||||
return success(null);
|
return success(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 取第一条记录作为基础数据
|
return success(BeanUtils.toBean(ecgdata, EcgdataRespVO.class));
|
||||||
EcgdataDO firstEcgdata = ecgdataList.get(0);
|
|
||||||
EcgdataTimeImageRespVO result = BeanUtils.toBean(firstEcgdata, EcgdataTimeImageRespVO.class);
|
|
||||||
|
|
||||||
// 聚合所有的图片URL
|
|
||||||
List<String> imageUrls = new ArrayList<>();
|
|
||||||
for (EcgdataDO ecgdata : ecgdataList) {
|
|
||||||
if (ecgdata.getEcgimageurl() != null && !ecgdata.getEcgimageurl().trim().isEmpty()) {
|
|
||||||
imageUrls.add(ecgdata.getEcgimageurl());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
result.setEcgimageurls(imageUrls);
|
|
||||||
|
|
||||||
return success(result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -71,16 +71,7 @@ public interface EcgdataService {
|
|||||||
EcgdataDO getEcgdataByTime(Long collecttime, Integer userId);
|
EcgdataDO getEcgdataByTime(Long collecttime, Integer userId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据时间戳和用户ID获得心电数据采集列表(聚合图片URL)
|
* 根据用户ID获得心电数据采集去重时间列表
|
||||||
*
|
|
||||||
* @param collecttime 采集时间戳
|
|
||||||
* @param userId 用户编号
|
|
||||||
* @return 聚合后的心电数据采集
|
|
||||||
*/
|
|
||||||
List<EcgdataDO> getEcgdataListByTime(Long collecttime, Integer userId);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据用户ID获得去重的心电采集时间列表
|
|
||||||
*
|
*
|
||||||
* @param userId 用户编号
|
* @param userId 用户编号
|
||||||
* @return 去重的采集时间列表
|
* @return 去重的采集时间列表
|
||||||
|
|||||||
@ -88,14 +88,6 @@ public class EcgdataServiceImpl implements EcgdataService {
|
|||||||
.orderByDesc(EcgdataDO::getId));
|
.orderByDesc(EcgdataDO::getId));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<EcgdataDO> getEcgdataListByTime(Long collecttime, Integer userId) {
|
|
||||||
return ecgdataMapper.selectList(new LambdaQueryWrapperX<EcgdataDO>()
|
|
||||||
.eq(EcgdataDO::getUserid, userId)
|
|
||||||
.eq(EcgdataDO::getCollecttime, new Date(collecttime))
|
|
||||||
.orderByDesc(EcgdataDO::getId));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<LocalDateTime> getDistinctCollectTimeByUserId(Integer userId) {
|
public List<LocalDateTime> getDistinctCollectTimeByUserId(Integer userId) {
|
||||||
return ecgdataMapper.selectDistinctCollectTimeByUserId(userId);
|
return ecgdataMapper.selectDistinctCollectTimeByUserId(userId);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user