|
|
|
@@ -2,6 +2,7 @@ package com.iformall.service.impl; |
|
|
|
import com.iformall.domain.dto.WxUserCouponDto; |
|
|
|
import com.iformall.domain.po.WxCoupon; |
|
|
|
import com.iformall.domain.po.WxCouponOrder; |
|
|
|
import com.iformall.domain.po.base.TenantEntity; |
|
|
|
import com.iformall.mapper.WxCouponMapper; |
|
|
|
import com.iformall.mapper.WxCouponOrderMapper; |
|
|
|
import com.iformall.service.WxUserCouponService; |
|
|
|
@@ -34,11 +35,12 @@ public class WxUserCouponServiceImpl implements WxUserCouponService { |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public List<WxUserCouponDto> findList(Long userId, int status) { |
|
|
|
public List<WxUserCouponDto> findList(TenantEntity tenantEntity,Long userId, int status) { |
|
|
|
//TODO 待测试优化 |
|
|
|
List<WxUserCouponDto> wxUserCoupons = new ArrayList<>(); |
|
|
|
//查询订单表 |
|
|
|
WxCouponOrder wxCouponOrder = new WxCouponOrder(); |
|
|
|
wxCouponOrder.updateTenantInfo(tenantEntity); |
|
|
|
wxCouponOrder.setCUserId(userId); |
|
|
|
wxCouponOrder.setCouponOrderStatus(status);//状态:0,待使用 1,已核销 2,已过期 3,已退款 |
|
|
|
List<WxCouponOrder> wxCouponOrders = wxCouponOrderMapper.findList(wxCouponOrder); |
|
|
|
@@ -47,6 +49,7 @@ public class WxUserCouponServiceImpl implements WxUserCouponService { |
|
|
|
} |
|
|
|
List<Long> ids = wxCouponOrders.stream().map(p->p.getCouponId()).distinct().collect(Collectors.toList()); |
|
|
|
WxCoupon wxCoupon = new WxCoupon(); |
|
|
|
wxCoupon.updateTenantInfo(tenantEntity); |
|
|
|
wxCoupon.setIds(ids); |
|
|
|
List<WxCoupon> wxCoupons = wxCouponMapper.findList(wxCoupon); |
|
|
|
Map<Long,WxCoupon> couponNamesMap = wxCoupons.stream().collect(Collectors.toMap(WxCoupon::getId,p->p)); |
|
|
|
|