Commit 0d848ecd by 吕明尚

优惠券查询增加适用门店名称

parent 9ee574e5
...@@ -106,6 +106,13 @@ public class SConsumerCouponServiceImpl extends ServiceImpl<SConsumerCouponMappe ...@@ -106,6 +106,13 @@ public class SConsumerCouponServiceImpl extends ServiceImpl<SConsumerCouponMappe
if (!ObjectUtils.isEmpty(item.getStoreId())) { if (!ObjectUtils.isEmpty(item.getStoreId())) {
vo.setStoreName(list.stream().filter(obj -> obj.getId().equals(item.getStoreId())).findFirst().get().getName()); vo.setStoreName(list.stream().filter(obj -> obj.getId().equals(item.getStoreId())).findFirst().get().getName());
} }
if (item.getCouponType().equals(CouponTypeEnum.CASH.getCode()) && StringUtils.isEmpty(item.getStoreIds())) {
item.setStoreIds(list.stream().map(SStore::getId).collect(Collectors.toList()).stream().map(String::valueOf).collect(Collectors.joining(",")));
}
if (StringUtils.isNotEmpty(item.getStoreIds())) {
List<Long> storeIds = Arrays.asList(item.getStoreIds().split(",")).stream().map(Long::parseLong).collect(Collectors.toList());
vo.setStoreNameList(list.stream().filter(store -> storeIds.contains(store.getId())).map(SStore::getName).collect(Collectors.toList()));
}
voList.add(vo); voList.add(vo);
}); });
return voList; return voList;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment