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;
|
break;
|
||||||
case 1:
|
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));
|
Optional<SourceEntity> min = imageSource.stream().min(Comparator.comparing(SourceEntity::getCreateTime));
|
||||||
if (min.isPresent()) {
|
if (min.isPresent()) {
|
||||||
goodsCreateTime = min.get().getCreateTime();
|
goodsCreateTime = min.get().getCreateTime();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 2:
|
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));
|
Optional<SourceEntity> minTime = videoSource.stream().min(Comparator.comparing(SourceEntity::getCreateTime));
|
||||||
if (minTime.isPresent()) {
|
if (minTime.isPresent()) {
|
||||||
goodsCreateTime = minTime.get().getCreateTime();
|
goodsCreateTime = minTime.get().getCreateTime();
|
||||||
|
|||||||
@@ -78,13 +78,13 @@ public class SourceRepository {
|
|||||||
}
|
}
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 1:
|
case 1:
|
||||||
List<SourceEntity> videoSourceList = sourceMapper.listVideoByFaceRelation(userId, faceId);
|
List<SourceEntity> videoSourceList = sourceMapper.listVideoByFaceRelation(faceId);
|
||||||
if (videoSourceList == null || videoSourceList.isEmpty()) {
|
if (videoSourceList == null || videoSourceList.isEmpty()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return videoSourceList.stream().filter(Objects::nonNull).anyMatch(item -> Integer.valueOf(1).equals(item.getIsBuy()));
|
return videoSourceList.stream().filter(Objects::nonNull).anyMatch(item -> Integer.valueOf(1).equals(item.getIsBuy()));
|
||||||
case 2:
|
case 2:
|
||||||
List<SourceEntity> imageSourceList = sourceMapper.listImageByFaceRelation(userId, faceId);
|
List<SourceEntity> imageSourceList = sourceMapper.listImageByFaceRelation(faceId);
|
||||||
if (imageSourceList == null || imageSourceList.isEmpty()) {
|
if (imageSourceList == null || imageSourceList.isEmpty()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -282,16 +282,8 @@ public class AppScenicServiceImpl implements AppScenicService {
|
|||||||
ScenicAppVO scenicAppVO = new ScenicAppVO();
|
ScenicAppVO scenicAppVO = new ScenicAppVO();
|
||||||
scenicAppVO.setId(scenicEntity.getId());
|
scenicAppVO.setId(scenicEntity.getId());
|
||||||
scenicAppVO.setName(scenicEntity.getName());
|
scenicAppVO.setName(scenicEntity.getName());
|
||||||
scenicAppVO.setPhone(scenicEntity.getPhone());
|
|
||||||
scenicAppVO.setIntroduction(scenicEntity.getIntroduction());
|
|
||||||
scenicAppVO.setCoverUrl(scenicEntity.getCoverUrl());
|
scenicAppVO.setCoverUrl(scenicEntity.getCoverUrl());
|
||||||
scenicAppVO.setLongitude(scenicEntity.getLongitude());
|
|
||||||
scenicAppVO.setLatitude(scenicEntity.getLatitude());
|
|
||||||
scenicAppVO.setRadius(scenicEntity.getRadius());
|
scenicAppVO.setRadius(scenicEntity.getRadius());
|
||||||
scenicAppVO.setProvince(scenicEntity.getProvince());
|
|
||||||
scenicAppVO.setCity(scenicEntity.getCity());
|
|
||||||
scenicAppVO.setArea(scenicEntity.getArea());
|
|
||||||
scenicAppVO.setAddress(scenicEntity.getAddress());
|
|
||||||
scenicAppVO.setDistance(distance);
|
scenicAppVO.setDistance(distance);
|
||||||
|
|
||||||
// 获取设备数量
|
// 获取设备数量
|
||||||
|
|||||||
Reference in New Issue
Block a user