Sfoglia il codice sorgente

[卡券][修改]:bug修复,新增显示channels

release_toaliyun_real
masterspirit 7 anni fa
parent
commit
82f70d4158
1 ha cambiato i file con 13 aggiunte e 4 eliminazioni
  1. +13
    -4
      mallinkAdmin/src/main/java/com/simple/controller/WxCouponController.java

+ 13
- 4
mallinkAdmin/src/main/java/com/simple/controller/WxCouponController.java Vedi File

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


Caricamento…
Annulla
Salva