|
|
|
@@ -192,7 +192,7 @@ public class WxTopicServiceImpl implements WxTopicService { |
|
|
|
|
|
|
|
if(EnumWxTopicType.SPECIAL_TOPIC.getCode().equals(record.getTopicType())){ |
|
|
|
wxCouponChannel.setSubTargetId(record.getId()); |
|
|
|
pageSize = 1000;//默认专题查全部 |
|
|
|
// pageSize = 1000;//默认专题查全部 |
|
|
|
// wxCouponChannelVoPageInfo = wxCouponChannelService.listPageCVo(wxCouponChannel, 1, 100); |
|
|
|
// record.setCouponList(wxCouponMapper.findCouponByTopic(record)); |
|
|
|
}else if(EnumWxTopicType.FLASH_SALE.getCode().equals(record.getTopicType())){ |
|
|
|
@@ -223,19 +223,16 @@ public class WxTopicServiceImpl implements WxTopicService { |
|
|
|
@Override |
|
|
|
public WxTopic findById(WxTopic record) { |
|
|
|
WxTopic wxTopic = wxTopicMapper.selectById(record.getId()); |
|
|
|
if(EnumWxTopicType.SPECIAL_TOPIC.getCode().equals(record.getTopicType())){ |
|
|
|
addCouponList(wxTopic); |
|
|
|
// List<WxCoupon> wxCouponList = wxCouponMapper.findCouponByTopic(record); |
|
|
|
// wxTopic.setCouponList(wxCouponList); |
|
|
|
List<WxCouponChannelVo> couponList = wxTopic.getCouponList(); |
|
|
|
if(EnumWxTopicType.SPECIAL_TOPIC.getCode().equals(wxTopic.getTopicType())){ |
|
|
|
List<WxCoupon> wxCouponList = wxCouponMapper.findCouponByTopic(wxTopic); |
|
|
|
String couponIds = ""; |
|
|
|
if(CollectionUtils.isNotEmpty(couponList)) { |
|
|
|
for (int i = 0; i < couponList.size(); i++) { |
|
|
|
WxCouponChannelVo couponChannel = couponList.get(i); |
|
|
|
if (i == couponList.size() - 1) { |
|
|
|
couponIds += couponChannel.getType() +"-"+ couponChannel.getCouponId().toString(); |
|
|
|
if(CollectionUtils.isNotEmpty(wxCouponList)) { |
|
|
|
for (int i = 0; i < wxCouponList.size(); i++) { |
|
|
|
WxCoupon coupon = wxCouponList.get(i); |
|
|
|
if (i == wxCouponList.size() - 1) { |
|
|
|
couponIds += coupon.getType() +"-"+ coupon.getId().toString(); |
|
|
|
} else { |
|
|
|
couponIds += couponChannel.getType() +"-"+ couponChannel.getCouponId().toString() + ","; |
|
|
|
couponIds += coupon.getType() +"-"+ coupon.getId().toString() + ","; |
|
|
|
} |
|
|
|
} |
|
|
|
wxTopic.setCouponIds(couponIds); |
|
|
|
@@ -244,6 +241,26 @@ public class WxTopicServiceImpl implements WxTopicService { |
|
|
|
return wxTopic; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public WxTopic findCById(WxTopic record) { |
|
|
|
WxTopic wxTopic = wxTopicMapper.selectById(record.getId()); |
|
|
|
if(EnumWxTopicType.SPECIAL_TOPIC.getCode().equals(wxTopic.getTopicType())){ |
|
|
|
WxCouponChannel wxCouponChannel = new WxCouponChannel(); |
|
|
|
wxCouponChannel.updateTenantInfo(wxTopic); |
|
|
|
wxCouponChannel.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); |
|
|
|
wxCouponChannel.setCouponStatus(EnumCouponStatus.COUPON_STATUS_THROW_IN.getCode()); |
|
|
|
wxCouponChannel.setSortColumns(BaseEntity.SortField.CCUpdateDate_DESC, BaseEntity.SortField.CCId_DESC); |
|
|
|
wxCouponChannel.setShowBeginTime(new Date()); |
|
|
|
wxCouponChannel.setSubTargetId(wxTopic.getId()); |
|
|
|
PageInfo<WxCouponChannelVo> wxCouponChannelVoPageInfo = wxCouponChannelService.listPageCVo(wxCouponChannel, 1, 100); |
|
|
|
if(wxCouponChannelVoPageInfo != null && wxCouponChannelVoPageInfo.getList() != null |
|
|
|
&& wxCouponChannelVoPageInfo.getList().size() > 0){ |
|
|
|
wxTopic.setCouponList(wxCouponChannelVoPageInfo.getList()); |
|
|
|
} |
|
|
|
} |
|
|
|
return wxTopic; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public WxTopic findByType(WxTopic wxTopic) { |
|
|
|
List<WxTopic> list = wxTopicMapper.findList(wxTopic); |
|
|
|
|