|
|
|
@@ -7,6 +7,7 @@ import com.iformall.domain.po.*; |
|
|
|
import com.iformall.mapper.*; |
|
|
|
import com.iformall.service.*; |
|
|
|
import org.apache.commons.collections.CollectionUtils; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.slf4j.Logger; |
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
@@ -29,12 +30,20 @@ public class WxCardDailyLogServiceImpl implements WxCardDailyLogService { |
|
|
|
|
|
|
|
@Override |
|
|
|
public PageInfo<WxCardDailyLog> listAsPage(WxCardDailyLog record, Integer pageIndex, Integer pageSize) { |
|
|
|
if (StringUtils.isNotBlank(record.getTitle())){ |
|
|
|
List<WxCoupon> title = wxCouponService.getByIdListOrTitle(new ArrayList<>(), record.getTenantId(), record.getTitle()); |
|
|
|
if (!CollectionUtils.isEmpty(title)){ |
|
|
|
List<Long> couponIds = title.parallelStream().map(WxCoupon::getId).collect(Collectors.toList()); |
|
|
|
record.setCouponIds(couponIds); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
PageInfo<WxCardDailyLog> pageInfo = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCardDailyLogMapper.findList(record)); |
|
|
|
if (CollectionUtils.isEmpty(pageInfo.getList())){ |
|
|
|
return pageInfo; |
|
|
|
} |
|
|
|
List<Long> couponIds = pageInfo.getList().parallelStream().map(WxCardDailyLog::getCouponId).collect(Collectors.toList()); |
|
|
|
List<WxCoupon> list = wxCouponService.getByIdList(couponIds, record.getTenantId()); |
|
|
|
List<WxCoupon> list = wxCouponService.getByIdListOrTitle(couponIds, record.getTenantId(), null); |
|
|
|
if (CollectionUtils.isEmpty(list)){ |
|
|
|
return pageInfo; |
|
|
|
} |
|
|
|
|