|
|
|
@@ -104,16 +104,30 @@ public class WxPressBatchController extends BaseController { |
|
|
|
if (null == id) { |
|
|
|
return new ResultData(Result.ERROR,"参数错误"); |
|
|
|
} |
|
|
|
List<Long> couponIdList = wxPressBatchService.getItemCouponIdList(id, getTenantInfo().getTenantId()); |
|
|
|
WxCoupon record = new WxCoupon(); |
|
|
|
record.updateTenantInfo(getTenantInfo()); |
|
|
|
if (null != couponIdList && couponIdList.size() > 0 ) { |
|
|
|
record.setIds(couponIdList); |
|
|
|
}else { |
|
|
|
record.setId(0L); |
|
|
|
TenantEntity tenantEntity = getTenantInfo(); |
|
|
|
List<WxPressBatchItem> items = wxPressBatchService.getItemList(id, tenantEntity.getTenantId()); |
|
|
|
if (null != items && items.size() > 0 ) { |
|
|
|
List<Long> couponIdList = wxPressBatchService.getItemCouponIdList(id, tenantEntity.getTenantId()); |
|
|
|
WxCoupon record = new WxCoupon(); |
|
|
|
record.updateTenantInfo(getTenantInfo()); |
|
|
|
if (null != couponIdList && couponIdList.size() > 0 ) { |
|
|
|
record.setIds(couponIdList); |
|
|
|
}else { |
|
|
|
record.setId(0L); |
|
|
|
} |
|
|
|
List<WxCoupon> list = wxCouponService.list(record); |
|
|
|
Map<Long,WxCoupon> couponMap = new HashMap<Long,WxCoupon>(); |
|
|
|
if (null != list && list.size() > 0 ) { |
|
|
|
for (WxCoupon c : list) { |
|
|
|
couponMap.put(c.getId(), c); |
|
|
|
} |
|
|
|
} |
|
|
|
for (WxPressBatchItem pbi : items) { |
|
|
|
WxCoupon coupon = couponMap.get(pbi.getCouponId()); |
|
|
|
pbi.setCoupon(coupon); |
|
|
|
} |
|
|
|
} |
|
|
|
List<WxCoupon> list = wxCouponService.list(record); |
|
|
|
return new ResultData(list); |
|
|
|
return new ResultData(items); |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation("删除接口") |
|
|
|
|