fix(printer):修复用户照片列表查询逻辑

- 修正了当faceId为null时的过滤条件判断
- 调整了listRelation方法的过滤逻辑,确保正确返回无faceId关联的数据
-保证了getUserPhotoList接口在不同参数下的正确性
This commit is contained in:
2025-11-05 15:26:09 +08:00
parent fa0c3a1a43
commit 054958ebf5

View File

@@ -214,10 +214,10 @@ public class PrinterServiceImpl implements PrinterService {
@Override @Override
public List<MemberPrintResp> getUserPhotoList(Long userId, Long scenicId, Long faceId) { public List<MemberPrintResp> getUserPhotoList(Long userId, Long scenicId, Long faceId) {
if (faceId != null) { if (faceId == null) {
List<MemberPrintResp> list = printerMapper.listRelation(userId, scenicId); List<MemberPrintResp> list = printerMapper.listRelation(userId, scenicId);
return list.stream() return list.stream()
.filter(item -> Objects.nonNull(item.getFaceId())) .filter(item -> Objects.isNull(item.getFaceId()))
.collect(Collectors.toList()); .collect(Collectors.toList());
} }
List<MemberPrintResp> list = printerMapper.listRelationByFaceId(userId, scenicId, faceId); List<MemberPrintResp> list = printerMapper.listRelationByFaceId(userId, scenicId, faceId);