You've already forked FrameTour-BE
refactor(order): 移除冗余的用户ID参数
- 删除了 OrderBiz 中 listImageByFaceRelation 方法调用时多余的 memberId 参数 - 更新了 SourceRepository 中 listVideoByFaceRelation 和 listImageByFaceRelation 方法的参数列表,移除了不再需要的 userId 参数 - 简化了 AppScenicServiceImpl 中 ScenicAppVO 对象的属性设置逻辑,去除了部分字段赋值
This commit is contained in:
@@ -287,14 +287,14 @@ public class OrderBiz {
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
List<SourceEntity> imageSource = sourceMapper.listImageByFaceRelation(order.getMemberId(), orderItemVO.getGoodsId());
|
||||
List<SourceEntity> imageSource = sourceMapper.listImageByFaceRelation(orderItemVO.getGoodsId());
|
||||
Optional<SourceEntity> min = imageSource.stream().min(Comparator.comparing(SourceEntity::getCreateTime));
|
||||
if (min.isPresent()) {
|
||||
goodsCreateTime = min.get().getCreateTime();
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
List<SourceEntity> videoSource = sourceMapper.listImageByFaceRelation(order.getMemberId(), orderItemVO.getGoodsId());
|
||||
List<SourceEntity> videoSource = sourceMapper.listImageByFaceRelation(orderItemVO.getGoodsId());
|
||||
Optional<SourceEntity> minTime = videoSource.stream().min(Comparator.comparing(SourceEntity::getCreateTime));
|
||||
if (minTime.isPresent()) {
|
||||
goodsCreateTime = minTime.get().getCreateTime();
|
||||
|
||||
@@ -78,13 +78,13 @@ public class SourceRepository {
|
||||
}
|
||||
switch (type) {
|
||||
case 1:
|
||||
List<SourceEntity> videoSourceList = sourceMapper.listVideoByFaceRelation(userId, faceId);
|
||||
List<SourceEntity> videoSourceList = sourceMapper.listVideoByFaceRelation(faceId);
|
||||
if (videoSourceList == null || videoSourceList.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
return videoSourceList.stream().filter(Objects::nonNull).anyMatch(item -> Integer.valueOf(1).equals(item.getIsBuy()));
|
||||
case 2:
|
||||
List<SourceEntity> imageSourceList = sourceMapper.listImageByFaceRelation(userId, faceId);
|
||||
List<SourceEntity> imageSourceList = sourceMapper.listImageByFaceRelation(faceId);
|
||||
if (imageSourceList == null || imageSourceList.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -282,16 +282,8 @@ public class AppScenicServiceImpl implements AppScenicService {
|
||||
ScenicAppVO scenicAppVO = new ScenicAppVO();
|
||||
scenicAppVO.setId(scenicEntity.getId());
|
||||
scenicAppVO.setName(scenicEntity.getName());
|
||||
scenicAppVO.setPhone(scenicEntity.getPhone());
|
||||
scenicAppVO.setIntroduction(scenicEntity.getIntroduction());
|
||||
scenicAppVO.setCoverUrl(scenicEntity.getCoverUrl());
|
||||
scenicAppVO.setLongitude(scenicEntity.getLongitude());
|
||||
scenicAppVO.setLatitude(scenicEntity.getLatitude());
|
||||
scenicAppVO.setRadius(scenicEntity.getRadius());
|
||||
scenicAppVO.setProvince(scenicEntity.getProvince());
|
||||
scenicAppVO.setCity(scenicEntity.getCity());
|
||||
scenicAppVO.setArea(scenicEntity.getArea());
|
||||
scenicAppVO.setAddress(scenicEntity.getAddress());
|
||||
scenicAppVO.setDistance(distance);
|
||||
|
||||
// 获取设备数量
|
||||
|
||||
Reference in New Issue
Block a user