|
|
|
@@ -122,7 +122,20 @@ public class WxTopicServiceImpl implements WxTopicService { |
|
|
|
@Override |
|
|
|
public WxTopic findById(WxTopic record) { |
|
|
|
WxTopic wxTopic = wxTopicMapper.selectByPrimaryKey(record.getId()); |
|
|
|
wxTopic.setCouponList(wxCouponMapper.findCouponByTopic(record)); |
|
|
|
List<WxCoupon> wxCouponList = wxCouponMapper.findCouponByTopic(record); |
|
|
|
wxTopic.setCouponList(wxCouponList); |
|
|
|
String couponIds = ""; |
|
|
|
if(CollectionUtils.isNotEmpty(wxCouponList)) { |
|
|
|
for (int i = 0; i < wxCouponList.size(); i++) { |
|
|
|
WxCoupon wxCoupon = wxCouponList.get(i); |
|
|
|
if (i == wxCouponList.size() - 1) { |
|
|
|
couponIds += wxCoupon.getId().toString(); |
|
|
|
} else { |
|
|
|
couponIds += wxCoupon.getId().toString() + ","; |
|
|
|
} |
|
|
|
} |
|
|
|
wxTopic.setCouponIds(couponIds); |
|
|
|
} |
|
|
|
return wxTopic; |
|
|
|
} |
|
|
|
} |