|
|
|
@@ -73,16 +73,24 @@ public class WxCouponController extends BaseController |
|
|
|
if(!list.isEmpty()){ |
|
|
|
Map<Long, List<WxCouponChannel>> groupBy = list.stream().collect(Collectors.groupingBy(WxCouponChannel::getCouponId)); |
|
|
|
for (WxCoupon temp:wxCouponList) { |
|
|
|
List<Integer> channels=new ArrayList<>(); |
|
|
|
|
|
|
|
if(groupBy.get(temp.getId())!=null){ |
|
|
|
List<Integer> channels=new ArrayList<>(); |
|
|
|
for (WxCouponChannel tempchannel:groupBy.get(temp.getId())) { |
|
|
|
channels.add(tempchannel.getTargetAd()); |
|
|
|
} |
|
|
|
|
|
|
|
String sss = JSON.toJSONString(channels); |
|
|
|
temp.setChannels(sss); |
|
|
|
}else{ |
|
|
|
temp.setChannels(""); |
|
|
|
} |
|
|
|
String sss = JSON.toJSONString(channels); |
|
|
|
temp.setChannels(sss); |
|
|
|
|
|
|
|
} |
|
|
|
}else{ |
|
|
|
for (WxCoupon temp:wxCouponList) { |
|
|
|
temp.setChannels(""); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return new ResultData(page); |
|
|
|
@@ -107,6 +115,7 @@ public class WxCouponController extends BaseController |
|
|
|
wxCoupon.setBusiness(JSON.toJSONString(arys)); |
|
|
|
} |
|
|
|
wxCoupon.setTenantId(getUser().getTenantId()); |
|
|
|
wxCoupon.setChannels(""); |
|
|
|
Long id = wxCouponService.saveOrUpdate(wxCoupon); |
|
|
|
return new ResultData(id); |
|
|
|
} |
|
|
|
|