Browse Source

[C端首页][修改][换一换拼团和砍价]

release_toaliyun_real
gongbiao 6 years ago
parent
commit
29edae4968
1 changed files with 11 additions and 7 deletions
  1. +11
    -7
      mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java

+ 11
- 7
mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java View File

@@ -144,16 +144,20 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService {
couponId = record.getCouponId();
record.setCouponId(null);
}
List<WxCouponChannelVo> voList = wxCouponChannelMapper.findVoList(record);
if (voList.isEmpty()) {
return null;
}
if (voList.size() == 1) {
return voList.get(0);
}
Long finalCouponId = couponId;
List<WxCouponChannelVo> voList = wxCouponChannelMapper.findVoList(record).stream()
voList = voList.stream()
.filter(wxCouponChannelVo -> !wxCouponChannelVo.getCouponId().equals(finalCouponId))
.collect(Collectors.toList());
if (!voList.isEmpty()) {
int size = voList.size();
Random random = new Random();
return voList.get(random.nextInt(size));
}
return null;
int size = voList.size();
Random random = new Random();
return voList.get(random.nextInt(size));
}

private boolean isCouponMerchantValid(Long couponId) {


Loading…
Cancel
Save