fix pointRecommendLine 优化代码
This commit is contained in:
@@ -661,14 +661,13 @@ public class PointServiceImpl implements PointService {
|
||||
if(CollectionUtils.isNotEmpty(recommendList)){
|
||||
throw new ServiceException(ErrorCodeEnum.ERROR_MESSAGE, "推送失败,铺位已被选");
|
||||
}
|
||||
List<Long> shopIds = recommendPointList.stream().filter(o -> PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_1.getCode().equals(o.getStatus())).filter(o->request.getShopIds().contains(o.getShopId())).map(PointRecommendDO::getShopId).collect(Collectors.toList());
|
||||
if(CollectionUtils.isNotEmpty(shopIds)){
|
||||
shopIds.retainAll(request.getShopIds());
|
||||
List<Long> shopIds = recommendPointList.stream()
|
||||
.filter(o -> PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_1.getCode().equals(o.getStatus()))
|
||||
.filter(o->request.getShopIds().contains(o.getShopId())).map(PointRecommendDO::getShopId).collect(Collectors.toList());
|
||||
if(CollectionUtils.isNotEmpty(shopIds)){
|
||||
throw new ServiceException(ErrorCodeEnum.ERROR_MESSAGE, "请勿重复推送");
|
||||
}
|
||||
}
|
||||
}
|
||||
List<PointRecommendDO> recommendList = request.convertList();
|
||||
return pointRecommendDAO.addRecommendPoint(recommendList);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user