Commit 0208a645 by 吕明尚

团购优惠券适用门店id没有时,补充为所有门店id

parent a95d86a3
......@@ -205,6 +205,9 @@ public class SConsumerCouponServiceImpl extends ServiceImpl<SConsumerCouponMappe
checkCoupon(item,couponRequest,sStores,sRooms,sPacks,timeLong);
SConsumerCouponVo vo = new SConsumerCouponVo();
BeanUtils.copyProperties(item, vo);
if (item.getCouponType().equals(CouponTypeEnum.CASH.getCode()) && StringUtils.isEmpty(item.getStoreIds())) {
item.setStoreIds(sStores.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(sStores.stream().filter(store -> storeIds.contains(store.getId())).map(SStore::getName).collect(Collectors.toList()));
......
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