|
|
|
@@ -66,17 +66,21 @@ public class WxCouponController extends BaseController |
|
|
|
List<Long> ids = wxCouponList.stream().map(p->p.getId()).collect(Collectors.toList()); |
|
|
|
WxCouponChannel wxCouponChannel = new WxCouponChannel(); |
|
|
|
wxCouponChannel.setTenantId(getTenantId()); |
|
|
|
wxCouponChannel.setIds(ids); |
|
|
|
wxCouponChannel.setCouponIds(ids); |
|
|
|
//上架状态 |
|
|
|
List<WxCouponChannel> list = wxCouponChannelService.listAsPage(wxCouponChannel,1,5).getList(); |
|
|
|
if(!list.isEmpty()){ |
|
|
|
Map<Long, List<WxCouponChannel>> groupBy = list.stream().collect(Collectors.groupingBy(WxCouponChannel::getCouponId)); |
|
|
|
for (WxCoupon temp:wxCouponList) { |
|
|
|
List<String> channels=new ArrayList<>(); |
|
|
|
List<Integer> channels=new ArrayList<>(); |
|
|
|
if(groupBy.get(temp.getId())!=null){ |
|
|
|
String sss = JSON.toJSONString(groupBy.get(temp.getId())); |
|
|
|
temp.setChannels(sss); |
|
|
|
for (WxCouponChannel tempchannel:groupBy.get(temp.getId())) { |
|
|
|
channels.add(tempchannel.getTargetAd()); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
String sss = JSON.toJSONString(channels); |
|
|
|
temp.setChannels(sss); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|